magicciv/.project/objectives/p1-46-design-lab-terrain-dimensions.md
Natalie 6a601209f6 feat(@projects): finalize terraformer objective completion log
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-01 02:46:34 -04:00

7.6 KiB
Raw Blame History

id title priority status scope owner updated_at wave canonical_doc coordinates_with evidence
p1-46 Terrain Dimensions Lab — fix ridginess, bind 149 flora species, add Whittaker plot p1 done game1 terraformer 2026-05-01 E public/games/age-of-dwarves/docs/terrain/WORLDGEN_PIPELINE.md
p1-47
p1-48
p1-49
p1-50
p2-49
p2-51
.project/designs/app/src/pages/WorldGen/Lab.tsx
.project/designs/app/src/pages/WorldGen.tsx
.project/designs/app/src/utils/worldGen/terrain.ts
.project/designs/app/src/utils/worldGen/hexCanvas.ts
src/game/engine/scenes/tests/world_gen_lab/world_gen_lab_proof.tscn
.project/screenshots/p1-46-world-gen-lab.png
.project/screenshots/p1-49-fauna-trophic.png

Summary

The Terrain Dimensions Lab at /world-gen/lab currently classifies the 17 base biomes and renders cross-tile flora/minerals/fauna overlays driven by 4 biome sliders + 3 toggleable overlay layers. Three known gaps:

  1. Ridginess slider has zero effect at default elevation 0.65. The classifier (terrain.ts:118) only consults ridginess when elevation > 0.85 ∧ ridginess > 0.92 for the volcano case. Anywhere else, the slider does nothing — the user verified this on the live lab and flagged it.
  2. The lab loads 0 of 149 flora species. Trees / shrubs / ground cover are generic per terrain. The 149 species in public/resources/ecology/flora/species/*.json carry rich schema (biomes[], lineage, tags with layer info, quality_tier, canopy_contribution) that the lab ignores entirely.
  3. No Whittaker T×P plot inset — the user can move sliders but has no visual map of where they are in biome space.

This objective is the integration / proof surface of the Wave-E terraformer bundle. It must land after p1-50, p2-49, p2-50 (Wave A), p1-47 (Wave B), and p1-48/p1-49 (Wave C). The Whittaker plot, ridginess behaviour, and flora binding all consume the post-refactor axes.

Acceptance

  • Ridginess split into two derived scalarsridge_terrain_promote handled by classifyTerrain (terrain.ts:133135; plains/grassland→hills when elevation < 0.70 ∧ ridginess > 0.5). ridge_density_modifier = 1 - 0.6 * ridginess applied to canopy Poisson radius in renderCanvas via effective_canopy_density. Rocky stipple in drawHexBase scales with ridginess. Moving ridginess slider produces visible tile changes. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (renderCanvas — ridge_density_modifier, effective_canopy_density; lines ~469475).
  • 149 flora species bound via WASM moduleLab.tsx imports WasmFloraIndex from magic_civ_physics (lines 720733) and calls tileFloraJson(biome, t_band, p_band, riparian_distance, seed, col, row) at line 792. Lineage glyph mapping (drawConifer3Layer / drawTree3Layer / cactus / palm / water-lily / mosses) is the thin rendering shell. Per Rail 1, no TS selector reimplementation. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx lines 720797.
  • Info card shows top-3 species per layer — canopy / understory / ground each with up to 3 species names + quality_tier, sorted by quality_tier desc; deduped across all 35 tiles. Driven by WasmFloraIndex.tileFloraJson() via centreFlora memo in Lab.tsx. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (Lab component — flora info card sections). (Relocated from p1-48 acceptance — tooltip integration.)
  • Fauna species names in tile tooltip — fauna deduped and sorted by ecology_tier desc, top 5 shown in info card with trophic_level prefix, driven by WasmFaunaIndex.tileFaunaJson() via centreFauna memo. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (Lab component — fauna info card section). (Relocated from p1-49 acceptance — tooltip integration.)
  • Fauna ambient overlay renders species glyphsfaunaOn toggle triggers renderCanvas fauna pass; up to 5 silhouettes per tile via drawFaunaGlyph dispatching on glyph_cluster (quadruped / bird / fish / reptile shapes). Species sourced from WasmFaunaIndex.tileFaunaJson(). Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (renderCanvas — fauna ambient pass). (Relocated from p1-49 acceptance — ambient fauna overlay.)
  • Lair tile species silhouetteglyph_cluster field on all 8 lair types in wilds.json; indicator_renderer.gd draws a cluster-tinted fallback diamond when sprite art is absent. Final art pass (PNG sprites sprites/indicators/lair_<type>.png) is deferred — see ## Remaining. Evidence: src/game/engine/src/rendering/indicator_renderer.gd:4057, public/resources/wilds/wilds.json. (Relocated from p1-49 acceptance — lair rendering.)
  • Fauna proof scene screenshot — proof scene at src/game/engine/scenes/tests/fauna_render/fauna_render_proof.tscn (Rail 5). Shows forest biome + red_deer (prey) + grey_wolf + brown_bear (predators), trophic rule PASS. Evidence: .project/screenshots/p1-49-fauna-trophic.png (98K, 2026-05-01). (Relocated from p1-49 acceptance.)
  • Whittaker plot insetWhittakerPlot component rendered at right of canvas; 200×160 SVG, biome cells by T×P, gold focus dot tracks slider. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (Lab JSX, <WhittakerPlot temperature={st.temp} moisture={st.moisture} />); .project/designs/app/src/pages/WorldGen/WhittakerPlot.tsx.
  • Plate / hydrology / climate overlay toggles — three new toggles added to Overlays section in Lab.tsx:
    • Plates — fills tiles by plate_id from tileTectonicsJson, draws boundary classification strokes (PLATE_COLORS + BOUNDARY_STROKE tables).
    • Hydrology — riparian tint from tileHydrologyJson.riparian_distance
      • flow arrows via rustDirToFlatTopDir / neighborCoords.
    • Climate — heatmap of mean_temp or mean_precip from tileClimateJson; temp/precip sub-toggle renders when climateOn. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (LabState platesOn/hydrologyOn/climateOn/climateMode; renderCanvas passes 12; overlay ToggleBtns in JSX).
  • World-shape preset rowPresetBar at top of Lab renders 5 <PresetSelect> dropdowns (landmass / climate / moisture / age / sea_level) reading axes from manifest.json. "Advanced" toggle reveals the 4 raw biome sliders. Preset state tracked in PresetState; no slider mapping (infrastructure deferred to p2-51 Godot scene). Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (PresetBar, PresetState, presets/advancedOpen state, JSX preset row).
  • Headless screenshot fixture — proof scene at src/game/engine/scenes/tests/world_gen_lab/world_gen_lab_proof.tscn (Rail 5). Captured via weston headless on apricot 2026-05-01. Evidence: .project/screenshots/p1-46-world-gen-lab.png (114K).

Remaining

  • Lair sprite art pass — per-type PNG sprites at src/game/engine/public/sprites/indicators/lair_<type>.png (8 types). The geometric cluster-tinted diamond in indicator_renderer.gd will automatically be superseded once sprites land. No code change required.

Non-goals

  • New flora species authoring — schema is owned elsewhere.
  • WFC-driven feature placement preview — out of terraformer scope.
  • Ocean current visualisation — defer to Game 2.
  • Tectonics / lithology axes beyond the lo-fi prepass — that's g2-05.

Dependencies

  • Wave A (p1-50, p2-49, p2-50) → stable axes and biome IDs.
  • Wave B (p1-47) → hydrology overlay.
  • Wave C (p1-48, p1-49) → species rendering.
  • Wave D (p2-51) → preset dropdowns.