Skip to main content

Observation Space

Each tick, the agent receives a GameObservation containing structured game state.

Top-Level Fields

FieldTypeDescription
tickintCurrent game tick
episode_idstringUnique episode identifier
doneboolWhether the game has ended
rewardfloatReward signal
resultstring"win", "lose", "draw", or ""
available_productionstring[]Items the player can currently produce

Economy

FieldTypeDescription
cashintCurrent cash balance
oreintOre in silos
power_providedintTotal power generation
power_drainedintTotal power consumption
resource_capacityintMax ore storage
harvester_countintNumber of active harvesters

Military

FieldTypeDescription
units_killedintEnemy units destroyed
units_lostintOwn units lost
buildings_killedintEnemy buildings destroyed
buildings_lostintOwn buildings lost
army_valueintTotal value of active army
active_unit_countintNumber of active units
kills_costintCost value of enemies killed
deaths_costintCost value of own losses
assets_valueintTotal asset value (units + buildings)
experienceintPlayer experience points
order_countintTotal orders issued

Units (units and visible_enemies)

Each unit provides:

FieldTypeDescription
actor_iduint32Unique actor identifier
typestringUnit type (e.g., "e1", "1tnk", "harv")
pos_x, pos_yintWorld position (WPos)
cell_x, cell_yintGrid cell position (CPos)
hp_percentfloatHealth 0.0–1.0
is_idleboolCurrently idle
current_activitystringCurrent activity name
ownerstringPlayer internal name
can_attackboolHas attack capability
facingintDirection (WAngle 0–1023)
experience_levelintVeterancy level
stanceint0=HoldFire, 1=ReturnFire, 2=Defend, 3=AttackAnything
speedintMovement speed
attack_rangeintMax attack range (WDist)
passenger_countintCargo count (-1 if N/A)
ammointAmmo count (-1 if N/A)
is_buildingboolAlways false for units

Buildings (buildings and visible_enemy_buildings)

FieldTypeDescription
actor_iduint32Unique actor identifier
typestringBuilding type (e.g., "powr", "barr", "weap")
pos_x, pos_yintWorld position
cell_x, cell_yintGrid cell position
hp_percentfloatHealth 0.0–1.0
ownerstringPlayer internal name
is_producingboolCurrently producing
production_progressfloatProduction progress 0.0–1.0
producing_itemstringItem being produced
is_poweredboolHas power
is_repairingboolBeing repaired
sell_valueintRefund if sold
rally_x, rally_yintRally point cell (-1 if none)
power_amountintPower provided (positive) or consumed (negative)
can_producestring[]Items this building can produce

Production Queues

FieldTypeDescription
queue_typestring"Building", "Infantry", "Vehicle", "Aircraft"
itemstringActor type being produced
progressfloat0.0–1.0
remaining_ticksintTicks until complete
remaining_costintRemaining cost
pausedboolProduction paused

Spatial Map

A 9-channel spatial tensor encoded as binary float32 data in the spatial_map field.

ChannelIndexDescription
Terrain0Terrain type
Height1Elevation
Resources2Ore/gem density
Passability3Movement passability
Fog of War4Visibility
Own Buildings5Player building locations
Own Units6Player unit locations
Enemy Buildings7Visible enemy building locations
Enemy Units8Visible enemy unit locations

Shape: map_height x map_width x 9 (row-major, channels-last)

Decoding in Python:

import numpy as np
import base64

spatial_bytes = base64.b64decode(obs.spatial_map)
spatial = np.frombuffer(spatial_bytes, dtype=np.float32)
spatial = spatial.reshape(obs.map_info.height, obs.map_info.width, obs.spatial_channels)