ggtracker / ggtrackerstack

Project to run the whole ggtracker stack in vagrant
20 stars 10 forks source link

Make skillcraft Action Latency calculation more accurate #23

Open dsjoerg opened 8 years ago

dsjoerg commented 8 years ago

From @dsjoerg on August 20, 2014 18:51

In skillcraft.py we are counting as "Actions" some things that should not be counted as actions.

https://github.com/dsjoerg/ggpyjobs/blob/master/sc2parse/skillcraft.py#L175

The algorithm should ignore the following actions:

               Seld
               Leaving the game
    'Use ability   5f01'
    'Use ability   6e00'
    'Use ability   7b42'
    'Use ability  12940'
    'Use ability  14442'
    'Use ability  15d09'
    'Use ability  17200'
    'Use ability  17801'
    'Use ability  17901'
    'Use ability  1fa0e'

These are the action descriptions used by SC2Gears. So the question is, what are these actions exactly? Next step is to fire up SC2Gears, look for these events in some replays, and figure out what they are.

Copied from original issue: dsjoerg/ggpyjobs#4

dsjoerg commented 8 years ago

Based on 3 replays that have been parsed in both systems, our algorithm comes up with action latencies ~2.5% faster than the official Skillcraft.ca algorithm. Hopefully correcting this issue will bring us closer to parity.

dsjoerg commented 8 years ago

From @Mischanix on August 20, 2014 22:4

SC2Gears ability ids are the combined 21 bits of m_abilLink and m_abilCmdIndex directly in the NNet.Game.SCmdEvent packet (s2protocol definition here). So, some bit twiddling can convert between sc2gears ids and sc2reader ids: sc2reader ids have the 5 bits from m_abilCmdIndex in the low bits of the least significant byte, while sc2gears ids have those 5 bits in the high bits of the least significant byte:

l = abilLink, c = abilCmdIndex
sc2gears:  000l llll llll llll cccc clll
sc2reader: 000l llll llll llll lllc cccc

Now, if you convert the ids, none of them match up well to known abilities, so I'm guessing some of this is noise from sc2gears' parser being incorrect. I think the complete Abilities Coding list with the N/C markers at the end of the paper is the one more relevant to faithfully reproducing the action latencies.

dsjoerg commented 8 years ago

@Mischanix thanks!