Commit Graph

1 Commits

Author SHA1 Message Date
Christopher Wiebe 59784048cd M2: World map render in Godot
Renders the full worldgen output as a Godot scene at visual parity with
worldgen-dump's PNG output: biome tiles, rivers/roads/rails as Line2D
polylines, settlements as filled circles. Pan + zoom via Camera2D.

WorldMapView.cs:
  - Loads Content/Data via res:// walk-up, runs WorldGenerator.RunAll
  - Tile palette built from BiomeDef.ParsedColor() — same source as the
    PNG dump, so colours are identical
  - Tiles rendered as a 256x256 Image scaled by WORLD_TILE_PIXELS to
    cover world-pixel space (matches polyline coord system)
  - Polyline draw order mirrors LineFeatureRenderer.cs: roads (smaller
    first) -> rivers -> rail tie underlay -> rail line. Bridges as
    short Line2Ds; settlements as SettlementDot (Node2D + _Draw circle)
  - Line widths in world-pixel space, tuned for visibility at world-map
    zoom; M4 will add zoom-aware width scaling for tactical view
  - Camera fits the whole world (95% of viewport) on first frame

PanZoomCamera.cs:
  - Mouse-wheel zoom centered on cursor (cursor world-point stays fixed)
  - Middle/right click + drag to pan
  - MinZoom/MaxZoom configurable per-instance

Main.cs:
  - --world-map [seed] flag launches the view (default seed 12345)
  - Arg parser now reads both GetCmdlineArgs and GetCmdlineUserArgs so
    callers don't need to remember the "--" separator
  - --smoke-test path and M0 hello-world fallback unchanged

Visual diff against world_seed12345.png (generated by
worldgen-dump --seed 12345) confirmed manually: same biome palette, same
rivers/roads topology, same settlement placement and tier colours.
3 rivers, 91 roads, 226 settlements (138 PoIs), 0 rails (ENABLE_RAIL=false),
0 bridges (this seed has no road/river crossings). All match the PNG.

Settlement dot sizes iterated twice from user feedback — final values
in tile units, scaled to world-pixel space, so they shrink at world-map
zoom and grow toward tactical zoom (the right "scale with the map"
behaviour).

Closes M2 of theriapolis-rpg-implementation-plan-godot-port.md.
Next: M3 (asset pipeline).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 19:04:02 -07:00