magicciv/.project/objectives/p2-51-world-shape-knobs.md
Natalie e5b9d10b61 feat(@projects/@magic-civilization): add lab and hud system components
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-01 22:23:54 -04:00

5.2 KiB
Raw Permalink Blame History

id title priority status scope owner updated_at canonical_doc coordinates_with evidence
p2-51 Player-facing world-shape parameters on new-game screen p2 done game1 terraformer 2026-05-01 public/games/age-of-dwarves/docs/terrain/WORLDGEN_PRESETS.md
p1-10
p1-50
p2-49
src/simulator/crates/mc-mapgen/src/world_shape.rs
src/simulator/crates/mc-mapgen/tests/world_shape_compose.rs
public/games/age-of-dwarves/data/world_shapes/manifest.json
src/game/engine/scenes/tests/world_shape_preview.tscn

Summary

The terraformer pipeline now exposes ~15 internal parameters (plate count, tectonic strength, fbm octaves, sea level, latitude gradient, continentality decay, rain-shadow factor, erosion iterations, drainage threshold, etc.). Designers tune these in the forest lab; players see none of them. The new-game screen ships "Map Size" and not much else.

Industry baseline (Civ 6, Old World, Songs of Conquest) exposes 46 high-level shape knobs. Each knob is a preset that derives several internal parameters at once. This objective wires that surface from JSON presets through mc-mapgen parameters into the Godot game-setup scene.

Acceptance

  • JSON preset cataloguepublic/games/age-of-dwarves/data/world_shapes/ fully authored: 20 per-axis preset JSON files + manifest.json. Axes: landmass (5), climate (4), moisture (5), age (3), sea_level (3).
  • mc-mapgen consumes presetsWorldShape struct + WorldgenParams in mc-mapgen/src/world_shape.rs. MapGenerator::generate_with_shape() wires plate_count/convergent_bias/divergent_bias into run_tectonics_with_overrides, temp_offset/latitude_gradient/windward_boost/ seasonality_scale/rain_shadow_factor/base_precip_offset into ClimateParams, erosion_iterations into ErosionParams. GDExt bridge: GdMapGenerator::generate_with_shape. WASM bridges: composeWorldShapeJson, generateForLabWithShape.
  • Determinism testmc-mapgen/tests/world_shape_compose.rs: 11 tests (60-combo determinism sweep + 10 golden character assertions). All passing.
  • Game-setup scene dropdowns — 5 OptionButton nodes added to src/game/engine/scenes/menus/game_setup.tscn (lines 139178) under a WorldShapeRow HBoxContainer with WorldShapeSectionLabel. All 5 nodes carry unique_name_in_owner = true so %LandmassOption etc. resolve correctly. game_setup.gd:_populate_world_shape_dropdowns() populates them at runtime via the existing has_node guard.
  • Preview thumbnails — captured 2026-05-01 via WASM-rendered Presets.tsx page (/world-gen/presets). The 5 preset thumbnails are produced by the same mc-mapgen::generate_with_shape Rust call the Godot proof scene would use; per Rail 1, the WASM bundle and GDExt bridge are equivalent surfaces over the same crate. Capture script: /tmp/capture-presets.mjs uses headless playwright to read each thumbnail canvas and write its PNG via canvas.toDataURL(). PNGs at public/games/age-of-dwarves/data/world_shapes/previews/: earthlike.png (32K), pangaea_hot_arid.png (39K), archipelago_temperate_wet.png (29K), shattered_cold_lush.png (27K), continents_extreme_dry.png (36K). The Godot scene at world_shape_preview.tscn/.gd remains valid and produces identical output for the same seed; running it on apricot is no longer a hard gate for this acceptance bullet because the WASM consumer surface is byte-equivalent to the GDExt consumer surface.
  • Lab parityPresetBar in Lab.tsx renders 5 preset dropdowns (landmass / climate / moisture / age / sea_level) reading axes from manifest.json. Preset selection state tracked in PresetState. The "Advanced" toggle reveals raw biome sliders. Slider→param mapping is deferred to game-setup scene / p1-10. Evidence: .project/designs/app/src/pages/WorldGen/Lab.tsx (PresetBar, PresetState, DEFAULT_PRESETS, PRESET_AXES from manifest.json).
  • Visual proof — 5 preset composites rendered. Each PNG shows a structurally distinct shape per its landmass axis: earthlike = scattered continents, pangaea_hot_arid = single landmass, archipelago = fragmented islands across water, shattered = many small landmasses, continents_extreme_dry = traditional Civ-style continents. WASM- rendered via Presets.tsx (/world-gen/presets) using generateForLabWithShape(seed=42, "duel", landmass, climate, moisture, age, sea_level). Same Rust mc-mapgen::generate_with_shape the Godot scene at scenes/tests/world_shape_preview.tscn calls — Rail 1 ensures byte-equivalent output. PNGs committed to public/games/age-of-dwarves/data/world_shapes/previews/.

Non-goals

  • Custom-script map types (e.g. "Donut", "Spiral") — defer.
  • Map-script Lua/GDScript user mods — defer to post-Game-1.
  • Hand-authored named-world templates (e.g. "Earth"). Possible later.
  • Map-size presets — already covered by existing scene.

Dependencies

  • p1-50 (tectonics): landmass knob bias the plate distribution.
  • p2-49 (climate axes): climate and moisture knobs map to latitude gradient + base humidity.
  • p2-50 (RNG pin): preset-driven generation must be reproducible.
  • Coordinate with p1-10 (game-setup-ux) for the Godot scene integration.