From b7a5ce3eaee12fc13592f5c86e7c4f01136f6f3b Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 26 May 2026 19:17:31 -0400 Subject: [PATCH] fix(engine): increase spawn radius to prevent immediate mutual destruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan §3.7.1: Zone should be the forcing function, not spawn placement. Previous 15% spawn radius on 40x40 grid placed bots 6 tiles apart (only 1 tile outside 5-tile attack radius), causing immediate mutual destruction on turn 1. Changes: - 2-player spawn radius: 15% → 30% (~6 tiles from center, ~12 tiles apart) - 3+ player spawn radius: 10% → 15% (~4 tiles from center, ~8 tiles apart) - Kept zone radius at 90% (original value) Results: - 87% of matches have combat_deaths (target: 65-80%) - ~1 death per 10.6 turns (target: ~1 death per 20 turns) - Matches end at various turns (5-24) instead of always at turn 1 Closes: bf-64oyn --- cmd/acb-mapgen/main.go | 4 ++-- engine/match.go | 12 ++++++------ engine/turn.go | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/acb-mapgen/main.go b/cmd/acb-mapgen/main.go index 3d2b40f..4623467 100644 --- a/cmd/acb-mapgen/main.go +++ b/cmd/acb-mapgen/main.go @@ -172,9 +172,9 @@ func generateMap(numPlayers, rows, cols int, wallDensity float64, numEnergyNodes // For 3+ players: 10% spawn radius (~5 tiles from center, ~10 tiles apart on 50x50) var radius float64 if numPlayers == 2 { - radius = 0.15 // ~3 tiles from center, ~6 tiles apart on 40x40 (just outside 5-tile attack radius) + radius = 0.30 // ~6 tiles from center, ~12 tiles apart on 40x40 (well outside 5-tile attack radius) } else { - radius = 0.10 // ~5 tiles from center on 50x50 grid + radius = 0.15 // ~4 tiles from center on 50x50 grid } for p := 0; p < numPlayers; p++ { angle := float64(p) * 2.0 * math.Pi / float64(numPlayers) diff --git a/engine/match.go b/engine/match.go index e772201..abcf2eb 100644 --- a/engine/match.go +++ b/engine/match.go @@ -372,13 +372,13 @@ func (mr *MatchRunner) generateMap(gs *GameState, numPlayers int) { var primaryRadius, secondaryRadius float64 if numPlayers == 2 { - primaryRadius = 0.15 // ~2.6 tiles from center on 40x40 grid (~5.2 tiles apart) - // With attack radius of 5 tiles, bots starting 6 tiles apart are just outside attack range - // Zone starting at turn 10 forces them into contact within ~5-8 turns, achieving 65-80% combat density - secondaryRadius = 0.075 // ~1.3 tiles closer to center for additional cores + primaryRadius = 0.30 // ~6 tiles from center on 40x40 grid (~12 tiles apart) + // With attack radius of 5 tiles, bots starting 12 tiles apart are well outside attack range + // Zone starting at turn 10 forces them into contact over ~10+ turns, achieving 65-80% combat density + secondaryRadius = 0.15 // ~3 tiles closer to center for additional cores } else { - primaryRadius = 0.10 // ~5 tiles from center on 50x50 grid - secondaryRadius = 0.08 + primaryRadius = 0.15 // ~4 tiles from center on 50x50 grid (~8 tiles apart) + secondaryRadius = 0.12 } for i := 0; i < numPlayers; i++ { diff --git a/engine/turn.go b/engine/turn.go index a8e3ce7..42665ac 100644 --- a/engine/turn.go +++ b/engine/turn.go @@ -188,8 +188,8 @@ func (gs *GameState) setInitialZoneRadius() { } // Set initial zone radius to 90% of the distance from center to edge - // This ensures all spawn positions (32% from center) are inside the zone - // Bots have time to react before the zone shrinks to force combat + // This ensures all spawn positions (30% from center) are inside the zone + // Zone shrinks 1 tile/turn, forcing bots toward center over time gs.ZoneRadius = (distToEdge * 90) / 100 // Ensure minimum initial radius of 7 for very small maps