Content pipeline — ground files, the loader, presets, and the six painted Areas
ground-types/005 · created 2026-08-17 · updated 2026-08-18
What to do
Get real ground into the authored Areas through the same reviewable-file path the world map uses.
- New
game/director/src/groundContent.ts: zod schema for the ground file (format ingame/README.md, from task 001),parseRows/formatRows, andvalidateGround(area, portals, ground)— dimensions equal the world file’s, values 1..64, passable at (1,1), the hubentryCell, every portal from/to cell (a two-way portal’s return leg included) and the home landing cell; 8-way reachability from (1,1) and the entry cell to every portal cell usingmovement.gd’s corner rule. Errors, not warnings. worldContent.ts loadWorldContent(pool, content, { ground })→setAreaGround;loadWorldCli.tsreads siblingareas/<slug>.ground.jsonfiles; a missing file leaves the database as it is. The loader is strict on dimensions — cropping / padding is the editor’s job.groundPaint.tspresets:river(seed)— a winding line of Water through the middle plus sprinkled grass — for the Village of Lor; a deterministic, hand-laid Badlands — patches of all eight types: a Mountain cluster with a peak core, a volcano, a lava pool, deep water, snow, sand, a Heaven-tiled plaza around the portals — keeping (1,1), (0,0), (2,4), (58,31) and the portal cells passable and reachable (deterministic beats random: reviewable, no re-rolls);sprinklefor the other four.- New CLI
npm run paint-ground -- <slug> --preset plain|sprinkle|river|badlands [--seed N](src/paintGroundCli.ts) writes the file. Commit the six files undergame/content/areas/;load-worldapplies them locally.
Definition of done
- Tests: the six committed files validate; loader round-trip; the validator rejects a mountain under a portal and an unreachable portal.
- Local game: the Village shows sprinkled grass and a river; the Badlands shows every type.
- Committed and pushed in
land-of-lor.
Where the work lands
land-of-lor/game/director/, game/content/areas/.
What was done (2026-08-17, laptop session)
director/src/groundContent.ts: file schema,parseRows/formatRows/makeGroundContent,protectedCells,reachableFrom(8-way with the corner rule),validateGround,resizeGround,readGroundFiles.loadWorldContent(…, { ground })validates the files with the graph before writing and applies them afterensureAreaGround;loadWorldClireadsareas/*.ground.jsonbeside the world file.groundPaint.tspresetsriver/paintVillage/paintBadlands(hand-laid) +rect/ellipse; newnpm run paint-ground. The six files undergame/content/areas/committed (Village: sprinkled grass + river; Badlands: every type incl. a peak-cored range and a volcano; the other four sprinkled). Rendered and eyeballed via_shots.gd.- Tests:
test/groundContent.test.ts(10) — codec, each refusal, the corner rule, resize, the six files validate against the world file, presets deterministic, load round-trip and refusal before write;loadWorldContent.test.tsstill green.
View source in repository · also available as raw markdown.