- Remove omitempty tag from Events field in ReplayTurn
- Create a proper slice copy of gs.Events in RecordTurn
- Prevents null events array in JSON output
- Fixes parsing errors in analysis scripts
Closes: bf-6amz0, bf-3l7tf
Strategy bots (GathererBot, RusherBot, SwarmBot) now move toward zone
center when within 2 tiles of the zone edge, not just when outside.
This anticipates the shrinking zone and prevents bots from moving
away from center due to energy-seeking logic.
Test results: 60% of matches now have combat deaths (3/5), up from 0%.
Zone margin of 2 tiles aligns with engine's built-in bot behavior.
Fixes gap identified in test replay where gatherer bot at distance 5
from center (zone radius 6) moved away from center and died from
zone_death instead of engaging in combat.
Closes: bf-2ham
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add ZoneBounds type to bot state structs (Go, Rust, TypeScript)
- GathererBot now moves toward zone center when outside or near edge
- Bots can see zone bounds in fog-filtered state (per plan §3.7.1)
- Fixes gofmt formatting in types.go and bot_strategies.go
This improves bot survival and combat behavior by making them
zone-aware, preventing unnecessary zone deaths when the safe area
shrinks.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously both bots avoided enemy positions during pathfinding,
preventing active engagement. Now both bots get bonuses for moving
toward enemies, encouraging them to enter attack range intentionally.
SwarmBot (bots/swarm/src/strategy.ts):
- Added bonus for getting closer to enemies (score += (currentDist - newDist) * 5)
- Existing bonus for being in attack range (score += 50) now more achievable
RusherBot (bots/rusher/src/strategy.rs):
- Added fallback to move toward nearest enemy when no path to target exists
- Prioritizes engagement over random movement when blocked
Impact: Combat now happens consistently across all matches. Test matches show
4 combat deaths in 2-12 turn matches (vs 0-2 deaths in 3-4 turns before).
Closes: bf-1qq8
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All 10 non-gatherer bots included timestamp in the request verification
signing string but the engine (auth.go SignRequest) does not include
timestamp. Every incoming turn request failed 401 verification, bots
crashed after 10 turns, and all matches ended in stalemate.
The engine documentation in auth.go is also misleading (old comment
mentioned timestamp in signing string) but the actual implementation
never included it. Fixed all language implementations to match.
Affected: random (py), swarm (ts), hunter (java), guardian (php),
rusher (rs), assassin (rs), phalanx (rs), opportunist (go),
farmer (go), scout (py), raider (java)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rust:1.85-alpine does not include musl-dev, causing the gcc linker to
fail with "cannot find crti.o". Required for serde_derive and other
proc-macro crates to compile.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch from full LTO (lto=true) to thin LTO to avoid memory/ICE issues
- Include Cargo.lock in Dockerfile for reproducible dependency resolution
- Use opt-level='s' (balanced size/speed) instead of 'z' (max size opt)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The nearestEnergy variable was referenced inside findNearestEnergy() but
only declared in the caller's scope. Declare it locally and use _ in caller.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The NEEDLE worker committed Rust's target/ directory which contained local
pre-compiled debug artifacts. This caused cargo to fail during CI builds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ReplayPlayer to type imports in replay-viewer.ts
- Add explicit type annotation for entry parameter in replay.ts transcript map
- Fixes TypeScript compilation errors for §15.3 screen reader transcript feature
- SeasonID and RulesVersion already present in engine/types.go Config struct
- Worker already populates from active season row via DB join
- Config embedded in VisibleState sent to bots each turn (including turn 0)
- All starter kits (go, python, rust, java, csharp) already expose and log fields
- Add season_id/rules_version logging to JavaScript starter on turn 0
- TypeScript Config interface already includes season_id and rules_version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Max-aggression strategy with unconditional attack: every unit charges the
nearest enemy, never retreats, and presses engagements within attack range.
Fixed self-collision bug by reserving all starting positions and freeing
them as bots move away. Falls back to enemy core rushing when no enemies
are visible, with exploratory spreading when no targets exist.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two bugs in the Opportunist bot strategy:
1. retreatMove: when a lone bot is surrounded by enemies with no nearby
allies, all passable directions scored below the -1 initial threshold
due to flat enemy penalties. Fixed by scoring distance-from-enemies
as a positive value (further = better) instead of a flat penalty,
ensuring the bot always picks the safest direction.
2. attackMove: BFS could never reach enemy targets because the passable
function excluded all enemy positions. The target IS an enemy, so the
path was unreachable. Fixed by wrapping passable to treat the target
position as passable during attack pathfinding.
All 19 tests now pass, including TestComputeMovesRetreat and
TestComputeMovesNearbyAdvantageAttack.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All units rush the nearest enemy core via BFS, ignoring enemy units
and economy. No perimeter defense — full commitment to core destruction.
Targets persist across turns for consistent pathing.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mobile archetype that never camps. Picks a target region every ~20 turns
(random corner, opposite side, or enemy core), migrates all units toward
it, briefly engages enemies on arrival, then relocates again.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implements a hit-and-run strategy that scouts for lone enemy bots,
attacks from flanking positions, then retreats after 1-2 engagement
turns to avoid reinforcements. Defends own core when under pressure.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Formation-based combat bot that moves all units as a coordinated group:
- Circular mean centroid computation (toroidal-aware)
- Hexagonal packing formation slots with greedy slot assignment
- Rally mode when mean distance from centroid exceeds 3 cells
- Scored movement: formation cohesion + advance toward enemy concentration
- Attack range bonus when engaging enemies in formation
- Self-collision avoidance via claimed destination tracking
- 10 unit tests covering all core algorithms
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Exploration-maximizing bot that maintains per-cell last-seen tick counters,
moves toward the stalest unobserved territory using forward-cone staleness
scoring, flees from enemies within extended combat range, and distributes
multiple bots across angular zones for maximum map coverage.
Archetype: Low Aggression, Low Economy, High Exploration, Low Formation.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PacifistBot never attacks; it survives by maximizing distance from enemies
and retreating toward own core when cornered. Pure evasion strategy that
wins via opponent elimination by third parties.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Economy-maximizing bot that prioritizes energy collection and spawning
while avoiding combat entirely. Seeks nearest uncontested energy via BFS,
flees enemies within 3 cells, avoids contested energy tiles, and stays
near active cores for maximum spawn throughput. Includes 12 unit tests.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Core-defense strategy: bots patrol evenly-spaced slots around their
own core, intercept enemies entering the perimeter radius, and never
chase past the perimeter. Falls back to energy gathering when cores
are lost.
MAP-Elites profile: Low Aggression, Low Economy, Low Exploration, High Formation.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>