Author |
Message |
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Mar 12, 2006 8:03 pm Post subject: |
|
|
|
|
Cyan~Fire wrote: | That seemed pretty "against" to me, though I did not mean "against" in the way you took it. Perhaps I should have used "dislike". |
I say it with no emotion or intent. It is just fact. Pbot was designed to work exactly as we wanted in PB. asss was designed generically--from my point of view almost in a vacuum. As such, doing specific things like we do is more work.
Given that, I have to decide our approach to dealing with bots. Initially we will be using all bots. Most stuff we have will "port" ok.
The stats module is the biggest issue. asss has no notion of a player set. pbot keeps a player list for all players per arena, even those who have left. Because of this, if a player is playing a game, leaves, comes back and completes the game, their stats just continue to accumulate automatically. The stats bot doesn't have to do extra work to manage this because the core does it. The HZ devs are telling me I need to use asss persistence or write stuff to a DB every time a player leaves, and retreive it when they return. Also I will need to know which game they were playing, so if they come back 3 games later, I don't load partial stats from an old game. This is a LOT of extra work to make stats function, and I find either solution to be hack-ish. I may end up making the stats module keep it's own player list separate from the asss-core to accommodate this cleanly. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sun Mar 12, 2006 9:23 pm Post subject: |
|
|
|
|
Before you start jumping to conclusions about the stats module, talk to grelminar. He's the only one that knows exactly how it works, what it can and can't do, and what it could do in the future.
It was designed in a vacuum. ASSS wasn't perfect for Hyperspace when we first moved, but after working with grel on issues we had, it now fits us like a glove. I would assume you guys could do the same. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Sun Mar 12, 2006 10:30 pm Post subject: |
|
|
|
|
That's part of the problem. Grel is the only expert, and he is almost never around. The HZ dev guys, while being very gracious and as helpful as they are able, are just shooting in the dark. There's no go-to guy for asss, and the code is all but encrypted. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Mar 12, 2006 11:22 pm Post subject: |
|
|
|
|
ASSS was designed to be useful. The fact that it is not useful for a few of your specific purposes does not negate that.
Mr Ekted wrote: | and the code is all but encrypted |
I find that myself sometimes, but at least we have it, right? _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Mon Mar 13, 2006 12:47 am Post subject: |
|
|
|
|
I haven't seen him around in the past few days, true, but he's usually pretty good about responding. |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Mon Mar 13, 2006 6:09 am Post subject: |
|
|
|
|
To do stats like you said with the persist module use the 'game' interval. You will have to make your module progress this interval when the game is over (x goals or whatever). Interval reset is the normal one that ?scorereset and billing uses.
You will probably also need to implement SetStat for interval game. As the intervals at first glance seem to be independant from each other rather than accumalative/layered. I expect you will be using your own scoring modules so this shouldn't be a problem. |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Mar 13, 2006 12:18 pm Post subject: |
|
|
|
|
I spoke with grel at length about this last night. My problem is that I need to keep stats for all players (those here and those who have left) in the same way. Using the asss persist system means having to "remember" who is "not here" in a special list so I can retreive their persist info. Since I would have to keep a special list anyways, I'm just going to keep all players who have ever played in a list along with their stats. This way I can still treat all data generically, and don't have to use persist.
This will be a very common issue for zones that have the concept of a game (WZ, CZ, SWZ, etc) who want to migrate to asss. Since MERV didn't generically keep track of players who have left the arena, I suspect all bots based on it already do what I will have to. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Mon Mar 13, 2006 12:34 pm Post subject: |
|
|
|
|
That sounds reasonable. If you encapsulate the code to do that into its own module, you should be able to speed the conversion for those other zones you mentioned. |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Mar 13, 2006 12:47 pm Post subject: |
|
|
|
|
A very interesting idea. Something like GamePersist, with its own interface. However, as grel noted, that would mean duplicating a lot of the stuff in asss. I wouldn't want to tempt others away from using built-in stuff when it wasn't necessary. But still, making it a common module makes it more reusable. |
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: Mon Mar 13, 2006 2:24 pm Post subject: |
|
|
|
|
WZ (and aswz) uses persistent data for those that left the arena? Hmm, I'll add that to my list. _________________ Oldbie Server Help |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Mar 13, 2006 2:56 pm Post subject: |
|
|
|
|
i88gerbils wrote: | WZ (and aswz) uses persistent data for those that left the arena? Hmm, I'll add that to my list. |
Not saying they do, just that it's a natural thing. When a game ends, you display stats for all players who played, even those who are no longer there. Asss doesn't support this at all, even with its persistence system, because there is no way to retreive persistence data for a player who isn't connected. Even if there was, the stats moduel still needs to maintain a list of those players who played but have left, so it know who to retreive data for.
I'm still thinking about how I am going to handle this, but it's definitely not an immediate thing. |
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: Mon Mar 13, 2006 7:54 pm Post subject: |
|
|
|
|
Hmm.. Smong originally made game persistent data for race. |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Mar 14, 2006 7:04 pm Post subject: |
|
|
|
|
Ekted since a lot of people will want they kind of stats you described, why don't you see if you can modify asss to enumerate all players in a given interval? If you use interval game it is only supposed to hold records for players that actually have stats, ie: entered the arena during that game period. I suspect all the code you need will be in the dbtool source since it should be able to do that.
i88gerbils if you are referring to my hi-octane race module, that used a txt file (looking at the code again it's a good example how not to make a module, fx: if (strcmp(arena->name, "hio")) return; ). I don't think any of my other race modules saved anything. |
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: Tue Mar 14, 2006 7:21 pm Post subject: |
|
|
|
|
No I'm talking about the pdata struct. This added players who entered, but did not remove them when they left. That way when you ran generatestats() it would loop through the record of all players. Though it continue'd out of the loop when it found players marked as "not playing", which could easily be changed for what Mr. Ekted wants (the code snippet below).
if (p->arena != arena) continue;
if (p->p_ship == SHIP_SPEC) continue;
if (p->status != S_PLAYING || (!d->playing)) continue;
if (!d->playing) continue;
|
for instance i was going to use something similar for (as)wz stats such as :
struct {
u8 kills, deaths, tk, fl, steals; /* possibly flagtime, etc ... */
} pdata;
|
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Mar 14, 2006 7:43 pm Post subject: |
|
|
|
|
I think you misunderstood that bit of code. The d->playing was for players in the arena but not participating in the race (afk, finished race, etc).
I see 'pdata' as an asss convention for per player data. PPDATA is a macro in player.h:
pdata *d = PPDATA(p, pdkey);
The data only exists for as long as the player is in the arena. (It gets zero'd when they enter a new arena).
Anyway, there's nothing stopping you keeping a per arena LinkedList of data for each player that entered. Thinking about that now it would be easier to code than to mess around with the berkely db stuff. |
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: Tue Mar 14, 2006 7:50 pm Post subject: |
|
|
|
|
Hmm.. yeah. I had forgotten about pdata as player data zonewide and thought it only arenawide. I suck. |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Mar 14, 2006 9:05 pm Post subject: |
|
|
|
|
Grel suggested that I make a module to implement generic player data for games, so that others could use it as well. We'll see what happens when I get to that. |
|
Back to top |
|
|
i88gerbils Oldbie Server Help
Gender: Joined: Dec 13 2002 Posts: 423 Location: OH Offline
|
Posted: Wed Mar 15, 2006 3:25 pm Post subject: |
|
|
|
|
I think it's time to split this thread into the productive part. |
|
Back to top |
|
|
|