Cities grow around the structures on their ground #128

Owner

Tracker: #3607

Step 1 of #3558. Shared city growth takes the tiles that structures hold and never lays a plot, a street run or an avenue paving on them; the city keeps growing elsewhere.

  • growCity takes the held tiles and hands them to growStep and pave. openLand refuses a held tile, so plotsOf, traceRun and pave all skip it.
  • The server's advanceGrowth passes the footprints of its live structures, rising or finished (the pathfinder's fixed occupants). The stall on a mobile unit standing on a new plot stays.
  • Every other growCity caller passes none: founding in layoutCities, projectCity and replayCity, the towns bench, the mocks, the Cities Yard town and the tests. canPlaceCityBuilding, insertBuilding and the AI's cityLayouts are unchanged.
  • Placement still refuses city ground, so nothing a player meets changes yet; step 2 records the change in changelog.md and the help.

Tests:

  • grows a city 240 steps around a held 2×2 by its crossing, with no building, street or avenue paving on it: the harness town at seed 2, grown 30 steps, then 240 more. With nothing held, it lays a building, a street and two avenue tiles on the square; holding the square, it lays none and grows from 33 to 273 people. On main's growth it lays the same four tiles held or not.
  • grows a held city every CITY_GROW_SECONDS for 120 steps around a Factory on its open ground, laying nothing on the Factory's tiles: a Factory spawned at 53,54 on the owned seed-31 town, where unheld growth builds within 120 steps. On main the city stalls at grown 107 for its last 13 steps.
  • The replay tests (buildings.test.ts, cities.test.ts) hold unchanged.

Checks against main 672fc28:

  • npm run towns -- --json: the same 26 rows; the timing goes to stderr.
  • AI matches with Math.random seeded per match: small seeds 1–6 (2 seats), medium 1–4 (3 seats), large 1–4 (4 seats), each to its end. All 14 give the same think trace, end reason, winners and summary as main.
  • npm run bench battle, economy, cities and churn (128, wan, seed 11): frame, game and command hashes and every client row equal to main's.

Gates on c291482:

  • full runs 1 and 2 of the implementing run each passed build and npm test 841/841, and failed test:phone 64/65 only on the HUD 1280×720 layout test's 5000 ms timeout (bug #3419, failing on main too). src/client/hud.phone.ts run by itself passes 31/31.
  • The gate step's full failed npm test 833/841 on 5000 ms timeouts alone: hud-css's text contrast, hud-mock's scene loop (with the two assertions that follow it), two craft gunship-landing tests, collapses' no-scale test and wrecks' Medium shards test. That suite took 63.6 s. Run alone, each of those files passes in under 1.5 s.
  • full run 1 of the follow-up run passed: build, npm test 841/841 in 15.0 s, test:phone 65/65.
Tracker: [#3607](https://sak.swipelab.com/tasks/3607) Step 1 of #3558. Shared city growth takes the tiles that structures hold and never lays a plot, a street run or an avenue paving on them; the city keeps growing elsewhere. - `growCity` takes the held tiles and hands them to `growStep` and `pave`. `openLand` refuses a held tile, so `plotsOf`, `traceRun` and `pave` all skip it. - The server's `advanceGrowth` passes the footprints of its live structures, rising or finished (the pathfinder's fixed occupants). The stall on a mobile unit standing on a new plot stays. - Every other `growCity` caller passes none: founding in `layoutCities`, `projectCity` and `replayCity`, the towns bench, the mocks, the Cities Yard town and the tests. `canPlaceCityBuilding`, `insertBuilding` and the AI's `cityLayouts` are unchanged. - Placement still refuses city ground, so nothing a player meets changes yet; step 2 records the change in changelog.md and the help. Tests: - *grows a city 240 steps around a held 2×2 by its crossing, with no building, street or avenue paving on it*: the harness town at seed 2, grown 30 steps, then 240 more. With nothing held, it lays a building, a street and two avenue tiles on the square; holding the square, it lays none and grows from 33 to 273 people. On main's growth it lays the same four tiles held or not. - *grows a held city every CITY_GROW_SECONDS for 120 steps around a Factory on its open ground, laying nothing on the Factory's tiles*: a Factory spawned at 53,54 on the owned seed-31 town, where unheld growth builds within 120 steps. On main the city stalls at `grown` 107 for its last 13 steps. - The replay tests (buildings.test.ts, cities.test.ts) hold unchanged. Checks against main 672fc28: - `npm run towns -- --json`: the same 26 rows; the timing goes to stderr. - AI matches with `Math.random` seeded per match: small seeds 1–6 (2 seats), medium 1–4 (3 seats), large 1–4 (4 seats), each to its end. All 14 give the same think trace, end reason, winners and summary as main. - `npm run bench` battle, economy, cities and churn (128, wan, seed 11): frame, game and command hashes and every client row equal to main's. Gates on c291482: - `full` runs 1 and 2 of the implementing run each passed build and `npm test` 841/841, and failed `test:phone` 64/65 only on the HUD 1280×720 layout test's 5000 ms timeout (bug #3419, failing on main too). `src/client/hud.phone.ts` run by itself passes 31/31. - The gate step's `full` failed `npm test` 833/841 on 5000 ms timeouts alone: hud-css's text contrast, hud-mock's scene loop (with the two assertions that follow it), two craft gunship-landing tests, collapses' no-scale test and wrecks' Medium shards test. That suite took 63.6 s. Run alone, each of those files passes in under 1.5 s. - `full` run 1 of the follow-up run passed: build, `npm test` 841/841 in 15.0 s, `test:phone` 65/65.
agra merged commit 5da81ccf89 into task/3558-build-inside-the-city-and-a-flat-map 2026-10-22 03:56:08 +03:00
Sign in to join this conversation.
No reviewers
No labels
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
agra/mini-alert!128
No description provided.