You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
def create_control_group_event(frame, pid, data):
update_type = data["control_group_update"]
if update_type == 0:
return SetControlGroupEvent(frame, pid, data)
elif update_type == 1:
return AddToControlGroupEvent(frame, pid, data)
elif update_type == 2:
return GetControlGroupEvent(frame, pid, data)
elif update_type == 3:
# TODO: What could this be?!?
return ControlGroupEvent(frame, pid, data)
else:
# No idea what this is but we're seeing update_types of 4 and 5 in 3.0
return ControlGroupEvent(frame, pid, data)
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.
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.
"created" 1 scv to control group 1
"add" the command center to group 1
"create-steal" command center to group 8
"add-steal" all scvs to group 8
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:
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.
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: