M2: The rising tide
The tide now runs every match, from the drop on, and water flows along the terrain instead of standing everywhere under one level. - Tide (src/sim/tide.gd): Tuning.TIDE_PHASES as a schedule of holds and rises. Level, forecast (each hold announces its level), stage, drowning rate, surge timing and the time limit are pure functions of the tick. - SafeGround (src/sim/safe_ground.gd): safe ground from elevation on an 8 m grid, and per-island planned levels. A phase's level is lowered, when it must be, to just under the top of the largest piece of land still dry when the phase begins; every phase still rises at least TIDE_MIN_RISE_METRES and the last keeps its table level. - Flood (src/sim/flood.gd): a 4 m grid aligned with building cells. Water reaches cells from the world's edge through ground under the sea and edges no breakwater stack seals. Cut-off ground stays dry until overtopped or breached, then fills at BREACH_FLOW_METRES_PER_SECOND. Incremental: only the edges where water stopped are re-tested, once a second. - Players, drowning and structure wear use the local water. Breakwaters wear by head and fail past BREAKWATER_MAX_HEAD; a breach floods what's behind. - Storm surges: each phase's `surge` damage hits pieces near the water when its rise begins. - Sudden death after the last rise, then a time limit. Match breaks ties (most health, highest feet, earliest join) at the limit and when the last players fall together, so every match ends with a winner. Tests: test_tide (18) covers the schedule and forecasts, planned levels, overtopping, a sealed ring, breach and fill rate, spill-over, pressure wear and head failure, dry pieces, surges, drowning under the real tide, sudden death, the time limit and simultaneous eliminations. test_island's 100-seed sweep now checks that every phase leaves safe ground reachable on foot from the whole main landmass within the phase's time (closest margin 14 s). A full rise with 24 bots measured p99 1.5 ms, max 1.9 ms per tick. Closes #25 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+26
-7
@@ -175,14 +175,33 @@ const PROP_POI_CLEARANCE: float = 3.0
|
||||
# must exceed ISLAND_MAX_HEIGHT, so that every match ends.
|
||||
const ISLAND_MAX_HEIGHT: float = 70.0
|
||||
const TIDE_PHASES: Array[Dictionary] = [
|
||||
{"hold": 150.0, "rise": 60.0, "level": 8.0, "drown_dps": 2},
|
||||
{"hold": 100.0, "rise": 50.0, "level": 18.0, "drown_dps": 4},
|
||||
{"hold": 80.0, "rise": 45.0, "level": 30.0, "drown_dps": 6},
|
||||
{"hold": 60.0, "rise": 40.0, "level": 42.0, "drown_dps": 8},
|
||||
{"hold": 45.0, "rise": 35.0, "level": 54.0, "drown_dps": 12},
|
||||
{"hold": 30.0, "rise": 30.0, "level": 64.0, "drown_dps": 16},
|
||||
{"hold": 20.0, "rise": 40.0, "level": 75.0, "drown_dps": 25},
|
||||
{"hold": 150.0, "rise": 60.0, "level": 8.0, "drown_dps": 2, "surge": 0},
|
||||
{"hold": 100.0, "rise": 50.0, "level": 18.0, "drown_dps": 4, "surge": 40},
|
||||
{"hold": 80.0, "rise": 45.0, "level": 30.0, "drown_dps": 6, "surge": 60},
|
||||
{"hold": 60.0, "rise": 40.0, "level": 42.0, "drown_dps": 8, "surge": 80},
|
||||
{"hold": 45.0, "rise": 35.0, "level": 54.0, "drown_dps": 12, "surge": 100},
|
||||
{"hold": 30.0, "rise": 30.0, "level": 64.0, "drown_dps": 16, "surge": 120},
|
||||
{"hold": 20.0, "rise": 40.0, "level": 75.0, "drown_dps": 25, "surge": 150},
|
||||
]
|
||||
## Each island's levels are planned from its terrain (SafeGround): a phase's level is
|
||||
## lowered, if need be, to this far under the top of the largest piece of land still
|
||||
## dry when it begins, but every phase still rises at least TIDE_MIN_RISE_METRES. The
|
||||
## last phase always takes its table level.
|
||||
const TIDE_SAFE_MARGIN_METRES: float = 2.0
|
||||
const TIDE_MIN_RISE_METRES: float = 4.0
|
||||
## When a phase's rise begins, a storm surge does the phase's `surge` damage once to
|
||||
## every built piece whose base is below the water plus this height, where that water
|
||||
## reaches it. Breakwaters take it too.
|
||||
const TIDE_SURGE_HEIGHT_METRES: float = 2.0
|
||||
## Sudden death begins when the last rise ends: every player still standing loses this
|
||||
## much health a second, armor or not. When it has run this long, the match ends and
|
||||
## the winner is decided by Match's tie-break: most health, then highest feet, then
|
||||
## earliest to join. So every match ends within the tide's total time plus this.
|
||||
const TIDE_SUDDEN_DEATH_SECONDS: float = 60.0
|
||||
const TIDE_SUDDEN_DEATH_DPS: int = 5
|
||||
## The flood grid's cells are this big, matching the building grid so breakwater edges
|
||||
## line up with cell edges.
|
||||
const FLOOD_CELL_METRES: float = 4.0
|
||||
|
||||
# Building
|
||||
const GRID_CELL_METRES: float = 4.0
|
||||
|
||||
Reference in New Issue
Block a user