icza / scelight

The source code of the Scelight project with all its modules.
https://sites.google.com/site/scelight/
Apache License 2.0
124 stars 19 forks source link

Missing Cmd events #26

Closed laedvin closed 3 years ago

laedvin commented 3 years ago

Hi!

I recently looked at a replay (Reynor vs Maru in IEM Katowice 2021 game 5) and noticed that not all commands (e.g. Morph to Drone) are shown. For example, according to the Event history Reynor only used "Morph to Drone" 64 times in that game, while he in fact had 139 unique Drones in total according to sc2reader. This discrepancy also makes the APM calculation incorrect, as his APM is over 700 in-game but only 581 in Scelight. What gives?

icza commented 3 years ago

I don't know how sc2reader calculates it so I don't know which one is correct (64 or 139). One may be the actual drones count, the other may be the commands issued (but not all executed). It's hard to reason about anything wtihout seeing the replay.

Also Scelight excludes the beginning of the game from the APM calculation and uses real-time. APM displayed in game uses game-time and includes the whole game.

laedvin commented 3 years ago

Yeah, reasoning without the replay is hard, so I'll link to an image (and the replay if you have the time to check it). Scelight itself shows that Reynor has a peak Drone count of over 100, so I'm quite sure there are missing commands somehow. I've highlighted the peak worker count and the number of Morph to Drone commands here. The replay itself is here.

I didn't know about how Scelight calculates APM though, so that is interesting.

Edit: Also, could it be due to having a high key repeat rate making the parser miss out on some actions?

icza commented 3 years ago

OK, I checked the replay. There's nothing wrong with it or with Scelight.

The "Morph to Drone" command is applied to all selected Larvas. So if you have 3 Larvas selected and you issue a "Morph to Drone" command (and you have enough minerals), that will result in 3 Drones :)

The "Workers active" chart shows you the proper worker count. Go to the "Build Orders" tab, and filter to "Drone". There you'll see 127 rows, telling there were 127 Drones morphed. The "Build Orders" tab only shows units and buildings that did complete (e.g. killing the egg of a morphing Drone will not show up here).

laedvin commented 3 years ago

I see, great! Thanks for taking your time to look into it. Just for clarification: if I have 3 larvae and hold down the Morph to Drone hotkey, I will consecutively issue 3 morph commands (which is what I think happens in-game since how quickly they all start building depends on the key repeat rate) but Scelight only registers 1 command?

icza commented 3 years ago

Wait, now I'm not sure. In StarCraft Broodwar the command is applied to all selected Larvas. But in SC2 the command is only applied on 1 Larva. Is there an setting that changes this? To apply the command on all Larvas?

laedvin commented 3 years ago

No, I'm pretty sure there isn't. The only larva-related setting is the "click on 1 larva to select all larvae" setting.

icza commented 3 years ago

But it looks this is what happens here.

For example at 0:31 he selects 2 larvas, issues a "Morph to Drone", then 2 eggs getting added to selection. On the Build Orders tab there are 2 Drones recorded.

Another example: at 3:14 he selects 5 larvas, issues a "Morph to Drone", then 3 eggs getting added to selection. On the Build Orders tab there are 3 Drones recorded.

laedvin commented 3 years ago

I did some testing in a replay here. I played a game where I made 8 drones in four different ways. I had 4 control groups with 8 larvae each, and respectively morphed them to drones by:

  1. @06:15 by repeatedly pressing the Morph to Drone key (i.e. I pressed the key, released it, and then pressed again).
  2. @06:40 by holding down Morph to Drone with a repeat speed of 500 ms (the slowest possible by default on Windows 10).
  3. @07:05 by holding down Morph to Drone with a repeat speed of 66 ms.
  4. @07:31 by holding down Morph to Drone with a repeat speed of 33 ms (the fastest possible by default on Windows 10).

In the first three of those cases, Scelight recorded 1 Morph to Drone command, 8 "1x egg added to selection" and 8 "1x egg added to control group".

In the last case, Scelight recorded 1 Morph to Drone command, 5 "1x egg added to selection" and 5 "1x egg added to control group" and 1 "3x eggs added to selection" and 1 "3x eggs added to control group".

So it seems for some reason the last test recorded fewer actions (since I think you only consider Cmd, SelectionDelta and ControlGroupUpdate as actions when calculating APM).

icza commented 3 years ago

Scelight does not filter the actions from the replay. If you got different results, it's because the SC2 engine recorded different actions.

laedvin commented 3 years ago

I see. I guess there isn't that much you can do about it then. Thanks for taking your time with this!