GA_Gun only: virtual bullets, tick-speed training, hit% fitness #108

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

Destination

EvoBot with a single GA_Gun: fixed-topology ANN (91→16→8→2) evolved by mutation-only GA. Trains at tick speed using virtual bullets against real enemy movement. Fitness = hit% per generation. Champion hot-swapped immediately. No replay tape, no multi-gun selector, no CMA-ES.

Notes

Domain: Robocode Tank Royale, Nim language. SirRoboGarage repo.
Skills: grilling, domain-modeling, nim.
Predecessor maps: #61, #74, #88 (closed), #99 (superseded).
Mode: plan-only — tickets are implementation handoff.

Decisions locked in grilling

  1. One gun: GA_Gun — GF_Gun, CMA_Gun, selector stripped. External modules kept, not deleted.
  2. Network: 91→16→8→2 — two outputs: guess factor (-1 to +1) and fire power (tanh rescaled to 0.1–3.0). ~1634 weights.
  3. Population: 64 candidates.
  4. Virtual bullets every tick — all 64 candidates fire a virtual bullet every tick. Full simulation: track bullet position each tick, check intersection with actual enemy bounding box at arrival.
  5. Fitness = hit% — hits / total virtual bullets per candidate per generation. Flat — power doesn't weight it.
  6. Generation = 30 bullets per candidate. Wait for all in-flight bullets to resolve before scoring. Hit% resets per generation.
  7. GA runs continuously at tick speed — same thread, in the tick loop. Selection + mutation after each generation. Keep existing ga.nim operators.
  8. Hot-swap immediately — when a new champion emerges mid-match, swap live gun weights instantly.
  9. Training never stops — virtual bullets are free. Training continues even when real gun can't fire (low energy, gun heat). As long as bot is alive and enemy visible.
  10. Real gun fires champion's output — GF × MEA for aim, power from second output. Skips when gun heat > 0 or energy < power.
  11. Global-only weights — one weight file. Save to disk every time a new champion emerges.
  12. Cold start: fire immediately with random-init weights. Hot-swap to first champion when it appears.
  13. Sliding window input: 30 ticks × 3 features + distance = 91 inputs. Unchanged.
  14. Battle-wide diagnostic — log real gun hit% at end of match: "Battle hit%: X% (hits/total)".
  15. Existing modules preserved — GF_Gun, CMA, etc. kept in repo but not wired into this bot.

Decisions so far

All decisions resolved in charting grilling session — see list above.

Not yet specified

  • Generation size tuning (N=30 is starting point, may need adjustment after observation)
  • Training speed optimization if generation turnover is too slow
  • Network architecture tuning (hidden layer sizes) if 16-8 underperforms
  • Richer diagnostic stats (per-round breakdown, generation-over-generation trends)

Out of scope

  • Per-enemy weight specialization
  • GF_Gun / CMA_Gun / multi-gun selector (modules kept, not wired)
  • NEAT_Gun (topology evolution)
  • Replay tape / historic data training
  • Wave surfing / movement system
  • Melee / multi-enemy
  • Energy management by the gun (learns naturally)
  • Fitness weighted by power
## Destination EvoBot with a single GA_Gun: fixed-topology ANN (91→16→8→2) evolved by mutation-only GA. Trains at tick speed using virtual bullets against real enemy movement. Fitness = hit% per generation. Champion hot-swapped immediately. No replay tape, no multi-gun selector, no CMA-ES. ## Notes Domain: Robocode Tank Royale, Nim language. SirRoboGarage repo. Skills: grilling, domain-modeling, nim. Predecessor maps: #61, #74, #88 (closed), #99 (superseded). Mode: plan-only — tickets are implementation handoff. ### Decisions locked in grilling 1. **One gun: GA_Gun** — GF_Gun, CMA_Gun, selector stripped. External modules kept, not deleted. 2. **Network: 91→16→8→2** — two outputs: guess factor (-1 to +1) and fire power (tanh rescaled to 0.1–3.0). ~1634 weights. 3. **Population: 64** candidates. 4. **Virtual bullets every tick** — all 64 candidates fire a virtual bullet every tick. Full simulation: track bullet position each tick, check intersection with actual enemy bounding box at arrival. 5. **Fitness = hit%** — hits / total virtual bullets per candidate per generation. Flat — power doesn't weight it. 6. **Generation = 30 bullets** per candidate. Wait for all in-flight bullets to resolve before scoring. Hit% resets per generation. 7. **GA runs continuously at tick speed** — same thread, in the tick loop. Selection + mutation after each generation. Keep existing ga.nim operators. 8. **Hot-swap immediately** — when a new champion emerges mid-match, swap live gun weights instantly. 9. **Training never stops** — virtual bullets are free. Training continues even when real gun can't fire (low energy, gun heat). As long as bot is alive and enemy visible. 10. **Real gun fires champion's output** — GF × MEA for aim, power from second output. Skips when gun heat > 0 or energy < power. 11. **Global-only weights** — one weight file. Save to disk every time a new champion emerges. 12. **Cold start: fire immediately** with random-init weights. Hot-swap to first champion when it appears. 13. **Sliding window input: 30 ticks** × 3 features + distance = 91 inputs. Unchanged. 14. **Battle-wide diagnostic** — log real gun hit% at end of match: `"Battle hit%: X% (hits/total)"`. 15. **Existing modules preserved** — GF_Gun, CMA, etc. kept in repo but not wired into this bot. ## Decisions so far All decisions resolved in charting grilling session — see list above. ## Not yet specified - Generation size tuning (N=30 is starting point, may need adjustment after observation) - Training speed optimization if generation turnover is too slow - Network architecture tuning (hidden layer sizes) if 16-8 underperforms - Richer diagnostic stats (per-round breakdown, generation-over-generation trends) ## Out of scope - Per-enemy weight specialization - GF_Gun / CMA_Gun / multi-gun selector (modules kept, not wired) - NEAT_Gun (topology evolution) - Replay tape / historic data training - Wave surfing / movement system - Melee / multi-enemy - Energy management by the gun (learns naturally) - Fitness weighted by power
SirStone added the wayfinder:map label 2026-08-28 23:55:31 +02:00
Author
Owner

All tasks #109-#114 implemented. GA_Gun runs tick-speed virtual bullets with hit% fitness. CMA_Gun, GF_Gun, and virtual guns selector removed from bot (libs kept on disk). Spec: #115.

All tasks #109-#114 implemented. GA_Gun runs tick-speed virtual bullets with hit% fitness. CMA_Gun, GF_Gun, and virtual guns selector removed from bot (libs kept on disk). Spec: #115.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#108