game_state.py#

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

List of erroneous actions since last frame. See Blizzard/s2client-proto

property actions: list[ActionRawUnitCommand | ActionRawToggleAutocast | ActionRawCameraMove]#

List of successful actions since last frame. See Blizzard/s2client-proto

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 Blizzard/s2client-proto

property actions_unit_commands: list[ActionRawUnitCommand]#

List of successful unit actions since last frame. See Blizzard/s2client-proto

property alerts: list[int]#

Game alerts, see Blizzard/s2client-proto

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) None[source]#
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) None[source]#
class sc2.game_state.EffectData(proto, fake: bool = False) None[source]#
Parameters:

fake (bool)

property is_enemy: bool#

Checks if the effect is hostile.

property is_mine: bool#

Checks if the effect is caused by me.