- 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
Implements complete SwarmBot formation-based combat strategy in AssemblyScript:
- JSON parsing for game config and state
- Tight cohesion (radius=3) movement with circular mean center-of-mass
- Enemy-seeking behavior with engagement bonuses
- Toroidal distance calculations
Builds to 27KB swarm.wasm (AssemblyScript produces compact binaries vs
Go's ~12MB). Build script now copies to dist/.
Closes: bf-2a7w
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Rewrote wasm/bots/rusher/src/lib.rs with complete Rusher strategy:
- BFS pathfinding to nearest enemy cores
- Wall and enemy avoidance
- Known enemy core tracking across turns
- Minimal JSON parser for state/config
- Custom bump allocator using __heap_base
- Updated Cargo.toml for no_std build with alloc crate
- Updated build.sh to use cargo directly (sandbox expects low-level exports)
- Output: 14KB WASM (much smaller than Go's 5MB due to no runtime)
The sandbox loader expects pointer-based WASM interface (allocate, init,
compute_moves, free_result) not wasm-bindgen's JavaScript bindings.
This implementation uses raw WASM exports compatible with createPointerBasedBridge.
Closes: bf-2d50
- Create wasm/engine/ with main_wasm.go exporting loadState, step, runMatch,
getReplay, getBots, getEnergy, getConfig, getState functions for browser
sandbox use
- Add engine/wasm.go with Match type providing WASM-friendly interface
- Add wasm/engine/build.sh for GOOS=js GOARCH=wasm compilation
- Update wasm/Makefile to include engine target
- Successfully builds engine.wasm (~5.6 MB) with valid WASM magic number
The engine WASM enables production-accurate match execution in the browser
sandbox per plan §13.1. Build artifacts (.wasm files) are gitignored and
generated on-demand.
Closes: bf-1wew
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>