[PR #491] [MERGED] feat(pixelforge): settlements as populous as their rank #997

Closed
opened 2026-10-20 17:33:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/491
Author: @kolacheee
Created: 8/21/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @kolacheee

Base: staging ← Head: feat/pixelforge-room-zoning


📝 Commits (10+)

  • 24652ed fix(pixelforge): a thriving city inn is an inn, not a bunkhouse
  • bdcd5ce chore(pixelforge): open 0.10.0 and fold 0.9.1 into it
  • bedb949 test(pixelforge): instrument the harness before the partitioner moves
  • 15dd4c8 feat(pixelforge): zones carry open spans, and a band returns its leftover
  • 96effd2 feat(pixelforge): three guards that fire in a player's world, not just the harness
  • f673fd7 style(pixelforge): wrap the overflow throw prettier wanted wrapped
  • 8dc6926 feat(pixelforge): lay a street grid, and seal only what the ground can seat
  • a0ccfec feat(pixelforge): a settlement is as populous as its rank, not as its cast
  • 4bb4e03 feat(pixelforge): lay the grid straight, and give a settlement somewhere public
  • 88995f8 feat(pixelforge): size follows program, so a town stops being one house repeated

📊 Changes

12 files changed (+4352 additions, -391 deletions)

View changed files

➕ artifacts/pixelforge-0.10.0.zip (+0 -0)
📝 packages/pixelforge/client.js (+1149 -78)
📝 packages/pixelforge/docs/ROADMAP.md (+23 -13)
📝 packages/pixelforge/docs/brief-schema.md (+54 -19)
📝 packages/pixelforge/manifest.json (+3 -3)
📝 packages/pixelforge/src/10-art.js (+41 -3)
📝 packages/pixelforge/src/18-brief.js (+50 -13)
📝 packages/pixelforge/src/20-world.js (+1031 -56)
📝 packages/pixelforge/src/25-schedule.js (+14 -3)
📝 packages/pixelforge/src/30-sim.js (+12 -2)
📝 packages/pixelforge/test-brief.mjs (+1974 -200)
📝 scripts/build-pixelforge-package.mjs (+1 -1)

📄 Description

Linked issue

Closes #490

Pixelforge 0.10.0 — the density release.

Why this change

A Pixelforge city compiled to eighteen buildings and ten people on a 96x72 map,
whatever its brief said, and every rank looked like the same village at a
different zoom. Two causes: the sealed cast WAS the population (one house per
named household, then stop), and lots were laid on two hardcoded rows, so a
village offered six lots across 1320 tiles. Sparse maps were never a lot problem
— raising a cap would not have fixed them.

What changed

All inside packages/pixelforge (package pixelforge, 0.9.0 → 0.10.0;
client.js, manifest.json and the 0.10.0 artifact are rebuilt outputs).
The compiler grew a street-grid lot allocator, bigger maps, axis-derived
population with minted residents, and program-sized interiors with a hearth
in every dwelling; the paint contract now rides in checkWorld so every
harness case enforces it. Detail by layer:

The world

Lots are a street grid, centred on their span rather than marching from one
end, so the remainder is split into a margin at both ends instead of banked
against the eastern trees. Claimed nearest-the-crossroad first, so a settlement
that cannot fill its grid grows outward from its centre.

Maps are sized so the grid has somewhere to put a street: 28x20 / 48x28 /
60x40 / 76x52 / 104x72, for 4 / 8 / 16 / 36 / 80 lots.

Population follows the axes. Households per rank (3 / 6 / 12 / 24 / 45)
leaned by prosperity, clamped to the lots left after places, trades and market.
backgroundPopulation moves a settlement WITHIN its rank's band and can never
set the band — it is the brief's least constrained number, and the reservation
against letting it size geometry is honoured rather than deleted.

A rank seals only what it can seat, so an outpost stops promising four named
features it has no ground for and losing two in silence — and now says so in
repairs when it truncates.

Somewhere public. Lots nobody built on become kitchen gardens where a
settlement is loose and PARKS where it is dense, because a town does not have a
lawn around every door.

Size follows program. A house is sized by its household and a workplace by
its trade, so a town stops being one 6x4 box stamped out thirty times.

The interiors

A house is as big as its household. INTERIOR_DIMS gave every dwelling
fourteen columns, which fit two bedrooms, so a family of six fell past the
partitioner into the open plan — not because six people cannot have bedrooms but
because the shell they were handed had two. Capped at three bedrooms, so the ROOM
still absorbs the next body and the density rule stays live. A merged tenement
keeps the plain shell: a building holding five families IS a bunkhouse.

A hearth and a kitchen. The first two entries in the room vocabulary that are
neither a bed nor a surface. The kitchen is an open corner of the main room,
recorded as an area, because a cottage's kitchen is the main room.

A day has a shape. Dawn and dusk belong to the hearth. Measured on a thriving
village of 23: dawn 21 indoors, noon 22 out, dusk 20 indoors, night everyone in
bed. Before this, dawn and dusk were both post and the only thing a whole day
did was empty the houses at noon.

Measured

Thriving, three named cast, seeds 7/8/9:

rank souls doors
outpost 4 4 4 4 4 4
hamlet 4 4 4 6 7 7
village 24 25 27 15 15 15
town 60 59 69 30 31 31
city 124 116 134 54 55 55

With the mint disabled the same ladder reads 4 4 4 4 4.

Bugs fixed on the way

Compiler faults, all found and fixed inside this PR:

  • Residents homed at the wilds or their own church were counted as already
    housed, so the town came out one house smaller per person who needed no house.
  • A tree scatter can ring a tile completely, leaving grass the player can see and
    never reach. sealPockets closes them.
  • The harness read building ids by prefix, so h1 also matched h10 — free at
    nine households, a false failure at forty.
  • The west wilds could seal its own spawn (mine, caught by CodeRabbit).
  • Nothing checked that a placed tile has art. I added hearth, the painter
    patch missed its anchor, and the compiler placed an object no renderer could
    draw while the entire harness passed. The art module now exports what it can
    draw and the harness compares the two sets.

And five paint-contract faults, from an adversarial review of this branch

All five were live, and not one failed an assertion — invisible to geometry,
reachability and occupancy, and instantly visible to a player, because overhead
composites over actors. They share one shape: put() overwrites without asking,
and the newest painters are the first that cross ground another pass owns.

what measured fixed by
Roofline over the main street 41–99 road tiles per 10 seeds at struggling, 10 at thriving public ground recorded as rects, not inferred from the ground id
Roofline over a neighbour's doorstep 18 in 72 worlds the arriving building takes back the sky over its own step
Roofline over a neighbour's front wall 24 in 225 worlds same, for its own frontage
Trees you can walk through 8 in 120 worlds clearFootprint before the greens paint
Canopies hanging over nothing 38, two causes the clear reaches one row above the rect

Two were regressions of an earlier fix in this same PR: testing the GROUND for
path is true only at modest prosperity, and headroom() never knew about the
lot row eight tiles above it.

The contract now rides in checkWorld, so all ~200 existing cases enforce it
rather than one new case naming its own inputs — which is the kind of case that
missed these.

Test plan

  • node packages/pixelforge/test-brief.mjs passes
  • npx prettier --check and npx eslint clean on the touched sources
  • Manually walk a city and confirm the streets read as inhabited and the
    plaza busy rather than mobbed
  • Manually walk a village and confirm it no longer reads as grass between
    six houses
  • Manually check a cottage interior: bedroom door, kitchen counter, hearth
  • Manually watch a settlement at dawn, noon and dusk and confirm the rhythm
  • Confirm frame rate on the phone at a thriving city (~120 NPCs), or say
    so and the household table is one line to change

Not in this PR

City districts, per-trade workroom placement, and bath/water. Those continue on
this branch or follow it.

Summary by CodeRabbit

  • New Features
    • Increased settlement map sizes, building capacities, and housing flexibility.
    • Added deterministic residents, households, public areas, ward squares, and parks.
    • Added hearth visuals and hearth-based resident schedules.
    • Improved navigation, floor connectivity, and placement of features, lots, and furnishings.
    • Expanded settlement art with transparent wells and tables.
  • Bug Fixes
    • Prevented unreachable areas, room partition overflows, and invalid furnishing configurations.
  • Release
    • Updated Pixelforge to version 0.10.0.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/491 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/21/2026 **Status:** ✅ Merged **Merged:** 8/22/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/pixelforge-room-zoning` --- ### 📝 Commits (10+) - [`24652ed`](https://github.com/Pasta-Devs/Marinara-Agents/commit/24652edf6ea5c2b19317fcff40bf1b819467e17a) fix(pixelforge): a thriving city inn is an inn, not a bunkhouse - [`bdcd5ce`](https://github.com/Pasta-Devs/Marinara-Agents/commit/bdcd5ce535389d8e81fc1a1d50d3d5e3c30b5790) chore(pixelforge): open 0.10.0 and fold 0.9.1 into it - [`bedb949`](https://github.com/Pasta-Devs/Marinara-Agents/commit/bedb949825996d0d07656b8a783f26b04f348ba1) test(pixelforge): instrument the harness before the partitioner moves - [`15dd4c8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/15dd4c8ad35cd6f2ceaa3c17d45dc183441b35a6) feat(pixelforge): zones carry open spans, and a band returns its leftover - [`96effd2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/96effd2c24a92478de4c0f6ad1177daaded6ba16) feat(pixelforge): three guards that fire in a player's world, not just the harness - [`f673fd7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f673fd762162eb6412c2248ff17fdf860e41d498) style(pixelforge): wrap the overflow throw prettier wanted wrapped - [`8dc6926`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8dc6926cc2472a0cf0bd8f110b9ad020256c9100) feat(pixelforge): lay a street grid, and seal only what the ground can seat - [`a0ccfec`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a0ccfeccfc7efa384c61b6044d01487788e4b6f0) feat(pixelforge): a settlement is as populous as its rank, not as its cast - [`4bb4e03`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4bb4e038bade6d5c7f37ea9b5b1130df26e61707) feat(pixelforge): lay the grid straight, and give a settlement somewhere public - [`88995f8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/88995f88bdbcd66db5a87c4d6390d9db1050b4a5) feat(pixelforge): size follows program, so a town stops being one house repeated ### 📊 Changes **12 files changed** (+4352 additions, -391 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/pixelforge-0.10.0.zip` (+0 -0) 📝 `packages/pixelforge/client.js` (+1149 -78) 📝 `packages/pixelforge/docs/ROADMAP.md` (+23 -13) 📝 `packages/pixelforge/docs/brief-schema.md` (+54 -19) 📝 `packages/pixelforge/manifest.json` (+3 -3) 📝 `packages/pixelforge/src/10-art.js` (+41 -3) 📝 `packages/pixelforge/src/18-brief.js` (+50 -13) 📝 `packages/pixelforge/src/20-world.js` (+1031 -56) 📝 `packages/pixelforge/src/25-schedule.js` (+14 -3) 📝 `packages/pixelforge/src/30-sim.js` (+12 -2) 📝 `packages/pixelforge/test-brief.mjs` (+1974 -200) 📝 `scripts/build-pixelforge-package.mjs` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #490 Pixelforge 0.10.0 — the density release. ## Why this change A Pixelforge city compiled to eighteen buildings and ten people on a 96x72 map, whatever its brief said, and every rank looked like the same village at a different zoom. Two causes: the sealed cast WAS the population (one house per named household, then stop), and lots were laid on two hardcoded rows, so a village offered six lots across 1320 tiles. Sparse maps were never a lot problem — raising a cap would not have fixed them. ## What changed All inside `packages/pixelforge` (package `pixelforge`, 0.9.0 → 0.10.0; `client.js`, `manifest.json` and the 0.10.0 artifact are rebuilt outputs). The compiler grew a street-grid lot allocator, bigger maps, axis-derived population with minted residents, and program-sized interiors with a hearth in every dwelling; the paint contract now rides in `checkWorld` so every harness case enforces it. Detail by layer: ### The world **Lots are a street grid**, centred on their span rather than marching from one end, so the remainder is split into a margin at both ends instead of banked against the eastern trees. Claimed nearest-the-crossroad first, so a settlement that cannot fill its grid grows outward from its centre. **Maps are sized so the grid has somewhere to put a street**: 28x20 / 48x28 / 60x40 / 76x52 / 104x72, for 4 / 8 / 16 / 36 / 80 lots. **Population follows the axes.** Households per rank (3 / 6 / 12 / 24 / 45) leaned by prosperity, clamped to the lots left after places, trades and market. `backgroundPopulation` moves a settlement WITHIN its rank's band and can never set the band — it is the brief's least constrained number, and the reservation against letting it size geometry is honoured rather than deleted. **A rank seals only what it can seat**, so an outpost stops promising four named features it has no ground for and losing two in silence — and now says so in `repairs` when it truncates. **Somewhere public.** Lots nobody built on become kitchen gardens where a settlement is loose and PARKS where it is dense, because a town does not have a lawn around every door. **Size follows program.** A house is sized by its household and a workplace by its trade, so a town stops being one 6x4 box stamped out thirty times. ### The interiors **A house is as big as its household.** `INTERIOR_DIMS` gave every dwelling fourteen columns, which fit two bedrooms, so a family of six fell past the partitioner into the open plan — not because six people cannot have bedrooms but because the shell they were handed had two. Capped at three bedrooms, so the ROOM still absorbs the next body and the density rule stays live. A merged tenement keeps the plain shell: a building holding five families IS a bunkhouse. **A hearth and a kitchen.** The first two entries in the room vocabulary that are neither a bed nor a surface. The kitchen is an open corner of the main room, recorded as an area, because a cottage's kitchen is the main room. **A day has a shape.** Dawn and dusk belong to the hearth. Measured on a thriving village of 23: dawn 21 indoors, noon 22 out, dusk 20 indoors, night everyone in bed. Before this, dawn and dusk were both `post` and the only thing a whole day did was empty the houses at noon. ### Measured Thriving, three named cast, seeds 7/8/9: | rank | souls | doors | |---|---|---| | outpost | 4 4 4 | 4 4 4 | | hamlet | 4 4 4 | 6 7 7 | | village | 24 25 27 | 15 15 15 | | town | 60 59 69 | 30 31 31 | | city | 124 116 134 | 54 55 55 | With the mint disabled the same ladder reads `4 4 4 4 4`. ### Bugs fixed on the way Compiler faults, all found and fixed inside this PR: - Residents homed at the wilds or their own church were counted as already housed, so the town came out one house smaller per person who needed no house. - A tree scatter can ring a tile completely, leaving grass the player can see and never reach. `sealPockets` closes them. - The harness read building ids by prefix, so `h1` also matched `h10` — free at nine households, a false failure at forty. - The west wilds could seal its own spawn (mine, caught by CodeRabbit). - **Nothing checked that a placed tile has art.** I added `hearth`, the painter patch missed its anchor, and the compiler placed an object no renderer could draw while the entire harness passed. The art module now exports what it can draw and the harness compares the two sets. #### And five paint-contract faults, from an adversarial review of this branch All five were live, and **not one failed an assertion** — invisible to geometry, reachability and occupancy, and instantly visible to a player, because overhead composites over actors. They share one shape: `put()` overwrites without asking, and the newest painters are the first that cross ground another pass owns. | what | measured | fixed by | |---|---|---| | Roofline over the main street | 41–99 road tiles per 10 seeds at `struggling`, 10 at `thriving` | public ground recorded as **rects**, not inferred from the ground id | | Roofline over a neighbour's doorstep | 18 in 72 worlds | the arriving building takes back the sky over its own step | | Roofline over a neighbour's front wall | 24 in 225 worlds | same, for its own frontage | | Trees you can walk through | 8 in 120 worlds | `clearFootprint` before the greens paint | | Canopies hanging over nothing | 38, two causes | the clear reaches one row **above** the rect | Two were regressions of an earlier fix in this same PR: testing the GROUND for `path` is true only at `modest` prosperity, and `headroom()` never knew about the lot row eight tiles above it. The contract now rides in `checkWorld`, so all ~200 existing cases enforce it rather than one new case naming its own inputs — which is the kind of case that missed these. ## Test plan - [ ] `node packages/pixelforge/test-brief.mjs` passes - [ ] `npx prettier --check` and `npx eslint` clean on the touched sources - [ ] Manually walk a `city` and confirm the streets read as inhabited and the plaza busy rather than mobbed - [ ] Manually walk a `village` and confirm it no longer reads as grass between six houses - [ ] Manually check a cottage interior: bedroom door, kitchen counter, hearth - [ ] Manually watch a settlement at dawn, noon and dusk and confirm the rhythm - [ ] Confirm frame rate on the phone at a thriving `city` (~120 NPCs), or say so and the household table is one line to change ## Not in this PR City districts, per-trade workroom placement, and bath/water. Those continue on this branch or follow it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Increased settlement map sizes, building capacities, and housing flexibility. * Added deterministic residents, households, public areas, ward squares, and parks. * Added hearth visuals and hearth-based resident schedules. * Improved navigation, floor connectivity, and placement of features, lots, and furnishings. * Expanded settlement art with transparent wells and tables. * **Bug Fixes** * Prevented unreachable areas, room partition overflows, and invalid furnishing configurations. * **Release** * Updated Pixelforge to version 0.10.0. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-20 17:33:05 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#997
No description provided.