islaApocalypse/Tools/Scenes
beezm ae97e48229 feat: drainage-network promotion analysis — the river PLAN (terrain-water task 21, C0b part 1)
Pure analysis over the ERODED render map: changes zero terrain, adds zero water.
Priority-flood (task-03 family, Barnes heap+pit, 8-connected) with a one-ulp
epsilon so every filled pit keeps a strictly descending routing path — the ~16.5k
erosion pits route through; depressions >= 2 m deep and >= 10k px survive as
terminal basins (70 on the working seed). D8 flow directions on that routing
surface (D8 as a COMPUTATION, not the reverted carving use), Kahn-propagated flow
accumulation, then promotion: TRUE-ocean outlets (WBID 1 only — two of the first
draft's three 'sea-reaching' trunks actually ended in enclosed lagoons, which is
exactly the overclaim the gate must not inherit) ranked by drainage area, top ~3
with outlet separation become trunks; max-accumulation stems; mountain-exit from
sustained along-stem grade; lean deduped tributaries; lean endorheic terminals
credited with per-basin TOTAL inflow (acc at the deepest cell undercounts flat
lagoon beds 10x — measured).

Output: console report + a JSON plan sidecar next to the source blueprint —
deliberately NOT a blueprint section, so the plan cannot masquerade as realized
water. The source .dat is never written (md5-verified). Headless tool, ~21 s
analysis on 8K; RIVERPLAN_* env dials.

Seed 1280587109 findings for the gate: 3 ocean trunks spread west/north/east
(436k/409k/325k px); the island's five LARGEST systems (1.1M-2.3M px) are all
endorheic — three end in big enclosed lagoons (classify lakes, 19-20 m basins),
two in dry pans; 62.9% of land does not drain to the open ocean, the drainage
restatement of task 18's 'erosion cannot cut the lowlands'. The 2.27M-px giant
terminates in the SE lagoon ~1.1k px from the southernmost town (filed south
report, not enforced).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 18:06:21 -04:00
..
MapPreview.tscn baseline: working salvaged prototype on Godot 4.7.1 (pre-F1) 2026-08-05 01:45:41 -04:00
README.md docs: BLUEPRINT_FORMAT.md + README updates for the v2 container (terrain-water task 02) 2026-08-06 07:31:03 -04:00
RiverPlanTool.tscn feat: drainage-network promotion analysis — the river PLAN (terrain-water task 21, C0b part 1) 2026-08-11 18:06:21 -04:00
RoundTripHarness.tscn feat: blueprint v2 envelope — writer, dual-write, round-trip harness (terrain-water task 02) 2026-08-06 07:24:08 -04:00

/Tools/Scenes — developer environments

Standalone scenes used to run the offline generation scripts. Never add these to a game export.

MapPreview.tscn

The 2D map generator itself.

  • Root: TextureRect · Script: MapGenerator.cs
  • Runs the noise maths, builds the heightmap and biome map, plots the A* road network, writes the .dat, and draws the map via _Draw().

This is the project's main scene (project.godotrun/main_scene). That means pressing F5 anywhere in the project runs this, regenerating the world and overwriting your .dat — it does not start the game. To view the 3D world, open Scenes/Main.tscn and press F6 instead.

MapCaptureTool.tscn

(Lives in /Scenes, wraps this directory's scene.) A SubViewportContainerSubViewport (4096×4096) → MapPreview. It exists purely to render the map offscreen at full resolution: Godot's UI layout engine would otherwise scale a 4096-pixel render down to the editor window, producing a tiny or black PNG.

Note the generator writes the .dat on its own — the capture wrapper only matters for the full-resolution image.

RoundTripHarness.tscn

The blueprint format regression test (script: Tools/Scripts/RoundTripHarness.cs). Run it headless from a terminal — it never generates, it round-trips an existing blueprint through the real parser and v2 writer and asserts semantic equality:

Godot --headless --path <repo> res://Tools/Scenes/RoundTripHarness.tscn

Defaults to the preserved reference blueprint (user://reference_1409879727/); override with the HARNESS_V1_PATH / HARNESS_V2_PATH environment variables. Exit code 0 = pass.

Generating a new world

  1. Open MapPreview.tscn (or Scenes/MapCaptureTool.tscn for the full-resolution PNG).
  2. Press F6Play Current Scene.
  3. Expect minutes, not seconds, and expect the editor to be unresponsive. The A* road stage is the slow part and can stall long enough to be worth abandoning; watch the console for [A*] 1/4 … 4/4 progress. See /Tools/Scripts/README.md.
  4. On success the console prints the export path. Files land in user://~/.local/share/godot/app_userdata/islaApocolypse/.

Then update ServerConfig.json's WorldSeed to match the new .dat, or the 3D scene will fail to load it.