auto sync
This commit is contained in:
+15
-11
@@ -1,24 +1,28 @@
|
||||
---
|
||||
name: mapwright-module
|
||||
description: Mapwright — new standalone Foundry v13 battle-map generator module being built from scratch
|
||||
description: Mapwright — standalone Foundry v14 battle-map generator; published on GitHub (slaguru666/mapwright)
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: project
|
||||
originSessionId: 876e6f57-7721-4a19-83bd-1400e94b8c64
|
||||
---
|
||||
|
||||
Building `mapwright`, a standalone Foundry VTT v13 module at `~/FoundryVTT/Data/modules/mapwright/` that auto-generates tactical battle maps with Foundry walls/doors/windows/lighting pre-placed. Fresh rebuild — replaces the underwhelming `quick-battlemap-builder` and the sprawling `scifi-deckplan-generator` (7k lines, 37+ options, programmer-art SVG).
|
||||
`mapwright` — standalone Foundry VTT battle-map generator at `~/FoundryVTT/Data/modules/mapwright/`. Auto-generates good-looking tactical maps with Foundry walls/doors/windows/lighting pre-placed. Fresh rebuild replacing the underwhelming `quick-battlemap-builder` / sprawling `scifi-deckplan-generator`.
|
||||
|
||||
**Decisions made with Tim (2026-06-16):**
|
||||
- Visual approach: **procedural-vector** (Watabou-style ink look drawn in code), NOT compositing real tile art. Open to bundling a small curated art pack later.
|
||||
- First milestone: **indoor buildings (modern + fantasy)** done excellently before other categories.
|
||||
- Population: **system-agnostic** — labelled GM Notes + prop tiles only; never assume a game system/compendium.
|
||||
- Distribution: self-contained, OK to bundle a curated art pack.
|
||||
**PUBLISHED (2026-06-17, v0.5.0):** GitHub repo `https://github.com/slaguru666/mapwright` (public). Install in Foundry via manifest URL: `https://github.com/slaguru666/mapwright/releases/latest/download/module.json`. Releases via `gh` CLI (auth'd as slaguru666) — GitHub MCP has no release tool, so use gh for releases. Release assets: `module.json` + `mapwright.zip` (clean module files, no dev/). To ship a new version: bump module.json version → zip `module.json module templates styles lang README.md` → `gh release create vX.Y.Z module.json mapwright.zip`. `.gitignore` excludes dev/*.svg|png|jpeg|html.
|
||||
|
||||
**Core architectural principle:** one geometry model feeds BOTH the SVG picture and the Foundry walls, so visible walls always line up with sight-blocking walls (the thing both old modules got wrong). Pipeline: `building.mjs` (BSP → rooms+region grid) → `walls.mjs` (segments + spanning-tree door connectivity) → `render-vector.mjs` (SVG) + `scene.mjs` (Foundry docs). `lib/*` is pure/Node-testable; validate visuals with `node dev/render-sample.mjs` then `qlmanage` to PNG.
|
||||
**Live Foundry is v14.361** (world SLA_Industries, system zero-engine). Can log into the GM session via Playwright (Gamemaster user, no password, localhost:30000) to test live. Module is ENABLED there.
|
||||
|
||||
**Live Foundry is v14.361** (not v13) — world SLA_Industries, system zero-engine. Module declares max 14, verified bumped to 14.361. Hardened FilePicker call to use `foundry.applications.apps.FilePicker.implementation` with global fallback (v14 namespacing). Scene-control toolbar button may need v14 tweaks; reliable entry points are `game.mapwright.open()` console + Scenes-tab button.
|
||||
**Core principle:** one geometry model feeds BOTH the picture and the Foundry walls. Pipeline per category: generate layout → wall segments → SVG (preview + scene background PNG) + Foundry walls/doors/lights/notes/tiles.
|
||||
|
||||
v0.3 status (draft 3, built this session): expanded buildings per Tim's feedback (rectangular was too plain). NEW: (1) non-rectangular footprints — buildFootprintMask() in building.mjs supports rectangle/L/T/U/plus; BSP splits bbox then clips rooms to mask via region grid, so exterior walls follow the non-rect outline for free. (2) Multi-floor — generateBuildingComplex() makes 1–4 floors sharing ONE footprint (maskSeed constant) with a vertical-circulation column (elevator=modern, stairs=fantasy) forced at the same cell on every floor; createSceneSet() in scene.mjs makes a Folder of linked scenes + up/down GM notes. (3) Era-aware door/window ARTWORK in render-vector.mjs — filled door leaves (planked wood / metal-slab glass), handles, swing arcs; framed mullioned windows. doorFill added to THEMES. (4) furniture.mjs — vector props per room type (bed/desk/bigtable/racks/counter/crates/shelf/toilet/bunk + stairwell/elevator glyph). render-vector now builds floor + hatching from the REGION grid (buildFloorPath) not the footprint rect. All verified visually (L/U/plus shapes, furniture, era doors, multi-floor staircase) + multi-floor consistency test (identical mask + aligned circ across floors). All JS syntax-checked. STILL not tested inside running Foundry (v14.361). Earlier engines unchanged: caves (organic.mjs), outdoor (outdoor.mjs). Next: prop/furniture as interactive Tiles, built-dungeon rooms+corridors style, water/elevation in caves, UVTT export.
|
||||
**Categories (6):** Modern Building, Fantasy Building (BSP, footprint shapes rect/L/T/U/plus + "auto" random, multi-floor 1-4 with stairs/elevator, era-aware door/window art, furniture as LOCKED TILES); Cave/Dungeon (organic CA, themes cave/crypt/sewer); Outdoors (grassland/desert/snow/badlands); Town/Village + City Block (solid rooftop blocks + perimeter walls, dense + colourful + lots of baked scenery: cars/trees/lamps/crosswalks/wells/stalls).
|
||||
|
||||
Reference module to study: **Dungeon Draw** (mcglincy) — themed bg + auto-walls from one geometry. Consider UVTT export for ecosystem interop.
|
||||
**KEY v14 GOTCHAS (hard-won):**
|
||||
- Scene background moved to LEVELS: set `scene.updateEmbeddedDocuments("Level",[{_id, background:{src,color}}])` on the default level (`defaultLevel0000`), NOT the deprecated `scene.background`. See `applyBackground()` in scene.mjs.
|
||||
- FilePicker is `foundry.applications.apps.FilePicker.implementation`; normalise upload paths to relative.
|
||||
- Tiles use `texture.src` (not `img`); furniture tiles are `locked:true`, generated sprites cached in `mapwright/furniture/`.
|
||||
- Default scenes: tokenVision:false (flat fully-lit map = matches preview); dynamic lighting opt-in.
|
||||
|
||||
**File map:** lib/{rng,building,walls,render-vector,furniture,furniture-layout,organic,dungeon,render-cave,outdoor,render-outdoor,settlement,render-settlement,population,scene}.mjs; app/generator-app.mjs; mapwright.mjs (entry). Pure libs are Node-testable via dev/*.mjs harnesses (render → qlmanage to PNG to eyeball).
|
||||
|
||||
**Next ideas:** enterable hero buildings; more biomes; moving-traffic city look; village cobble plaza.
|
||||
|
||||
Reference in New Issue
Block a user