fix(engine): improve 3+ player combat density with delayed zone and tighter spawns

Problem: 3+ player matches had 0% combat_death events (3p: 0/10, 4p: 3/10).
Bots were dying from zone/self-collision before encountering enemies.

Root causes:
1. Zone started at turn 15, killing bots before they could encounter each other
2. Spawn radius of 25% put bots ~12 tiles apart, but attack radius is only 3.5 tiles

Fix:
1. Delay zone start from turn 15 to turn 30 for 3+ players
2. Reduce spawn radius from 25% to 18% (puts bots ~10 tiles apart)
3. Update comments to reflect attack radius of 3.5 tiles (AttackRadius2=12)

Results:
- 3-player: 67% have combat_death (10/15) - up from 0%
- 4-player: 73% have combat_death (11/15) - up from 30%
- 2-player: no regression (still 30% have combat_death)

Remaining failures are due to random movement patterns keeping bots apart,
which is inherent to stochastic bot behavior.

Closes: bf-4kq3

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-05-24 15:51:00 -04:00
parent b74eecad50
commit a7cb57483b
2 changed files with 5 additions and 5 deletions

View file

@ -257,15 +257,15 @@ func (mr *MatchRunner) generateMap(gs *GameState, numPlayers int) {
// Place cores for each player using rotational symmetry.
// Tight spawn radius forces immediate bot contact.
// For 2 players: 20% from center (~8 tiles on 40x40) → ~16 tiles apart at spawn
// For 3+ players: 25% from center (~7 tiles on 54x54) → ~12 tiles apart at spawn
// Attack radius is 3 tiles, so bots need to close ~10 tiles to engage.
// For 3+ players: 18% from center (~5 tiles on 54x54) → ~10 tiles apart at spawn
// Attack radius is 3.5 tiles (AttackRadius2=12), so bots need to close ~6 tiles to engage.
var primaryRadius, secondaryRadius float64
if numPlayers == 2 {
primaryRadius = 0.20 // Tighter for 2-player to force contact
secondaryRadius = 0.12
} else {
primaryRadius = 0.25
secondaryRadius = 0.15
primaryRadius = 0.18 // Reduced from 0.25 to force earlier contact
secondaryRadius = 0.12
}
halfRows := float64(centerRow)
halfCols := float64(centerCol)

View file

@ -246,7 +246,7 @@ func ConfigForPlayers(numPlayers, coresPerPlayer int) Config {
cfg.ZoneMinRadius = 3 // Tight final zone forces contact
cfg.AttackRadius2 = 12 // 3.5 tiles (balanced for 2-player)
} else {
cfg.ZoneStartTurn = 15 // Start zone early (bots already close at spawn)
cfg.ZoneStartTurn = 30 // Delay zone start to allow bot spawns and movement (was 15, killed bots too early)
cfg.ZoneShrinkInterval = 3 // Shrink every 3 turns (vs default 5)
cfg.ZoneShrinkStep = 3 // Shrink 3 tiles per interval (1 tile/turn)
cfg.ZoneMinRadius = 5 // Tight final zone forces final contact