HOW WANDER IS BUILT · LAYER 6 OF 7
Settlements, stamps, Sudoku towns, lanterns and edits.
People stand where the arithmetic puts them. On the ruler-land worlds the city law places a settlement at every column where 2^k divides g+1, ranked by k, hamlet to metropolis, and its plan (districts, streets, the tallest block) is a formula of g. On the older ranges, sites are sampled every 64 columns, scored for flat, dry, watered ground, kept 160 cells apart, and sized by the ruler rhythm along the range. A settlement is a stamp: a list of blocks bottom to top, made of smaller stamps (a hut, a hall, a well, a tree), each part levelled on its own terrace. A Sudoku town is a solved grid read as a plan: nine by nine lots, the digit saying what stands there, so every street and every quarter has one of each. Names come from the seed and the column, two syllables and an ending. Six lanterns per world carry facts measured from the field itself. And what you build travels as one string: one token per edit, base 36, replayed in order.
const inst = W.open("rulercity", {}), C = CityLaw;
const sites = W.regionSettlements(inst, -2); // the home region: {x, z, g, rank, kind, name, plan, plateau, score}
for (const s of sites.slice(0, 5)) console.log(s.name, s.kind, "rank", s.rank, "at column", s.g, "plan", s.plan.n + "x" + s.plan.n);
console.log("the stamp strip:", Object.keys(W.STAMPS).length, "stamps; a castle is", W.stampCells("castle", 0).length, "blocks");
console.log("Sudoku Town lots:", W.sudokuLots(W.sudokuTown(1)).slice(0, 9).join(", "));
console.log(W.nameFor(inst.key, 2600959, "village"), "|", W.nameFor(inst.key, 2600959, "bridge"));
for (const l of W.lanterns(inst)) console.log(l.title, "at", l.x, l.z, "-", l.fact.slice(0, 80) + "...");
const built = W.open("build", {edits: "5.7.3_5.7.3_6.7.-_6.8.5"}); // two rock blocks at (5,7), a dig at (6,7), a plank at (6,8)
console.log(built.edits.length, "edits ->", built.body());The people are the kit's own engines: cards/citylaw.md, places.md (the stamps and the railway), puzzles.md (the towns). The Python port keeps the stamps, names and edits in sitoolz/wander/people.py, checked against the fixture stamp for stamp.
← A mesh is a view A world has rules →
How Wander is built · by Lars Rocha · every layer stands on a law in sitoolz, written twice and checked against one fixture.