A place you can
write down.
One versioned integer recipe becomes a mountain, its architecture and its moving light. This is a small, renderer-independent addition to Lars Rocha’s sitoolz library.
Try this
- Start with Ember. Drag the mountain to orbit; scroll or pinch to approach.
- Move the square / XOR mask. Watch the ledges, the selection of lots and the windows change together.
- Switch to Night. Pause the light and move the tick: the same address always gives the same intensity.
- Choose Blueprint to read the terraces. Click the mountain or its map to inspect a square address, ruler rank and sieve decision.
- Use Settlement to approach the houses. Explore enables a free camera: WASD or arrow keys, Q/E down/up, Shift for speed. Touch users can orbit and pinch.
- Share place saves the recipe and view in a link or a Hamlet code PNG. Load recipe reopens a downloaded JSON or place-code PNG. Capture saves an ordinary picture.
Walk inside the mountain
Open the interior district → There are 17 named spaces to explore: a cliff house, rooms and stairs, a bridge, courtyard galleries, a mountain passage and a skylit lantern chamber. Use WASD or arrows and drag to look; phones have a movement pad. Take a guided walk follows the same supported walking controller. Press E, or tap the lantern button, near the goal.
District and Cutaway reveal the layout. The floor plan switches between entrance and gallery levels. Changing the recipe changes chamber dimensions, windows, niches and constrained lamp patterns while preserving a connected route. This first bounded grammar is a small architecture experiment; the exterior playground's other lots remain visual models.
Solids and air come from ordered integer boxes and material intervals. The visible walls, ceilings, stairs and collision use the same field. A body's position is an integer number of 1/256 units. Walking allows one-unit steps and guards unsupported ledges; there is no jump/fall simulation. The cutaway is a viewing aid, disabled while walking.
Explore the indexed atlas
Open the atlas and dataframes → Nine tiles show one moving window into a larger integer world. Type a signed patch coordinate, try Beyond 2⁵³, jump by ruler rank or widen the view by powers of two. Your selected address stays exact. Neighbouring patches share an identical edge record, including terrain samples and a proposed passage.
The data view makes the rules visible: square indices, roots and remainders, ruler bars, mod-3/mod-5 residues and sieve decisions. Select a row to visit its patch; export CSV to inspect the same data elsewhere. A second table examines squares XOR 5 or 25 as signed arithmetic changes. In Python, atlas.frame and atlas.square_xor_frame return pandas dataframes or the kit's lightweight Frame.
from sitoolz_foundry import atlas
print(atlas.frame({}, "-8", "0"))
print(atlas.square_xor_frame(0, 17, mask=25))The identity (s XOR m) − s = m − 2 × (s AND m) explains the signed changes. With s = n², mask 5 yields +5, +3 or −3; mask 25 yields +25, +23, +7, −7, −9 or −25. This is an exact residue pattern, separate from the terrain experiment.
Save or share from the atlas to retain its versioned recipe, patch, local cell and view level. The atlas is a map and rule inspector. Its first east/west crossing now opens two walkable wayhouses; forest grammars, arbitrary edits and streamed 3-D meshes remain future increments. More rendering detail will use the same addresses.
Walk across the atlas seam
Open the first crossing → Two wayhouses, two stairs and one bridge are generated from the same shared atlas edge. Explore nine spaces, or take a guided walk from the west ruler study to the eastern archive lantern. The structure dataframe shows each required room and optional shelf, with its owner index, ruler rank, bounds and sieve outcome.
Both the crossing and original interior district automatically use a basic Canvas 2D block view when WebGL is unavailable. Try the basic crossing → Walking, collision and saved positions use the same integer field in both views. The basic renderer trades visual detail for a small CPU raycast; it needs JavaScript and Canvas 2D.
This is the first reserved edge structure. Joining many such scenes, streaming them and saving arbitrary world edits remain later steps.
The arithmetic
| Tool | What it does here |
|---|---|
| Square split | n = q² + r gives a square shell and the offset along it. Square-XOR remainders add the smaller ledges and select building details. |
| Ruler | The number of factors of two sets local rank. The same ranks choose ledge cuts, building floors and clock speeds. |
| Stripe / sieve | A residue test keeps or drops candidates. A dropped terrain band can become a fissure; a dropped lot remains empty. Lot IDs stay tied to the original candidates. |
| Rule 90 | Binomial parity reads a single-seed cellular automaton directly. The light mixes a bounded part of that diagram with ruler clocks. |
| Rule 30 | A seeded 64-cell ring evolves by left XOR (self OR right). The light plays its first 128 states, then deliberately restarts. |
The broad mountain envelope uses an integer square root of squared distance. The fine ledges, cuts, settlement and light share the square/ruler field. Camera transforms, shading and interpolation use floating point; the library’s sampled values are integers.
Use the library
The standalone packages are sitoolz-foundry for Python and @sitoolz/foundry for Node. The full kit also exports sitoolz.foundry. In a browser, load foundry.js for the SIFoundry global.
import sitoolz_foundry as foundry
recipe = foundry.recipe({"seed": "ember", "mask": 5})
stone = foundry.sample(recipe, 24, -32, tick=17)
lots = foundry.settlement(recipe)
code = foundry.encode(recipe)
assert foundry.decode(code) == recipe
const foundry = require("@sitoolz/foundry");
const recipe = foundry.recipe({ seed: "ember", mask: 5 });
const stone = foundry.sample(recipe, 24, -32, 17);
const lots = foundry.settlement(recipe);
const lights = foundry.lightRow(recipe, 17);
Coordinates are integers from −65,536 to 65,536. A window samples at most 256 × 256 cells. Tick queries run from 0 to 4,095; the visual light loop is explicitly 128 ticks. A recipe has a version, an ASCII seed, bounded parameters and named laws. Unknown fields or versions are rejected.
Use the interior library
from sitoolz_foundry import habitat world = habitat.World(recipe) spans = world.column(65, -25) position = world.move(world.plan["spawn"], 0, -256) room = world.locate(position)
const habitat = require("@sitoolz/foundry/habitat");
const world = new habitat.World(recipe);
const position = world.move(world.plan.spawn, 0, -256);The standalone Python and Node distributions are version 0.2.0. The full kit also exposes sitoolz.habitat; browsers load foundry.js then habitat.js for SIHabitat. The same data-only plan can feed another renderer or an AI/SI inspector.
A portable place
A recipe code starts with SF1:. A shared place also includes the view and tick. The existing sitoolz Hamlet system puts that compact payload into a recoverable picture. Hamlet is its own place-code format; use this page’s loader for the downloaded PNG. A screenshot of the mountain is a photo, not a place code.
A local preview link points to the local machine. A link copied from your deployed site points to that site. Recipe JSON and Hamlet PNG files travel independently of the host. This release shares generated recipes and views; it does not yet save edited buildings or simulation histories.
Interior place codes use RFH1: and retain the supported player position, camera, tick, visited rooms and lantern state. Save or share from the interior page, then use its Load place button to restore JSON or Hamlet PNG files. Original exterior place codes remain supported by the mountain page.
What comes next
Larger building grammars, integration of interiors into more exterior lots, operator-power experiments, integer dynamics, and further tools for AI/SI to inspect and propose repeatable changes. The four studies already provide small reusable library interfaces and places to explore.