Possible race condition or multithreading issue when quickly switching units after issuing a move command

:play_button: GAME INFORMATION

:backhand_index_pointing_down: These details are CRITICAL; DO NOT skip them or your issue may not be reviewed.

I do not have the game and am reporting a bug shown in a YouTube video from DauT.

Edit: this is probably related to “Issuing a unit move command then selecting a building can result in setting the building’s gather point to the unit’s move location” in List of unfixed bugs.

  • GAME BUILD #: latest
  • GAME PLATFORM: PC
  • OPERATING SYSTEM: Windows

:play_button: ISSUE EXPERIENCED

At https://youtu.be/XZsnEBZL-hQ?t=167 DauT lures some boars. At 2:50 he switches to TC. Going frame by frame, with the “,” and “.” keys, at 170.39 (according to “Stats for nerds”), he uses hotkey for the hunter and right-clicks near the TC. The red arrows at the clicked location start to show up at 170.54 at 60 fps. At 170.58, he uses hotkey for eagle scout. (Maybe the key was pressed slightly earlier and it took some time for the selection to change: these times are based on the video evidence.)

The move command did not register with the villager. Have seen this in the past with other players like TheViper, but not recently. I think there was a similar bug for buildings that was fixed in DE; like, pressing cancel on an in-progress building and then rapidly switching to TC could delete the TC.

In this video, DauT switches camera to Eagle’s location by pressing hotkey again at 170.73 (at 30 fps, because my PC can overheat with 60 fps videos). He issues a move command at 170.86 (red arrows appear), but eagle starts to move at 170.83, indicating it received the command meant for the villager.

At 2:55, DauT switches back to the hunter who moves for two frames before stopping from the move command at 2:49 (before switching to TC at 2:50).

:play_button: FREQUENCY OF ISSUE

I’m sorry, I have no idea. Even if I had DE, or could get my HD version to work, I can only record at maybe 5~10 fps while the game is running. This is an issue which probably only happens if the selection is changed within 0.05 sec of a move command.

:play_button: REPRODUCTION STEPS

Here’s the steps to reproduce the issue:

  1. start recording screen capture at 60 fps
  2. have two units, each in separate control groups
  3. click to move, and then very rapidly switch to the other unit using control groups
  4. check screen capture with a video player that can advance by 1 frame per keypress for any cases where the command went to the wrong unit
  5. if the above does not replicate the bug in single-player, try it in multiplayer with a laggy server
  6. (During screen capture, right-click to move while continuously moving mouse to determine the delay between the click and when the red arrows start to show up)

:play_button: EXPECTED RESULT

The command affects the unit that was selected at the time of the command.

:play_button: IMAGE

See above.

:play_button: GAME FILES (SAVE / RECORDING)

This bug would probably not show up in a game recording, which does not record changes in unit selection, only issued commands.

As a counter-example of when this bug did not happen:

DauT has an archer army and a cavalry army. He wants to send them both to the same place. He moves the archer army; but selecting the cavalry happens on the same frame at 60 fps as red arrows appear for a movement command, at time 3522.66.

So: maybe the movement command was sent like 0.005 before the group hotkey. The reported bug is commands going to units selected AFTER the command; these units were selected less than 1 frame after the movement command, and maybe even before the command, but did not trigger the bug.