Sliding window, replay tape, and normalization #83

Closed
opened 2026-08-25 19:11:37 +02:00 by SirStone · 0 comments
Owner

Parent

#80

What to build

Data collection layer that runs inside the bot's tick loop. Each tick: record enemy state, normalize it, maintain two buffers.

Sliding window: last 30 ticks of enemy state (lateral_vel, heading_delta, wall_distance) as a flat 90-element buffer + current distance as 91st input. This is the ANN's input vector.

Replay tape: rolling ~2000-tick buffer of full enemy states for offline GA fitness evaluation.

Normalization: per-feature fixed scaling using game constants — lateral_vel / 8.0, heading_delta / π, wall_distance / 1000.0. No runtime statistics.

Acceptance criteria

  • Sliding window fills with normalized enemy state each tick
  • Window produces a flat 91-element float array ready for ANN input
  • Replay tape records raw enemy states up to ~2000 ticks, oldest dropped when full
  • Normalization uses game constants only — no running stats, no allocations per tick
  • Self-check: when isMainModule with doAssert validates normalization ranges and buffer behavior
  • Integrated into bot skeleton's tick loop — data collection runs every tick

Blocked by

## Parent https://git.fossellini.top/SirStone/SirRoboGarage/issues/80 ## What to build Data collection layer that runs inside the bot's tick loop. Each tick: record enemy state, normalize it, maintain two buffers. Sliding window: last 30 ticks of enemy state (lateral_vel, heading_delta, wall_distance) as a flat 90-element buffer + current distance as 91st input. This is the ANN's input vector. Replay tape: rolling ~2000-tick buffer of full enemy states for offline GA fitness evaluation. Normalization: per-feature fixed scaling using game constants — lateral_vel / 8.0, heading_delta / π, wall_distance / 1000.0. No runtime statistics. ## Acceptance criteria - [ ] Sliding window fills with normalized enemy state each tick - [ ] Window produces a flat 91-element float array ready for ANN input - [ ] Replay tape records raw enemy states up to ~2000 ticks, oldest dropped when full - [ ] Normalization uses game constants only — no running stats, no allocations per tick - [ ] Self-check: `when isMainModule` with `doAssert` validates normalization ranges and buffer behavior - [ ] Integrated into bot skeleton's tick loop — data collection runs every tick ## Blocked by - https://git.fossellini.top/SirStone/SirRoboGarage/issues/81
SirStone added the ready-for-agent label 2026-08-25 19:11:37 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#83