diff --git a/engine/match.go b/engine/match.go index ff756b4..da472a8 100644 --- a/engine/match.go +++ b/engine/match.go @@ -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++ {