game_state.py

class sc2.game_state.GameState(response_observation, previous_observation=None)
property action_errors: List[ActionError]

List of erroneous actions since last frame. See https://github.com/Blizzard/s2client-proto/blob/01ab351e21c786648e4c6693d4aad023a176d45c/s2clientprotocol/sc2api.proto#L648-L652

property actions: List[ActionRawUnitCommand | ActionRawToggleAutocast | ActionRawCameraMove]

List of successful actions since last frame. See https://github.com/Blizzard/s2client-proto/blob/01ab351e21c786648e4c6693d4aad023a176d45c/s2clientprotocol/sc2api.proto#L630-L637

Each action is converted into Python dataclasses: ActionRawUnitCommand, ActionRawToggleAutocast, ActionRawCameraMove

property actions_toggle_autocast: List[ActionRawToggleAutocast]

List of successful autocast toggle actions since last frame. See https://github.com/Blizzard/s2client-proto/blob/01ab351e21c786648e4c6693d4aad023a176d45c/s2clientprotocol/raw.proto#L199-L202

property actions_unit_commands: List[ActionRawUnitCommand]

List of successful unit actions since last frame. See https://github.com/Blizzard/s2client-proto/blob/01ab351e21c786648e4c6693d4aad023a176d45c/s2clientprotocol/raw.proto#L185-L193

property alerts: List[int]

Game alerts, see https://github.com/Blizzard/s2client-proto/blob/01ab351e21c786648e4c6693d4aad023a176d45c/s2clientprotocol/sc2api.proto#L683-L706

property chat: List[ChatMessage]

List of chat messages sent this frame (by either player).

property dead_units: Set[int]

A set of unit tags that died this frame

effects: Set[EffectData]

Usage: for effect in self.state.effects:

if effect.id == EffectId.RAVAGERCORROSIVEBILECP:

positions = effect.positions # dodge the ravager biles

class sc2.game_state.Blip(proto)
property is_blip: bool

Detected by sensor tower.

property position: Point2

2d position of the blip.

property position3d: Point3

3d position of the blip.

class sc2.game_state.Common(proto)
class sc2.game_state.EffectData(proto, fake=False)
property is_enemy: bool

Checks if the effect is hostile.

property is_mine: bool

Checks if the effect is caused by me.