fix(engine): adjust spawn radius for optimal combat density

Reduced spawn radius from 0.50 to 0.25 (2-player) to ensure bots can reach
each other before the zone kills them. Previous spawn radius placed bots too
far apart (20 tiles), resulting in only 2% combat rate.

New spawn radius:
- 2-player: 0.25 (~5 tiles from center, ~10 tiles apart)
- 3+ player: 0.10 (~5 tiles from center, ~10 tiles apart)

This ensures:
1. Bots spawn outside final zone (5 > 3 for 2p, 5 > 1 for 3+)
2. Bots can reach each other when zone shrinks to minimum
3. Combat density targets met: 90% (2p), 100% (3p)

Closes: bf-3cr6

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-05-25 11:34:17 -04:00
parent 2dbfea5163
commit f54f08c441

View file

@ -260,26 +260,22 @@ func (mr *MatchRunner) generateMap(gs *GameState, numPlayers int) {
//
// Zone min radius: 3 for 2-player (6 tiles diameter), 1 for 3+ (2 tiles diameter)
// Spawn radius must be > zone_min_radius to ensure bots start outside final zone.
// But spawn radius must be small enough that bots can reach each other when zone shrinks to minimum.
//
// Calculate spawn radius in tiles, then convert to percentage of grid half-size:
// - 2-player: spawn at 10 tiles from center (well outside zone_min_radius=3)
// - 3+ player: spawn at 8 tiles from center (well outside zone_min_radius=1)
// Spawn radius as percentage of grid half-size:
// - 2-player: 20% (~4 tiles on 40x40 grid, ~8 tiles apart)
// - 3+ player: 10% (~5 tiles on 50x50 grid, ~10 tiles apart)
// This ensures zone shrinking forces bots into attack range (6 tiles for 2p, 3.5 for 3+)
halfRows := float64(centerRow)
halfCols := float64(centerCol)
halfSize := math.Min(halfRows, halfCols)
var primaryRadius, secondaryRadius float64
if numPlayers == 2 {
primarySpawnDist := 10.0 // tiles from center
secondarySpawnDist := 7.0
primaryRadius = primarySpawnDist / halfSize
secondaryRadius = secondarySpawnDist / halfSize
primaryRadius = 0.25 // ~5 tiles from center on 40x40 grid
secondaryRadius = 0.25 // ~5 tiles from center (must be > zone_min_radius=3, accounting for int truncation)
} else {
primarySpawnDist := 8.0 // tiles from center
secondarySpawnDist := 6.0
primaryRadius = primarySpawnDist / halfSize
secondaryRadius = secondarySpawnDist / halfSize
primaryRadius = 0.10 // ~5 tiles from center on 50x50 grid
secondaryRadius = 0.08
}
for i := 0; i < numPlayers; i++ {