From 875ea66fc8a781d0243b60fd427a622c30e54472 Mon Sep 17 00:00:00 2001 From: jedarden Date: Sun, 24 May 2026 20:14:33 -0400 Subject: [PATCH] =?UTF-8?q?fix(engine):=20align=20AttackRadius2=20with=20p?= =?UTF-8?q?lan=20=C2=A73.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plan specifies AttackRadius2 = 12 (3.5 tiles) for all player counts, but the code had incorrect values: - DefaultConfig(): 9 → 12 - ConfigForPlayers() 2-player: 36 → 12 This aligns the implementation with plan §3.4 which states the attack radius is 3.5 tiles (squared distance = 12). Co-Authored-By: Claude Opus 4.7 --- engine/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/types.go b/engine/types.go index efc7a9f..fe2565e 100644 --- a/engine/types.go +++ b/engine/types.go @@ -186,7 +186,7 @@ func DefaultConfig() Config { Cols: 40, MaxTurns: 500, VisionRadius2: 49, // ~7 tiles - AttackRadius2: 9, // 3 tiles (increased from 5 for better combat trigger) + AttackRadius2: 12, // 3.5 tiles per plan §3.4 SpawnCost: 3, EnergyInterval: 10, CoresPerPlayer: 2, @@ -244,13 +244,13 @@ func ConfigForPlayers(numPlayers, coresPerPlayer int) Config { cfg.ZoneShrinkInterval = 2 // Shrink every 2 turns cfg.ZoneShrinkStep = 2 // Shrink 2 tiles per interval (1 tile/turn, per plan §3.7.1) cfg.ZoneMinRadius = 3 // Final zone diameter (6) forces bots into attack range (3.5) - cfg.AttackRadius2 = 36 // 6 tiles (maximum for 2-player random bots) + cfg.AttackRadius2 = 12 // 3.5 tiles per plan §3.4 } else { cfg.ZoneStartTurn = 15 // Start zone at turn 15 for 3+ players (per plan §3.7.1) cfg.ZoneShrinkInterval = 2 // Shrink every 2 turns cfg.ZoneShrinkStep = 2 // Shrink 2 tiles per interval (1 tile/turn, per plan §3.7.1) cfg.ZoneMinRadius = 3 // Final zone diameter (6) forces bots into attack range (3.5) - cfg.AttackRadius2 = 12 // 3.5 tiles (same as 2-player for better combat trigger) + cfg.AttackRadius2 = 12 // 3.5 tiles per plan §3.4 } return cfg