Skip to content

feat(maps): layout select, scale tiers, and the City Streets generator#148

Merged
Daren9m merged 2 commits into
mainfrom
claude/map-layouts
Jul 20, 2026
Merged

feat(maps): layout select, scale tiers, and the City Streets generator#148
Daren9m merged 2 commits into
mainfrom
claude/map-layouts

Conversation

@Daren9m

@Daren9m Daren9m commented Jul 20, 2026

Copy link
Copy Markdown
Owner

PR 1 of milestone #8 Map Layouts & Scale (spec: docs/superpowers/specs/2026-07-19-map-layouts-design.md). Closes #145.

What changed

  • Layout decoupled from Environment: new Layout select (Auto / Dungeon / Cavern / Wilderness / City Streets) on the maps page and the encounter builder's map options. Auto keeps today's mapping except Urban → City Streets and Any → Dungeon; a plain dungeon is now directly selectable in any environment, flavored by it.
  • City Streets generator: full-run 2-wide street lattice cuts jittered blocks; blocks fill as solid building masses (each with a street-facing locked door → UVTT portals), plazas (fountain/statue), market rows, or groves. Gate zone, far-ward opposition zone, landmark zones, boss on the largest plaza. Streets span edge-to-edge, so connectivity holds by construction — asserted for 15 seeds (every open cell reachable).
  • Scale tiers replace the size picker: Skirmish ~16×12 / Standard ~26×20 / Large ~40×30 / Massive ~60×45, derived per layout with ±8% seeded jitter (same tier, different silhouettes). Engine ceiling 40×30 → 60×45. width/height survive as exact overrides.
  • Reproduction correctness: scale-mode maps consume jitter draws, so share links serialize ms and history stubs replay scale mode — regenerating with explicit dimensions would skip the draws and change the grid. Caught by TDD before it shipped; legacy mw/mh links parse and round-trip untouched.
  • Exports: pixels-per-grid = min(70, floor(4096/longest side)) feeds PNG and the UVTT resolution block alike — grid alignment exact at every size (Massive ≈ 68 px/cell).

Compatibility

Third accepted grid-stream break (jitter draws lead the stream; Urban seeds re-layout as cities). All 9 hash pins re-recorded — including an environment: 'Any' + exact-dims pin whose hash is unchanged from the previous contract, proving legacy-mode draw continuity.

Tests

11 new layout/scale tests + scale-mode history round trip; dungeon-shaped fixtures moved to explicit layout: 'dungeon'; freeze file now pins 9 configurations. Full suite 657 passing; typecheck, lint, build clean. Verified on the static build: Standard city from a share link with grim zone names, Massive city at 60×43, width inputs gone.

Daren9m added 2 commits July 19, 2026 19:50
- MapLayout decoupled from Environment (auto/dungeon/cavern/wilderness/
  city; building reserved for PR 2). Auto maps Urban to city and Any to
  dungeon; plain dungeons are directly selectable in any environment
- MapScale tiers (Skirmish/Standard/Large/Massive) replace the
  width/height picker on both pages; dimensions derive per layout with
  +/-8pct seeded jitter; engine ceiling raised to 60x45; width/height
  remain exact overrides for legacy links and JSON callers
- generateCity: full-run street lattice, solid building masses with
  street-facing locked doors (UVTT portals), plazas/markets/groves,
  gate + far-ward + landmark zones, connectivity by construction
- Grim city flavor pools (Gallows Corner, Execution Square, ...)
- URL params ml/ms on both pages; legacy mw/mh parse and round-trip;
  scale-mode links serialize ms so regeneration replays jitter draws
  (map-history stubs likewise)
- Export pixels-per-grid auto-scales to the 4096px raster cap
- Fourth-wall note: third accepted grid-stream break; all hash pins
  re-recorded (env Any + exact dims pin proves legacy-mode continuity)

Closes #145
@Daren9m
Daren9m merged commit 8bac66e into main Jul 20, 2026
1 check passed
@Daren9m
Daren9m deleted the claude/map-layouts branch July 20, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maps: layout select, scale tiers, and the City Streets generator

1 participant