HOW WANDER IS BUILT · LAYER 2 OF 7
The landscape laws and the world table.
A world is a law and a table of knobs. The law says what a column's rank does to the ground: hills (a smoothstep mound, radius doubling with the rank), a lattice (hills in two directions), a ladder (walls at ladder heights), plateaus (nested flats from the distance to the nearest ranked column), Walsh mesas, Gaussian isles, dunes cut with a fluid's profile, Sudoku mesas, Legendre marches, synth terraces. The table says which law, its knobs, the base height, the water line, the top, the snow line, and whether rivers cut it. In Wander the table is DEFS in worlds.js, 82 worlds; in the kit it is SITerrain.WORLDS for the fourteen ruler-land ranges and SIWander.DEFS for all of them. The older ranges (the Great Range, the Dunes, the Long Range) use the epic law instead: buildRidge at a mountain's scale, one ridge per line of the table, an amplitude, a crest that meanders, and a flank that widens with height.
const T = SITerrain; // terrain.js, after rangeblends.js and rulerland.js
const world = T.WORLDS["ruler-hills"]; // {kind: "hills", base: 28, water: 22, top: 260, args: {spread: 40, kmax: 9, radius: 3, kmin: 4}, rivers: true}
for (const x of [0, 959, 1791, 2047, 4095]) console.log(x, "law", T.land(world, T.G0 + x, 0).toFixed(1), "ground", T.height("ruler-hills", x, 0));
const mine = {kind: "plateau", base: 22, water: 18, top: 130, args: {unit: 12, unitz: 6, c: 0.25, kmax: 9, kmin: 7, ramp: 6}}; // a world of your own: same laws, your knobs
console.log("my ziggurat at 4095:", T.height(mine, 4095, 0));
const W = SIWander || WanderWorlds; // the full table, Wander's own
console.log(Object.keys(W.DEFS).length, "worlds;", W.DEFS.rulerhills.law.land, W.DEFS.epic.law.ridges.length, "ridges in the Great Range");The showcase draws every law twice (Python and JavaScript) and compares the pixels: maps.html. Cards: terrain.md, rulerland.md. The knobs are the same words in both languages, by name in Python and by position in JavaScript.
← A number is a column A window is a chunk →
How Wander is built · by Lars Rocha · every layer stands on a law in sitoolz, written twice and checked against one fixture.