-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SelectionTracker does not take "control group stealing" into account #183
Comments
THis is addressed in #187 |
I think the only change required to get the SelectionTracker working is to properly handle the new control group event DeleteControlGroupEvent. When this event is registered on a control group it means that everything in the control group is removed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Explanation of what "control group stealing" is
Many years ago (I believe with the LOTV release) they added the functionality to "steal" units between control groups. It works exactly like the usual Add / Create except that all of the selected units are also simultaneously removed from all other control groups.In the hotkey menu in StarCraft this is called "{Create/Add to} Control Group X and Take Away Units" and the buttons for it is found under Menu - Options - Hotkeys - Global - Control Groups.
In the file https://github.com/ggtracker/sc2reader/blob/upstream/sc2reader/events/game.py there are some comments of confusion related to this issue related to "update_type".
From my basic testing, update_type == 4 is related to create-steal and update_type == 5 is related to add-steal. When units are removed from other control groups in this way, they also trigger another event of update_type == 3.
The SelectionTracker https://github.com/ggtracker/sc2reader/blob/upstream/sc2reader/engine/plugins/selection.py does not currently handle these update_types 3, 4 and 5 since they are simply "ControlGroupEvent".
That said, it is a bit more complicated because in sc2reader, a single "steal" command in-game generates a series of 4-5 events, including some SelectionEvent.
To reproduce the issue + details
I simply started a game and performed all of the types of commands.
At the end the player.selection incorrectly contains 1 scv in group 1 and the rest are empty. The correct result is that group 1 is empty and group 8 and the current selection contains the command center and all scvs. The replay can be found at https://drop.sc/replay/23379541
Notice how the single create-steal command creates 5 events by sc2reader:
What are your thoughts on this?
The text was updated successfully, but these errors were encountered: