W2 Procedural island generator #9

Closed
opened 2026-11-09 05:26:05 +00:00 by claude · 1 comment
Owner

Depends on: F5

Generate a roughly 2 km island heightmap from a seed, with elevation bands that suit the tide: beaches, marsh, forest, highland, and two or more summits.

Acceptance

  • The same seed gives the same heightmap hash on server and client.
  • Generation takes under 5 seconds.
  • Tests over 100 seeds confirm usable land area, multiple high points, and that land stays connected at early tide phases.
**Depends on:** F5 Generate a roughly 2 km island heightmap from a seed, with elevation bands that suit the tide: beaches, marsh, forest, highland, and two or more summits. **Acceptance** - The same seed gives the same heightmap hash on server and client. - Generation takes under 5 seconds. - Tests over 100 seeds confirm usable land area, multiple high points, and that land stays connected at early tide phases.
claude added this to the v0.2 Movement and Island milestone 2026-11-09 05:26:05 +00:00
claude added the type/featurepriority/high labels 2026-11-09 05:26:05 +00:00
claude added this to the Tidewall v1.0 project 2026-11-09 15:00:04 +00:00
eric closed this issue 2026-11-10 19:16:08 +00:00
Author
Owner

Done in c70d0c1.

What changed

  • src/sim/island.gd: Island.generate(seed) builds a 513 × 513 heightfield (2 m spacing over the 1,024 m world) from the seed's worldgen stream. It has a warped coastline, a coastal shelf rising to an interior dome, 2 to 4 summits joined by ridges, rolling lowland and craggy highland detail, and flattened marsh where moisture is high. The tallest summit is scaled into ISLAND_PEAK_MIN..ISLAND_PEAK_MAX (58 to 67 m), below the last tide level. Each sample gets a band (sea, beach, marsh, forest, highland, summit), ready for W3's splat materials.
  • Simulation generates the island unless a test passes its own ground. Players spawn on dry land until W7's drop replaces spawning.
  • The headless server logs world_hash in its start line.
  • tools/island_map.gd draws a top-down map with a contour at each tide level.
  • New island constants are in tuning.gd, and the GDD has a new island section.

Decision on size: the issue says "roughly 2 km", but WORLD_SIZE_METRES is 1,024 m and the snapshot format quantizes positions over a 1,024 m range. The island is about 0.8 to 1 km across, which suits 24 players. Doubling the world would mean coarser position quantization in snapshots, so I kept 1 km.

Tests (make check passes: 104 tests, self-check, smoke)

  • 100-seed sweep: the slowest generation was 617 ms, against the 5 s limit. Land covers 0.45 to 0.50 of the world. At least two distinct high points every time (2: 31 seeds, 3: 41, 4: 28), where a high point is at least 35 m, the highest within 80 m, with a 6 m valley to any higher peak. At least 85% of land is walkable. All bands are present, and marsh appears in 100 of 100.
  • Connectivity: water floods in from the world edge, and low ground it can't reach stays dry. At sea levels 0 and 8 m, at most 3% of dry land may sit apart from the main landmass. The worst case seen was 0.87%.
  • Same seed gives the same hash. A separate server process given only the seed logs the same world_hash that the test computes. Worldgen doesn't touch the match's RNG streams.

I checked top-down maps of seeds 1 to 4 by eye. Each tide contour takes a ring of the island, and the summits stand apart with ridges between them.

Smoke p95 tick is 372 µs with 24 bots on the island. Bots still wander into the sea floor, which is expected until W6 water.

Done in c70d0c1. **What changed** - `src/sim/island.gd`: `Island.generate(seed)` builds a 513 × 513 heightfield (2 m spacing over the 1,024 m world) from the seed's `worldgen` stream. It has a warped coastline, a coastal shelf rising to an interior dome, 2 to 4 summits joined by ridges, rolling lowland and craggy highland detail, and flattened marsh where moisture is high. The tallest summit is scaled into `ISLAND_PEAK_MIN`..`ISLAND_PEAK_MAX` (58 to 67 m), below the last tide level. Each sample gets a band (sea, beach, marsh, forest, highland, summit), ready for W3's splat materials. - `Simulation` generates the island unless a test passes its own ground. Players spawn on dry land until W7's drop replaces spawning. - The headless server logs `world_hash` in its `start` line. - `tools/island_map.gd` draws a top-down map with a contour at each tide level. - New island constants are in `tuning.gd`, and the GDD has a new island section. **Decision on size:** the issue says "roughly 2 km", but `WORLD_SIZE_METRES` is 1,024 m and the snapshot format quantizes positions over a 1,024 m range. The island is about 0.8 to 1 km across, which suits 24 players. Doubling the world would mean coarser position quantization in snapshots, so I kept 1 km. **Tests** (`make check` passes: 104 tests, self-check, smoke) - 100-seed sweep: the slowest generation was 617 ms, against the 5 s limit. Land covers 0.45 to 0.50 of the world. At least two distinct high points every time (2: 31 seeds, 3: 41, 4: 28), where a high point is at least 35 m, the highest within 80 m, with a 6 m valley to any higher peak. At least 85% of land is walkable. All bands are present, and marsh appears in 100 of 100. - Connectivity: water floods in from the world edge, and low ground it can't reach stays dry. At sea levels 0 and 8 m, at most 3% of dry land may sit apart from the main landmass. The worst case seen was 0.87%. - Same seed gives the same hash. A **separate server process** given only the seed logs the same `world_hash` that the test computes. Worldgen doesn't touch the match's RNG streams. I checked top-down maps of seeds 1 to 4 by eye. Each tide contour takes a ring of the island, and the summits stand apart with ridges between them. Smoke p95 tick is 372 µs with 24 bots on the island. Bots still wander into the sea floor, which is expected until W6 water.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claude/tidewall#9