stats logging.

stats logging.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

stats logging.

Post by smoth »

As part of my scoreboard work, I plan on doing stats logging. and yes I want to do graphs, line and bar..

this will be done as 2 parts:
gadget:
- stores stats
- returns stats when requested

widget(will be chili deal with it)
- During the game will show player/team stats
-- unless you are a spec
- shows stats at end of game for all teams. Each team is it's own tab.
-- in not team games all players are shown on one screen.

will probably take me a few weeks to do. So the thoughts are what relevant stats? How do I record things like APM?

This is a general discussion thread about the idea, please do not be upset if I do NOT implement your suggestion, just doing this stuff will be a lot of work.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: stats logging.

Post by Google_Frog »

I can think of 3 things that may be able to record APM.

Widget:
I'm sure this method would work. Create a widget that collects whichever actions you want to track and periodically send them to synced. Users aren't really suppose to know about widgets when using a game with a complete UI so it's usage is almost guaranteed. To really enforce usage put the code in something important like the main UI.

Gadget:
I'm not sure if unsynced gadgets can track mouse and keyboard input. I've seen something in gadgets.lua that suggests they do but I have not looked into it. This is for strict enforcement.

Endgame Stats:
The engame stats have an APM field and I'm pretty sure lua can read them but this method has a few pitfalls. Firstly you are entirely at the mercy of the engine's APM implementation (I have no idea if it actually works), it doesn't display time dependant data and I think it only shows at the end of the game.

I'd go with a widget communicating with a gadget.

As for relevance you could collect keyboard and mouse presses. If you want to be really fancy you could further break down what those actions are used for.

As for team stats it's a question of how much you want to collect. Stats can be divided down to ridiculously fine levels. You can collect the incomes of your various resources, resource allocation, power etc... There are lots of combat stats many of which are useless. Units could be split into general classes (something like tanks, aircraft, light mech, medium mech, special mech, turrets) and you could track the damage dealt by each.

I don't know the game well enough to discern the line between relevant and useless stats. Mostly it's down to how much work you want to put into it.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: stats logging.

Post by knorke »

APM:
imo useless in spring, the ui is too good so it has little meaning.
stuff like "mouse movement in pixel" might be interessting and the endgraph even shows that but I dont even know if it is dependant on screen resolution.

You could log where players click on the screen to see what buttons are used. (or where they click on the map)
But that are not really "game statistics."
the engine's APM implementation (I have no idea if it actually works)
iirc players get more APM if you play replays at higher speed.
So the thoughts are what relevant stats?
depends on which game you mean. One might think that "damage dealt" is universally the most important factor but I find in ie xta (maybe ba too, to less extent) it does not mean that much. I have seen many 1v1 games where the winning player had fewer damage dealt.
For example units shooting a turret that is constantly repaired gives no advantage at all for the attacking player but boosts his damage dealt graph. In games without repair/self healing it will be different blablalabla.

http://springrts.com/wiki/CollectionOfS ... ring_games
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

gadgets have unsynced space as well google. I would probably stay in gadget space as much as possible. I don't like using a lot of widget->gadget messages. I already have plenty of those. I will look into the gadget key press stuff but honestly apm is a low priority, I am doing it because people here wank to how much they spam keys.

My thoughts are that I hate relying on the engine's recorded player stats. This is part of my want for this to be moved into lua. My code won't be the best to be sure but it'll be there for when someone wants to strip this crap out of the engine.

well that is the thing knorke, I just mentioned apm because it is the stat I give the least shits about ;). Yeah, is damage important? I dunno? is damage taken important? I dunno but I will record it all the same. am I gonig to record the amount of hover unit types with damage higher than 100 built? no probably not.

my thoughts on stats are this:
  • income levels over time
    damage dealt
    damage taken
    kills
    deaths
    repair
    score(gundam specific)
    xp(gundam specific and not per unit xp)
    time levels acquired(gundam specific)
    time research acquired(gundam specific)
    what killed your units
    what you killed
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: stats logging.

Post by knorke »

Google_Frog wrote:Gadget:
I'm not sure if unsynced gadgets can track mouse and keyboard input.
At least gadget:KeyPress works.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

Why was this moved to lua? It isn't about HOW..it was about WHAT players/gamedevs may want to see in this sort of code.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: stats logging.

Post by AF »

One would be forgiven for thinking a thread talking about what stats needs to be logged by a lua gadget and what should be shown by a lua widget would belong in a lua forum.

IIRC this was in general discussion right?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

I mention that I am doing it in a gadget because most of the stats stuff around here is done in widget.

I mention the way they will interact for gamedevs who may not like chili and wonder if it'll be usable with their other ui stuff...

the way I approach it is not really up for debate, I was not asking, I was telling.

it was in games and mods.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: stats logging.

Post by Forboding Angel »

I would like a total score based upon metal value of the units you've killed.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: stats logging.

Post by Beherith »

In BA i think a good indicator is (damage dealt / metal used)
APM is trickier, some people have high apm despite being poor players, but most low apm players are poor players.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

I have a scoring gadget, it uses the unit cost at unit killed to assign xp to the killer. You guys can tweak that to whatever game conditions you want.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: stats logging.

Post by CarRepairer »

Forboding Angel wrote:I would like a total score based upon metal value of the units you've killed.
Your ally dealt 99% damage to a large unit and your lucky bullet kills it off. Who gets the credit?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

in my mind, that is a killsteal and Iamokwiththis. I am not writing a perfect solution, I am writing a basic one that someone else can go nuts with.

when you get into shared xp, you get into storing %damaged per player, how long until that player's damage doesn't matter any more, and/or how much repair may negate that.

not what I am here to do. I am JUST here to get something basic done. If you want to fight kill steals that is fine but not a priority for me.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: stats logging.

Post by Forboding Angel »

That's easy, just pull a guild wars and split all xp evenly among allies (if more than one ally damages a target).
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

So you get players sending one unit out to hit the gundam once while the rest do all the work :3 I can see people getting pissed about that.

I may do shared 20% or something like that but I find the killsteal thing to be a lot of fun :)
LEDZ
Posts: 66
Joined: 27 Jun 2011, 13:43

Re: stats logging.

Post by LEDZ »

Hey smoth, I made something similar for BA. It doesn't graph things but does keep track of a few items of interest.
The code may be a bit messy as I haven't done much of this sort of thing, but maybe you can put it to good use :-)
http://pastebin.com/1pCnEQC2
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: stats logging.

Post by Jools »

knorke wrote:APM:
imo useless in spring, the ui is too good so it has little meaning.
I agree with this. Don't bother to implement this parameter, it has no value at all, since it's a qualitative and not a quantitative parameter. Two bad commands are not better than one good, basically.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

fine by me
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: stats logging.

Post by Jools »

CarRepairer wrote:
Forboding Angel wrote:I would like a total score based upon metal value of the units you've killed.
Your ally dealt 99% damage to a large unit and your lucky bullet kills it off. Who gets the credit?
The one who kills it, the winner takes it all.

This is how it works IRL at least, if you shoot me in the elbow you are not awarded a 15% kill, or something like that. Basically, the whole thing about hit points is flawed, and we should, to be realistic, instead use a statistically based approach, i.e. that each shot can kill -- with a certain probability that correlates with hit points. Because if you hit one shot in the fuel tank or something similar you kill the unit, no matter if it's the first shot or the 111th. Similarly, 50 shots that hit an unit in the armour doesnt really kill it, or take it closer to a kill.

Without remaking the whole thing with the HP, it's still better to award the kill the the unit that actually does the kill, than to split it amongst several potential ones. Because the shots that don't kill are basically misses.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: stats logging.

Post by smoth »

I think it really depends on the situation. I like assist points it is just hard to tell who and what was useful.

One thing I thought about was a degrading ticker.

Say you hit a unit and dealt 25% damage to it... Each second your damage dealt goes down by 5%

3 seconds later it dies..

Your ticker is at 10% you receive 10% of it's xp value as a bonus..

If you are the killer it is 110% of whatever xp he was worth.... Sound fair?
Post Reply

Return to “Lua Scripts”