Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build/notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
// and once after an update ("What's new"). A PR adds its entry under the number it expects; the merge queue (tools/queue.mjs)
// gives it the number it really gets and writes this file.
export const NOTES = {
486: {
ru: ["🌍 Одна земля для всех: высоту, на которой стоит нога, лапа или колесо, теперь находит один модуль. Раньше её искали 11 модулей, каждый по-своему, и ещё 18 циклов шли вниз по колонке блоков вручную: один знал наклон пандуса, другой нет, один проваливался сквозь воду, другой вставал на неё",
"🛣️ Что видно: перевернувшаяся машина лежит на наклонной поверхности пандуса, а не на клетке под ним; полицейская машина и грузовик ремонтников, появляясь под настилом моста, встают на настил, а не внутрь него (как уже умело такси); самолёт и машина вдали больше не считают траву и колосья полом",
"🧪 Новый тест ground.test: смысл на колонках, собранных вручную (ступень, стена, яма, брод, пандус, пещера под холмом, плита без места под ней), и 60 000 случайных колонок, где новый модуль обязан ответить так же, как прежние искатели, сохранённые в тесте дословно",
"🔎 Мест, где одно и то же сделано по-разному, стало 45 вместо 67. Счётчик циклов по колонке стал строже и нашёл ещё 7, которых раньше не видел: они следующие"],
en: ["🌍 One ground for everybody: the height a foot, a paw or a wheel stands on is now found by one module. Eleven modules used to look for it, each in its own way, and eighteen more loops walked down a column of blocks by hand: one knew the slope of a ramp and the next did not, one fell through water and the next stood on it",
"🛣️ What shows: a car that rolled over lies on the sloped top of a ramp, not on the cell under it; a police car and a builders' truck that appear under a bridge deck stand on the deck, not inside it (as the taxi already did); a plane and a car far away no longer take grass and crops for a floor",
"🧪 A new test, ground.test: the meaning on columns built by hand (a step, a wall, a pit, a ford, a ramp, a cave under a hill, a slab with no room under it), and 60,000 random columns where the new module must answer as the old finders did, kept in the test word for word",
"🔎 The places where one thing is done in different ways are down to 45 from 67. The counter of column loops got stricter and found 7 more it had not seen: they are next"],
},
485: {
ru: ["🚪 Такси открывает ту дверь, через которую ты садишься: тебе даётся свободное заднее место с твоей стороны, а вход и выход идут через проём двери этого места, а не сквозь кузов. Это общее правило для всех: жители у своих машин, полицейские и строители тоже садятся и выходят через дверь своего места, и она открывается",
"🧩 Всё, что движется, теперь в одном реестре: у каждого тела одна физика и один агент, а особая работа такси, полиции и ремонтников идёт задачей поверх общего агента, без обхода правил. Что ещё идёт в обход, записано с тредом-владельцем, и тест-храповик не даёт этому расти",
Expand Down
24 changes: 22 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The layers of `src/game`, bottom up:
| `30–39` | **The world generator**: blocks, terrain, land streaming, flora, settlements, roads, bridges, tunnels, rail, architecture, cultures, town plans, airports, squares | `31_terrain`, `32_land` (LodPool workers), `34_settle`, `35_roads`, `36_arch`, `37_urban`, `38_air` |
| `40–50` | The house and its lot: house and villa plans, furniture, shops, venues, building interiors, the start-screen model | `40_house`, `41_villa`, `45_furnish`, `49_dwell` |
| `59–69` | Catalog, item models, edit history, the quality controller | `60_lib`, `62_items`, `68_hist`, `69_quality` |
| `70–71` | The player and the shared core of the living world: walking/building, the Ent store, Lock, navigation, simulation radius | `70_walk`, `71_ent`, `71_lock`, `71_nav`, `71_sim` |
| `70–71` | The player and the shared core of the living world: walking/building, the Ent store, Lock, the ground, navigation, simulation radius | `70_walk`, `71_ent`, `71_lock`, `71_ground`, `71_nav`, `71_sim` |
| `72–79` | **Living systems**, each its own rule set: animals, water life, drivers and vehicle classes, maps, street life, saves, seed, gestures, neighbours, VR, gravity, ferry, flood, townsfolk, planes, crashes, driving, sitting, events, fire, repairs, jets, lava, police, characters, taxi, trains, volcanoes… | `73_pilot`, `74_town`, `76_life`, `77_folk`, `78_drive`, `79_*` |
| `80–83` | Catalog UI, multiplayer, voice, friends | `81_net`, `82_voice`, `83_pals` |
| `90–99` | Start screen, the main loop | `90_ui_start`, `99_main` (`window.G`: the debug handle every test uses) |
Expand Down Expand Up @@ -68,6 +68,10 @@ The layers of `src/game`, bottom up:

- **Each feature adds `tools/<feature>.test.mjs`.** The runner `tools/test.mjs` discovers it by name; there is nothing to register.
- Node tests (no browser) are preferred for generators and rules: load the code in a `vm` like `tools/gen/load.mjs` or `tools/city.mjs`.
- A node test that loads game files by a list of its own keeps a copy of what those files need, and the copy rots without a word
(build 485: `10_vox.js` began to read a constant of `09_core.js`, and four tests that listed the one without the other threw
before their first check, on main, unseen). `tools/srclist.test.mjs` reads every such list in `tools/` and fails when a listed
file needs at load time a name that no listed file declares and the test does not stand in for.
- Browser tests use puppeteer on the built `index.html`; import `./chrome.mjs` before puppeteer. Wait for frames or for state, never
for fixed sleeps (cloud machines draw at ~1 fps).
- Split a test over ~5 minutes into pieces: `// @parts VAR=a,b,c` in its first lines (one CI job per piece).
Expand Down Expand Up @@ -193,9 +197,25 @@ General rules that come out of Anton's remarks and measurements. Each names the
of a drive), police officers and builders all use it; what differs is only who decides when. A taxi gives the free back seat nearest
the player, so the door that opens is the one on their side. `tools/board.test.mjs` checks the geometry, the door and the taxi seat on
a car turned four ways, and that no file takes a person out of a vehicle without it.
- **The ground is asked in one place: `Ground` (`71_ground.js`).** The height a foot, a paw or a wheel stands on is found by
`Ground.at(x, z, y, o)` and nowhere else; no module walks down a column of blocks by itself. Who asks says what it needs as data, never
as code: `GROUND.walk` (a floor within a step or two, or the bottom of a pit; the default), `GROUND.fall`, `GROUND.roll`, `GROUND.fly`,
`GROUND.hover` give how far up a floor still counts, how deep the search goes and what water is (waded, fallen into, passed, stood
on). Around it: `Ground.drop` and `Ground.top` answer in whole cells (where an animal or a nest is put), `Ground.land` is the
generator's answer where no blocks are made yet, `Ground.under` and `Ground.road` join the two for what comes from afar (a plane, a
police car that drives into view), and `Ground.cell / roof / room` are the kernel in whole cells for the searches that walk thousands
of columns (`Nav`, the walking grid of a lot, a driver's look ahead). So a rule about the ground is written once and holds for
everybody: the sloped top of a road ramp, no digging through a hill for the cave under it, a vehicle that is put somewhere never
under a slab with no room. A new body that stands on something adds a row to `GROUND` at most. `tools/ground.test.mjs` checks the
meaning on columns built by hand and asks the finders that were folded in, kept in the test as they were written, the same questions on
60 000 random columns: a refactor of the ground may not change an answer by accident.
- **The inventory is a test.** `tools/split.test.mjs` lists every second way still in the code by concept (`--list` prints it) and counts
inline ones (loops that scan a column down for the ground, places that integrate gravity). Their numbers live in
inline ones (loops that walk down a column of blocks, places that integrate gravity). Their numbers live in
`tools/rules/ratchet.json` (`split.*`) and may only go down: fold a second way into the shared one, delete its entry, lower the number.
A way that was folded in is listed as `gone` and may not come back under its old name; the file of the shared way is the only one a
detector does not count. Nor may a test or a screenshot recipe still call it: they reach the game through `G` and short names of its
modules (`const T = G.Town`), which no check of the game's own source sees, so the same test reads every file of `tools/` for a call
of a `gone` function under any such name.

### Light

Expand Down
2 changes: 1 addition & 1 deletion docs/WASM_SPIKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Tools: `tools/wasm/town.prof.mjs` (CPU of the walk's frames without drawing: a t
| Near chunks (greedy + AO) | already Rust (v167) and in a worker (v273): main thread 0.1 ms a frame on a fast ride | done |
| Rust writes the 16-byte QMesh records itself (no `packQuads`) | same bytes on 1000 real chunks; 80 µs → 74 µs a chunk in the worker (7–10 %) | not merged |
| A cache of 256 columns in front of `Land.col` | `lastCol` already answers 97 % of lookups: `solid` 20 ns, `get` 10 ns a query; the cache was slower | not merged |
| Vehicle voxel physics (`worldFree`, `buried`, `Town.ground`, `shove`) in WASM | 0.2 ms a frame in a still town, 0.6 ms with 40 cars, 1 ms on a taxi ride with 8 moving (about 0.1 ms per moving vehicle); `Town.ground` 0.4 µs a call | not worth it: the queries need the voxels in JS, a whole-kernel port saves < 0.5 ms a frame |
| Vehicle voxel physics (`worldFree`, `buried`, `Ground.at`, `shove`) in WASM | 0.2 ms a frame in a still town, 0.6 ms with 40 cars, 1 ms on a taxi ride with 8 moving (about 0.1 ms per moving vehicle); `Town.ground` 0.4 µs a call | not worth it: the queries need the voxels in JS, a whole-kernel port saves < 0.5 ms a frame |
| **Item models (cars, people, catalog) in Rust: `mesh_box`** | same quads for 1121 items, 300 car looks, 96 people; mesher **2.58× in V8, 1.59× in JSC**; a car model when it first drives in: **14.3 → 9.2 ms (−35 %)** on the main thread | **merged** |

Costs of the merge: `homy_core.wasm` +3.6 KB (bundle +4 KB gzip), a scratch block in the core's memory that grows to the biggest model
Expand Down
Loading
Loading