The defining mechanic. The sea rises in announced phases, flooding low ground until only the final high points remain, and storm surges damage low structures. A sealed breakwater ring keeps water out for a limited time, and water must spill over or break through it eventually.
Acceptance
Phase timings live in the tunable table and each phase forecasts the next level.
Safe ground is computed from elevation and stays reachable, tested over 100 seeds.
Matches always end: at the final phase, a deterministic sudden-death rule guarantees a winner within the time limit.
Tests cover flooding, drowning, breakwater failure and surge damage.
**Depends on:** M1, W6, B3
The defining mechanic. The sea rises in announced phases, flooding low ground until only the final high points remain, and storm surges damage low structures. A sealed breakwater ring keeps water out for a limited time, and water must spill over or break through it eventually.
**Acceptance**
- Phase timings live in the tunable table and each phase forecasts the next level.
- Safe ground is computed from elevation and stays reachable, tested over 100 seeds.
- Matches always end: at the final phase, a deterministic sudden-death rule guarantees a winner within the time limit.
- Tests cover flooding, drowning, breakwater failure and surge damage.
claude
added this to the v0.4 Match Loop and Bots milestone 2026-11-09 05:27:06 +00:00
Tide (src/sim/tide.gd): TIDE_PHASES as a schedule of holds and rises, started by the match with the drop. Level, forecast (each hold announces its phase's level), stage, drowning rate, surge timing and time limit are pure functions of the tick.
SafeGround (src/sim/safe_ground.gd): safe ground from elevation, and per-island planned levels. A phase's table level is lowered, if needed, to TIDE_SAFE_MARGIN_METRES under the top of the largest piece of land still dry when the phase begins; each phase still rises at least TIDE_MIN_RISE_METRES, and the last keeps its table level (75 m, above every island). Without this, 3 of 100 islands left the main landmass with no safe ground late in the match.
Flood (src/sim/flood.gd): a 4 m grid aligned with building cells. Water reaches a cell from the world's edge, through ground under the sea, across edges no breakwater stack seals. Cut-off ground stays dry until overtopped or breached, then fills at BREACH_FLOW_METRES_PER_SECOND. It's incremental: only edges where water stopped are re-tested, once a second.
Players, drowning and structure wear use the local water. Breakwaters wear by head, fail past BREAKWATER_MAX_HEAD, and a breach floods what's behind. Storm surges (surge per phase) hit pieces near the water when a rise begins.
Sudden death after the last rise (TIDE_SUDDEN_DEATH_DPS), then a time limit. Match breaks ties (most health, then highest feet, then earliest join) at the limit and when the last players fall on the same tick, so every match has a winner.
test_tide (18): schedule and forecasts; planned levels; ground cut off by land stays dry until overtopped, then fills at the breach rate; a sealed ring; breach; spill-over; pressure wear and head failure; pieces behind a ring take no tide damage; surges; drowning under the real tide with a player behind an iron ring staying dry; sudden death; time-limit tie-break; simultaneous elimination; the time-limit bound.
Safe ground over 100 seeds: test_island's existing 100-island sweep now also checks that every phase that leaves land leaves it reachable on foot from the whole main landmass within the phase's hold and rise (closest margin 14 s; no one needs to swim). 103 phase levels across the 100 islands were lowered by planning, mostly the 64 m phase on islands whose peaks are 58 to 63 m.
Timing (24 bots, headless, this host): a full real rise measured p50 0.65 ms, p99 1.5 ms, max 1.9 ms per tick, inside the 12 ms budget. The smoke run's 1,000 ticks are still all hold.
Follow-ups / notes
Movement samples the water at the player's 4 m cell. Edges between flooded and dry cells are blocky; the client's water rendering (A6) will need the flood grid, not just sea_level.
Water never drains, so rebuilding a breached ring doesn't pump it out. That's deliberate for now.
The snapshot format (N2) needs the flood state or a way to rebuild it; it's deterministic from the tide and the breakwater events.
— tidewall-build
Done in 8a6fb93.
**What changed**
- `Tide` (`src/sim/tide.gd`): `TIDE_PHASES` as a schedule of holds and rises, started by the match with the drop. Level, forecast (each hold announces its phase's level), stage, drowning rate, surge timing and time limit are pure functions of the tick.
- `SafeGround` (`src/sim/safe_ground.gd`): safe ground from elevation, and **per-island planned levels**. A phase's table level is lowered, if needed, to `TIDE_SAFE_MARGIN_METRES` under the top of the largest piece of land still dry when the phase begins; each phase still rises at least `TIDE_MIN_RISE_METRES`, and the last keeps its table level (75 m, above every island). Without this, 3 of 100 islands left the main landmass with no safe ground late in the match.
- `Flood` (`src/sim/flood.gd`): a 4 m grid aligned with building cells. Water reaches a cell from the world's edge, through ground under the sea, across edges no breakwater stack seals. Cut-off ground stays dry until overtopped or breached, then fills at `BREACH_FLOW_METRES_PER_SECOND`. It's incremental: only edges where water stopped are re-tested, once a second.
- Players, drowning and structure wear use the local water. Breakwaters wear by head, fail past `BREAKWATER_MAX_HEAD`, and a breach floods what's behind. Storm surges (`surge` per phase) hit pieces near the water when a rise begins.
- Sudden death after the last rise (`TIDE_SUDDEN_DEATH_DPS`), then a time limit. `Match` breaks ties (most health, then highest feet, then earliest join) at the limit and when the last players fall on the same tick, so every match has a winner.
**Tests** (`make check` passes: 285 tests, self-check, smoke)
- `test_tide` (18): schedule and forecasts; planned levels; ground cut off by land stays dry until overtopped, then fills at the breach rate; a sealed ring; breach; spill-over; pressure wear and head failure; pieces behind a ring take no tide damage; surges; drowning under the real tide with a player behind an iron ring staying dry; sudden death; time-limit tie-break; simultaneous elimination; the time-limit bound.
- **Safe ground over 100 seeds**: `test_island`'s existing 100-island sweep now also checks that every phase that leaves land leaves it reachable on foot from the whole main landmass within the phase's hold and rise (closest margin 14 s; no one needs to swim). 103 phase levels across the 100 islands were lowered by planning, mostly the 64 m phase on islands whose peaks are 58 to 63 m.
- Timing (24 bots, headless, this host): a full real rise measured p50 0.65 ms, p99 1.5 ms, max 1.9 ms per tick, inside the 12 ms budget. The smoke run's 1,000 ticks are still all hold.
**Follow-ups / notes**
- Movement samples the water at the player's 4 m cell. Edges between flooded and dry cells are blocky; the client's water rendering (A6) will need the flood grid, not just `sea_level`.
- Water never drains, so rebuilding a breached ring doesn't pump it out. That's deliberate for now.
- The snapshot format (N2) needs the flood state or a way to rebuild it; it's deterministic from the tide and the breakwater events.
— tidewall-build
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Depends on: M1, W6, B3
The defining mechanic. The sea rises in announced phases, flooding low ground until only the final high points remain, and storm surges damage low structures. A sealed breakwater ring keeps water out for a limited time, and water must spill over or break through it eventually.
Acceptance
Done in
8a6fb93.What changed
Tide(src/sim/tide.gd):TIDE_PHASESas a schedule of holds and rises, started by the match with the drop. Level, forecast (each hold announces its phase's level), stage, drowning rate, surge timing and time limit are pure functions of the tick.SafeGround(src/sim/safe_ground.gd): safe ground from elevation, and per-island planned levels. A phase's table level is lowered, if needed, toTIDE_SAFE_MARGIN_METRESunder the top of the largest piece of land still dry when the phase begins; each phase still rises at leastTIDE_MIN_RISE_METRES, and the last keeps its table level (75 m, above every island). Without this, 3 of 100 islands left the main landmass with no safe ground late in the match.Flood(src/sim/flood.gd): a 4 m grid aligned with building cells. Water reaches a cell from the world's edge, through ground under the sea, across edges no breakwater stack seals. Cut-off ground stays dry until overtopped or breached, then fills atBREACH_FLOW_METRES_PER_SECOND. It's incremental: only edges where water stopped are re-tested, once a second.BREAKWATER_MAX_HEAD, and a breach floods what's behind. Storm surges (surgeper phase) hit pieces near the water when a rise begins.TIDE_SUDDEN_DEATH_DPS), then a time limit.Matchbreaks ties (most health, then highest feet, then earliest join) at the limit and when the last players fall on the same tick, so every match has a winner.Tests (
make checkpasses: 285 tests, self-check, smoke)test_tide(18): schedule and forecasts; planned levels; ground cut off by land stays dry until overtopped, then fills at the breach rate; a sealed ring; breach; spill-over; pressure wear and head failure; pieces behind a ring take no tide damage; surges; drowning under the real tide with a player behind an iron ring staying dry; sudden death; time-limit tie-break; simultaneous elimination; the time-limit bound.test_island's existing 100-island sweep now also checks that every phase that leaves land leaves it reachable on foot from the whole main landmass within the phase's hold and rise (closest margin 14 s; no one needs to swim). 103 phase levels across the 100 islands were lowered by planning, mostly the 64 m phase on islands whose peaks are 58 to 63 m.Follow-ups / notes
sea_level.— tidewall-build