Commit Graph
2 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 8a6fb93b50 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>
2026-11-11 20:48:41 -05:00
claudeandClaude Opus 5.5 c70d0c1c4f W2: Procedural island generator
Island.generate(seed) builds a 513 x 513 heightfield (2 m spacing, the whole
1,024 m world) from the match seed's "worldgen" stream: a warped coastline,
a coastal shelf and interior dome, two to four summits joined by ridges,
rolling and rocky detail, and flattened marsh in wet lowland. Land is scaled
so the tallest summit lands between ISLAND_PEAK_MIN and ISLAND_PEAK_MAX,
under the last tide. Each sample gets an elevation band (sea, beach, marsh,
forest, highland, summit) for terrain materials.

- Simulation generates the island unless a test supplies its own ground,
  and spawns players on dry land until the drop arrives.
- The headless server logs world_hash in its start line.
- Island.heightmap_hash() is SHA-256 over millimetre heights and bands.
- tools/island_map.gd draws a top-down map with tide contours.
- New island constants in tuning.gd; GDD gains an island section.

Tests: a 100-seed sweep checks generation time (slowest 617 ms against
5 s), land area, at least two distinct high points, walkable land, bands,
and that no more than 3% of dry land is cut off at sea levels 0 and 8 m
(worst seen 0.87%). A separate server process given only the seed must
log the same heightmap hash.

Closes #9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:15:59 -05:00