Deathball is a sports mod. It needs stats. Good stats. Now. I've been trying to do some of the legwork in trying to integrate the stats that Deathball uses into the existing UT2004 gamestats engine to make recording/reporting easy. Here's a chatlog from one of my efforts.
Bill/Imaginos says:
Howdy Overlord, can you spare a few mins for some questions?
overload@planetunreal.com says:
Sure
Bill/Imaginos says:
I've decompiled the deathball.u files to backtrack the default stats and look for points to insert deathball-relevant game events in. from what I have been reading on wiki, the master server won't know what to do with our altered stats
overload@planetunreal.com says:
That's correct
But you report them anyway
Bill/Imaginos says:
this is ok, since our goal is to parse and report them on our own via utstats2003.
overload@planetunreal.com says:
Pretty much all the stats you'd output would be from the deathball's game class, and you can probably do everything with GameEvents and PlayerEvents
Bill/Imaginos says:
that's what I'm led to believe.. I am having a hard time convincing the developer to give it attention right now, so i'm trying to do the legwork to make it easy to implement.
would the kill/death output be easy to alter? we call them tackles in deathball.. there's good tackles (enemy in your half with the ball) and bad tackles. (ball on enemy half). we would need to distinguish them from generic kills.
wiki suggests that the killevent is called w/o regard to the gameclass
overload@planetunreal.com says:
Hmmm
Let me see
Bill/Imaginos says:
also, I'm nowhere close to being a uscript programmer. would the insertion of so many custom game/playerevents introduce too much overhead?
overload@planetunreal.com says:
No, you would never notice any performance hit, if that's what you're asking OLStats does an insane number of crazy calulations to track accuracy, and it doesn't slow down
Killevent is called from the gameclass' Killed() function, so you'd have to override that and make it not send a killevent
Bill/Imaginos says:
good. that's a checkmark to the plus category, performance wise. and the killevent would have to be replaced with a tackleevent. I thought so. wasn't sure if it was legal though.
overload@planetunreal.com says:
Then you would have to call KillEvent() yourself when a player is "tackled"
The trick is outputting something different so UTStatsDB can track it. It will require modification on UTStatsDB's end
Bill/Imaginos says:
I had no doubt about that. custom variables and likely another table.
overload@planetunreal.com says:
Okay, on second thought.
PRobably the best way to go about doing this would be to leave killevent alone
Every player gets points when they make a tackle, right?
Bill/Imaginos says:
yes. +1 or -1
overload@planetunreal.com says:
Then that means that a ScoreEvent() must be getting called for each of those. What I would do is modify that scoreevent
And for the third parameter ("Desc") - you put in something that tells it if it's a friendly side tackle or whatever
so you'd call ScoreEvent(Killer, 1, "friendly_side_tackle")
You can use whatever you want for hte Desc, as long as it's descriptive enough and won't conflict with some other imaginary mod in the future
Bill/Imaginos says:
each player accumulates an offensive and defensive score which increases or decreases based on how well they do or don't do..
overload@planetunreal.com says:
That part would be a little tricky
Thta's a whole new (couple) numbers to keep track of
Bill/Imaginos says:
exactly. those scores may have to be combined
overload@planetunreal.com says:
Is it easy enough to recalculate on UTStatsDB's end?
Bill/Imaginos says:
haven't gotten that far with it yet.
overload@planetunreal.com says:
Meaning, is it a simply calculation? Do you always get one offense point for tackling in a certain way?
Bill/Imaginos says:
good tackles = 1, bad = -1
saves = x, interception = x, bad pass = -x
overload@planetunreal.com says:
You may be able to just do those custom ScoreEvent() calls, and then there would be enough data for UTStatsDB to calculate the offense and defense score of each player
Bill/Imaginos says:
along with numeric stats, that would be a nice performance average to rank player effectiveness
overload@planetunreal.com says:
The bottom line is that it's always best to do as much as possible without using custom events. 'Swhy it's good to use the ScoreEvent with your own descriptions - and if you need to report something special, use GameEvent() or PlayerEvent() (depending on how much data you need to report)
Bill/Imaginos says:
difficult to say what would be best to report completed passes, playerevent or gameevent, but if it is tied to a point award(or decrease) using scorevent does sound like it makes more sense.
Bill/Imaginos says:
I'd prefer not to force utstatsdb to keep track of ball possession.. not when we can do it via playerscorevent
overload@planetunreal.com says:
Yeah. If the player's score changes, use scoreevent. The way to decide if you need to use playerevent or gameevent is simply how much data you need to report. Both of the events take a player as a param, but GameEvent() takes two params, one "GEvent" which is the name of the event, and one "Desc" which is further detal on the event (a lot of times a number). SpecialEvent only takes one, the name of the event.
Keeping track of who has the ball should be tracked with GameEvents
Every time the ball is picked up or leaves someone's hands it should be reported. Bombing Run and CTF already do that
Bill/Imaginos says:
taking possession credits the player with a ball touch, but no score. and the bomb_throw event I think is the one I was looking at in BR..
bombing run also tracks the three most recent people to touch the ball? two assists + the scorer?
Bill/Imaginos says:
I do appreciate your time in helping me out. I'm trying to do as much homework as I can on this too. I have the unrealwiki and uncodex-ut2004 to use as references already. do you recommend any others that would be better suited for the gamestats development?
overload@planetunreal.com says:
The wiki's pretty much all I use, and not very often. I figured it all out through trial and error
Bombing run does track assists
Actually it's tracked by the ball
The ball remembers everyone who touched it on the way
Bill/Imaginos says:
nice. that makes it easy to award assist points after a goal.
overload@planetunreal.com says:
And gives each assisting player 20 divided by the number of assists, with a minumim of one point and a max of 5
Bill/Imaginos says:
should save the trouble of having to declare all those events too, although deathball only awards the two last assisting players.
Once a functioning stats system is in place, I think it will really attract people to deathball now that it has more credibility as a sport mod.
overload@planetunreal.com says:
Yeah'
Bill/Imaginos says:
I'll start digging into the code and trying to work out the insertion points to share with the dev team. I'm sure they may have an easier time buying into this now that we've determined it shouldn't be hard to do at all.
the sooner we can get a good deathball logged output, the sooner Panthera can decide if he can/will add the custom work to track it.