Skip to content

Randomized min-distance spawns replace the mirrored spawn table - #264

Merged
Vodkadav merged 1 commit into
mainfrom
fix/random-min-distance-spawns
Jul 17, 2026
Merged

Randomized min-distance spawns replace the mirrored spawn table#264
Vodkadav merged 1 commit into
mainfrom
fix/random-min-distance-spawns

Conversation

@Vodkadav

Copy link
Copy Markdown
Owner

Fixes tanks spawning stuck inside each other. SpawnTable rewritten: seeded random placement over eligible cells (open, non-lethal — lava/water excluded), pairwise Chebyshev separation targeting 10 cells and relaxing one cell at a time to a floor of 3; below the floor, farthest-point placement best-effort maximises separation. Deterministic per seed (GameSetup.ArenaSeed / shared lobby seed), so solo, host and generator paths all agree. Respawns keep the assigned cell.

All four xUnit suites + 195 headless GoDotTest green (verified independently by orchestrator).

🤖 Generated with Claude Code

…able

Tanks could spawn stuck inside each other: SpawnTable mirrored 2 declared
points into 8 candidates, centre-ish spawns collapsed under mirroring, and
the ring-search nudged duplicates onto ADJACENT cells.

SpawnTable is now seeded random placement: pairwise Chebyshev separation
targets 10 cells, relaxes one cell at a time to a floor of 3 on cramped
maps, and below that farthest-point placement best-effort maximises
separation - two tanks share a cell only when the field is smaller than
the spawn count. Eligibility is the caller's predicate and must exclude
deadly terrain: themed arenas allow floor only; the net scene predicate
now also excludes lava explicitly (drivable but lethal; water already
blocks movement).

Deterministic per seed so peers agree: IArenaBuilder.Build takes the seed
(solo passes GameSetup.ArenaSeed, net the shared lobby seed - terrain
stays seed-independent), NetArena3DScene derives spawns from the match
seed (the now-redundant post-hoc shuffle is gone), and ArenaGenerator
seats its tank spawns through the same placement.

Respawns still revive at the tank's assigned cell.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Vodkadav
Vodkadav merged commit 2e78248 into main Jul 17, 2026
8 checks passed
@Vodkadav
Vodkadav deleted the fix/random-min-distance-spawns branch July 17, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant