s2protocol
s2protocol copied to clipboard
[Question] Calculate the APM correctly
Hey there,
I'm now trying around with this topic since a few days and I'm not able to calculate the same APM you have in the game ("Current APM" and "Average APM"). I thought for the average at the game end it should be easy (just add all events together which calculate in the APM and divide by the duration), but also this is not possible for me to reconstruct, so I would be happy for some help here.
I think there are two questions:
- Which events count into the APM? I think only gameevents and my researches ended up in these:
apmEvents = ['NNet.Game.SSelectionDeltaEvent', 'NNet.Game.SCmdEvent', 'NNet.Game.SControlGroupUpdateEvent']Is that correct? - What's the formula? For example if I start a match and directly select a unit, SC2 says my APM is 12 or something :) So I'm wondering what the formula is.
Thanks for your help and greetings from Cologne!
SC2Gears has some APM documentation that may point you in the right direction.
Thx @GraylinKim! I know that page and build my calculations based on it. But still I have the wrong APMs. I have two testmatches, both Grandmaster league. One of it is around 55 minutes long and I should have these Average APM at the game end: Player 1: 250 Player 2: 179 But I have: Player 1: 228 Player 2: 148 There's still something missing. This number is already with the first 90 seconds dropped, as the sc2gears doc mentioned. Calculating together everything except camera moves... Afaik is sc2gears not open source, too see how they're calculating it!?
You might try the new APM field in the --metdata dump. I added this to the dev branch.
If that doesn't work I could look into what else might be available.