State vector module #42

Closed
opened 2026-08-20 23:28:02 +02:00 by SirStone · 1 comment
Owner

Parent

#37

What to build

State vector construction from game events. Produces a ~35-dimensional normalized tensor.

Dimensions include:

  • Own bot: position, direction, speed, energy, gun direction, gun heat
  • Enemy current: position, direction, speed, energy, fired flag, last fire power
  • Derived: enemy acceleration, enemy turn rate, relative bearing, distance
  • Wall distances: 4 cardinal directions
  • Bullet tracking: up to 3 in-flight bullets × 4 features (relative position, speed, time to impact)
  • Scan staleness: ticks since last scan, clamped

No explicit enemy history window — the LSTM learns temporal patterns from sequential observations.

All values normalized to approximately [-1, 1].

Acceptance criteria

  • buildState() produces a tensor of the correct dimension count
  • All values fall within expected normalization ranges
  • Missing scan data (no enemy scanned yet) produces a valid tensor (zeros or defaults)
  • Bullet tracking handles 0, 1, 2, 3 bullets correctly
  • Scan staleness increments per tick, clamps at maximum
  • test_state.nim passes

Blocked by

  • #38 (SAC_LSTM_Bot: project scaffold)
## Parent #37 ## What to build State vector construction from game events. Produces a ~35-dimensional normalized tensor. Dimensions include: - Own bot: position, direction, speed, energy, gun direction, gun heat - Enemy current: position, direction, speed, energy, fired flag, last fire power - Derived: enemy acceleration, enemy turn rate, relative bearing, distance - Wall distances: 4 cardinal directions - Bullet tracking: up to 3 in-flight bullets × 4 features (relative position, speed, time to impact) - Scan staleness: ticks since last scan, clamped No explicit enemy history window — the LSTM learns temporal patterns from sequential observations. All values normalized to approximately [-1, 1]. ## Acceptance criteria - [ ] `buildState()` produces a tensor of the correct dimension count - [ ] All values fall within expected normalization ranges - [ ] Missing scan data (no enemy scanned yet) produces a valid tensor (zeros or defaults) - [ ] Bullet tracking handles 0, 1, 2, 3 bullets correctly - [ ] Scan staleness increments per tick, clamps at maximum - [ ] `test_state.nim` passes ## Blocked by - #38 (SAC_LSTM_Bot: project scaffold)
SirStone added the ready-for-agent label 2026-08-20 23:28:02 +02:00
Author
Owner

State vector module complete — 35-dim normalized tensor, bullet tracking, scan staleness. 5/5 tests pass.

State vector module complete — 35-dim normalized tensor, bullet tracking, scan staleness. 5/5 tests pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#42