zsol / cupapp

A starcraft2 replay sharing site
www.cupapp.com
8 stars 0 forks source link

Average APM is weird #20

Closed zsol closed 13 years ago

zsol commented 13 years ago

See example here: http://test.cupapp.com/en/replay/view/19/2v2-Monlyth_Ridge-mouzMaNa-funkay-Aristeo-cubert

I don't know why the average APM is 30, while all players' APM is well above that. Any ideas?

eshton commented 13 years ago

Check the Replay.php: https://github.com/zsol/cupapp/blob/master/lib/model/Replay.php at line 217. You can see how it is calculated. There is only one thing that can go wrong: the number of players (might be because of observers or whatever). Check the replay in the database (the number of players) and upload it again and check what data is available and what will the parseData() do with it.

Edit: Hm. All average APM is 388. There could be any number of players it won't be 30 in the end :D So, you have to debug it. It might be easier with a log to the database containing all those informations the replay parser plugin returns so later you can check whether the transformation logic is still good or not. I'll think about it later.

zsol commented 13 years ago

So the formula for game avg apm is: game_avg_apm = sum(players_avg_apm) / num_players The problem was that _numplayers was counting all observers as well. I've fixed that now :)

eshton commented 13 years ago

Nice! I should practice code review more often :)

eshton commented 13 years ago

Nice! I should practice code review more often :)

zsol commented 13 years ago

Hehe that's a noble goal :D