Natura -- a pocket-universe framework of composable natural systems
A framework for simulating any force of the natural world, at any scale, composed together or run
alone -- "from the branching of rime on a leaf in a storm to the battle of two moose in a forest to
the slow cooling of a sun over billions of years" (operator, 2026-08-02). The dynamic-simulation
sibling to the static world(seed) spine; the Terrain Engine's composable-pipeline ethos generalized
to all of nature across all scales.
The docs (read in this order)
DESIGN.md-- the architecture: the scale ladder (cosmic->micro), the system interface, the one clock, the coupling model, composability, bigger-than-island worlds, the build plan, the discipline.ONTOLOGY.md-- the CONTENT: the operator's hand-drawn sim.png reviewed + expanded into a full taxonomy of entities (nouns), processes (verbs), and interactions (couplings).SYSTEMS.md-- the detailed per-system designs (state, algorithm, fields in/out, params, build-on, status) + Part I the coupling model (the field-wiring graph + the feedback loops).SCENARIOS.md-- the framework ALIVE: real phenomena traced system-by-system, field-by-field (the three poles + the everyday loops). The acceptance criteria for "it's alive."ALGORITHMS.md-- the implementable equations + the design decisions + the hard-won lessons.SCHEMA.md-- the formal types: System, Ctx, Clock, Fields, Entity, Event, World, and the invariants.
The code (built + tested: 45 system modules, 60 test and probe files, 951 assertions -- the scale ladder from rime to a dying sun, up through mind + society + the human/made world, and the cryosphere's ice ages; this list highlights the core stack, see SYSTEMS.md for the full catalog incl. economy/technology/city/soil/epidemic/speculation/artifact/cryosphere)
natura.js-- the CORE (22 assertions): clock, system interface, registry, World runner, coupling.weather.js-- WEATHER (10): drifting pressure -> geostrophic wind -> advected temp/humidity -> orographic rain, an emergent rain-shadow. Optional toruswrap.vegetation.js-- VEGETATION (8): logistic biomass toward a climate carrying capacity, decaying soil-water, drought die-back, seed spread. The real greening. Optionalwrap.terrain.js-- TERRAIN erosion (7): stream-power incision over self-computed D8 flow, wrapping the Terrain Engine; couples to the weather's moisture.ecosystem.js-- ECOSYSTEM (6): agent-based predator-prey with a vegetation PREY-REFUGE; dt-invariant motion; open-zoneemigrate+ immigration flux (a metapopulation window) OR toruswrap.celestial.js-- CELESTIAL (15): the clock made physical -- a star, a tilted spinning planet, a moon; real daylight, axial-tilt seasons, day length by latitude, moon phase, tides (spring/neap), eclipses.ocean.js-- OCEAN / hydrology (6): rain routes down the D8 drainage into RIVERS and lakes and back to the sea; the coast breathes with celestial's tide; a big catchment tops its banks -> a FLOOD.fire.js-- FIRE (6): lightning catches in the dry, fuelled lee and sweeps DOWNWIND + UPSLOPE, clearing the vegetation and leaving a scar that heals; wet ground is a firebreak. The drought->fire->regrowth loop.biome.js-- BIOME dynamics (6): each cell tracks a long-run CLIMATE and slowly succeeds toward the climate-favoured biome (forests advance, deserts creep), with hysteresis; a warming trend retreats the cold.stellar.js-- STELLAR (8): a star's life over eons (main-sequence brightening -> red giant -> white dwarf cooling); its INSOLATION drives the deep-time climate that drives the biomes.frost.js-- FROST / micro (7): dendritic ice (dielectric-breakdown) branching toward the vapour it depletes -- rime on a leaf, the micro pole, woken only by the weather's cold.tectonics.js-- TECTONICS (6): drifting plates whose convergent margins raise mountains over Myr and whose interiors erode (isostasy) -- the evolving ground UNDER the terrain.cryosphere.js-- CRYOSPHERE (15): land ice as a mass balance bound by the ICE-ALBEDO FEEDBACK, so the climate is BISTABLE -- an ice age is a TIPPING (ice runs away past a threshold) with HYSTERESIS (you must warm past where it froze). Locks up water (the sea withdraws), grinds the bed (carving), FLOWS downhill, couples to stellar.chemistry.js-- CHEMISTRY / the chemical layer (10): matter that changes COMPOSITION, not just shape -- iron RUSTS in damp air, copper/bronze PATINA over decades, silver TARNISHES, wood ROTS, PAINT fades in the sun; the driver decides, not the clock (same iron rusts on the wet coast, holds in the desert). A chemical clock for artifact.niche.js-- NICHE CONSTRUCTION (8): life that REMAKES its world -- builders (beavers/coral/worms) write a lasting structure that lifts their own habitat (ecosystem engineering, a feedback), and it OUTLASTS them (a dam holds after the beavers are gone -- the world keeps the mark of a life). Builds where the ground suits it.hydro.js-- WATER CYCLE (9): water as ONE CONSERVED substance across its FOUR phases (liquid/vapour/cloud/ice) -- evaporate -> drift -> condense -> rain -> pool -> freeze -> thaw, the total never changing. The emergence IS the conservation: drought, flood, and ice age are the same water out of balance. Couples to weather + terrain.wintering.js-- WINTERING (39): how a warm-blooded life gets through the lean season, on ONE physiology (Kleiber metabolism, coat conductance cut by den/burrow/nest, Q10-suppressed torpor, a defended floor, arousal thermogenesis, an arousal DEBT that fills fastest when warm). Four ways to keep the winter's ledger: FAT (a bear's shallow continuous sleep, cubs born and nursed in it; a woodchuck's/ground squirrel's/bat's deep sleep broken by arousals that cost most of the fat), LARDER (chipmunk, red squirrel's midden), SCATTER (grey squirrel: thousands buried, memory + smell, thieves, the forgotten ones come up as oaks), DAILY (a chickadee's one-night fat and regulated nightly dip). Snow as the burrows' blanket; delayed implantation keyed to autumn fat; the MAST crop as the whole wood's master knob. Places: northernHardwood, katmai, arcticTundra. The seasons made more than colour.sensing.js-- SENSING (14): what a creature can DETECT, and its LIMITS -- the channel beneath mind's belief. SCENT drifts downwind and goes cold; SOUND carries far and symmetric; SIGHT is bright by day, blind at night / in fog; HEAT betrays a warm body only up close. Detection is an information game: the same prey is loud to one sense and silent to another, findable from one quarter and hidden from the next. Couples to weather (wind, fog) + celestial (daylight), and turns predation's "sees all" into "senses within its means".lifecycle.js-- LIFE-CYCLE (9): a creature's life as a state machine (egg->adult->senescent->death-> carcass->nutrients); a population TURNS OVER across generations, riding its food's carrying capacity, with the matter of the dead returning to the soil. The LIFE domain's biological continuum, birth to decay.mind.js-- MIND (20): a mind holds its OWN MODEL of the world (belief, not truth) and acts on that, so the map DIVERGES when it sleeps or fears -- fear conjures a phantom threat, hope sustains a hearth gone cold. The first rung of the ontology's previously-untouched MIND domain.society.js-- SOCIETY (10): reads many minds -> the shared MOOD + CONTAGION; a false belief spreads to consensus, and a scare met by a ~10% minority can TIP the whole into believing a danger that never was (a phase transition). The first rung of the untouched SOCIETY domain; couples back into mind.js's belief.worldgen.js-- a large TILEABLE continent (periodic fBm + ridged mountains): real oceans, coasts, and rain-shadow zones on a seamless torus. The "bigger grander worlds" primitive.weather-world.html-- the living-zone demo: one open coastal ZONE watched alive with SIX coupled systems on one clock -- celestial (moon/tides/daylight), weather (storms), vegetation (greening), ocean (rivers/tidal coast), fire (wildfires), creatures (herds migrating, predators hunting) -- and a day/night that blurs to daylight as you speed time up.ghost-and-hearth.html/brief-lights.html/brief-believing.html-- three living scenes of the new rungs: the MIND's map diverging from the territory read two ways (fear's ghost and hope's hearth); the LIFE-CYCLE turning over a whole population across generations; and all three systems COUPLED (mortal minded creatures foraging, fearing a predator that comes and goes, and dying of age still believing).compose-test.js-- the COMPOSITION proof (7 assertions): cryosphere + water-cycle + chemistry + niche run together on ONE World and clock without cross-talk, deterministically, and a real cross-system COUPLING fires -- chemistry reads the water cycle'smoisture, so iron rusts where hydro pooled water and holds where it is dry. Composability is the framework's whole point; this is the test that the new systems honour it.left-to-the-weather.html-- that same composition made VISIBLE and intimate: a stone monument left to the weather over centuries, four systems ageing one made thing on one clock -- the water cycle wets the stone, the chemical layer rusts the iron / greens the copper by that wet (streaks bleeding down the stone), niche-construction grows lichen in the damp shade, and frost spalls the frozen crevices. Systems that compose.
The world model (zones in a hierarchy)
The map is one ZONE of a larger world -- zone < region < continent < world < universe. A zone is an OPEN
window: life migrates out across the edges (emigrate) and in from the neighbouring zones (immHerb/
immPred), so the visible population is a metapopulation window, not a sealed island -- it is buffered by
space + migration, adapts to the terrain, and may locally die out. (A self-contained small world can instead
use torus wrap.) Oceans are the water cycle's moisture source, so a zone keeps its sea.
Quickstart (the functional API)
const { World, defineSystem, UNITS } = require('./natura.js');
const { makeWeather } = require('./weather.js');
// a world is a chosen STACK of systems; run one or many
const w = World({
seed: 7,
t0: 0, // start time (seconds)
systems: [ makeWeather({ N: 64, elevation: (x,y) => myTerrain.heightAt(x,y) }) ]
});
for (let i = 0; i < 100; i++) w.step(UNITS.HOUR); // advance the clock + step every system
const rain = w.fields().weather.rain; // read a system's exposed field
w.clock.season(); // 'autumn' -- one clock, every cadence
Defining a new system (the interface every system implements):
const mySystem = {
name: 'vegetation', domain: 'life', scale: 'ecological',
params: { /* preset defaults */ },
init(rng, params, clock) { return { /* state */ }; },
step(state, ctx, dt) { /* ctx.clock, ctx.fields.weather.moisture, ctx.rng */ return state; },
fields(state) { return { biomass: state.biomass }; }, // exposed for coupling
events(state) { return [ /* {kind,...} */ ]; }
};
Conventions (functional details, pinned here so they don't drift)
- Space: the world domain is
[-1,1]^2(matching the Terrain Engine + the spine). Grid systems use anN x Nfield with cell(i,j) -> world (i/(N-1)*2-1, j/(N-1)*2-1).k = j*N + i, row-major. - Elevation:
heightAt(x,y)-- sea is< seaLevel(the Terrain Engine's sea ise < 0). - Time: seconds.
UNITSgives SECOND..EON. The clock's phase helpers derive every cadence (dayPhase,season,years,eons) from the one time. - Fields: a system's
fields()returns a plain object; downstream systems read it atctx.fields.<systemName>.<field>. Grid fields areFloat32Array(N*N). IncludeNin a grid field object so readers can resample. Name fields for the QUANTITY (moisture, temp, biomass), not the system. - Determinism: NO
Date.now()/Math.random(). Randomness isrngFrom(seed)(mulberry32), derived per system from the world seed. Same seed + samedtsequence -> identical run (reproducible, resumable -- and it satisfies the workshop's no-wall-clock sandbox rule). - Coupling is one-frame-delayed:
ctx.fieldsis a snapshot taken BEFORE any system steps this tick, so update order doesn't matter (simultaneous update). Fine for the timescales; note it for tight loops. - Testing: every system gets real assertions -- determinism, finiteness, boundedness, AND one genuine EMERGENCE assertion (weather: the rain-shadow; ecosystem: the predator-prey oscillation; fire: spread). The emergence test is the proof the model is real, not a texture. Plus a small viz + the motion-eye.
Status (1.0.0, 2026-09-27)
Released at https://neap.systems/natura/ under the BSD licence: the page (with a quickstart for a person and for
an AI building a game), these docs as web pages with a generated module reference, every source file readable
online and served raw at /natura/raw/<path>, and the source zip (publish/make_all.py builds all of it; the
curated public list, and why each excluded file is excluded, are in publish/manifest.py). 45 modules build
systems; 60 test and probe files run in node, 951 assertions, all passing (publish/run_tests.py). The scene pages
built on Natura (the living-world art pieces) live in the gallery at garden.neap.art, not in the release.
Open threads: wiring the deep-time systems into a multi-timescale view; deeper MIND and SOCIETY rungs (memory,
culture, factions); weather's long-run cloud field.
On this site
About the names in code style. The docs name files as they are in the source. A name that is a link opens that file here: every module, test and bench page in the release can be read online, and all of them are in the source zip, natura-src-1.0.0.zip, on the Natura page. A name that is not a link is not part of this release: the scene pages the docs mention (weather-world.html and the others) and the working notes stay in the author's own copy. The design docs are the author's working docs, kept as they were written; their status notes carry their own dates, and the module reference below is generated from the code as released.
Start here
- Module referenceEvery Natura module: what it is, how to load it, the system it builds and the fields that system exposes, and its tests.
- Natura Schema -- the formal data shapesThe precise types the framework passes around, so every system agrees on the wire format (operator: "schema?"). Notation is TypeScript-ish for clarity; Natura itself is plain JS (README conventions). ...
Design
- NATURA -- a pocket-universe framework of composable natural systemsWorking name: Natura (the engine), sibling to the Terrain Engine. Operator steer, 2026-08-02:
- The Ontology of Existence -- sim.png, transcribed and reframed for simulationSource: a hand-drawn brainstorm of everything a world could simulate (sim.png, 2480x3508), reviewed 2026-08-02. His ask: "review it thoroughly and turn it into a format that will help you when ...
- Natura Systems -- detailed designs & how they interactThe fleshed-out per-system design + the coupling model. Complements DESIGN.md (the architecture) and ONTOLOGY.md (the content). Written 2026-08-02 while the whole thing is fresh -- the operator's ...
- Natura Scenarios -- the framework alive, traced system by systemThe deep functional vision, made concrete. DESIGN.md is the architecture, SYSTEMS.md the parts, ONTOLOGY.md the content -- this file shows them RUNNING. Each scenario traces a real phenomenon through ...
- Natura Algorithms -- implementable detail per system + decisions & lessonsThe deepest capture, written while the design is fully in hand (operator: "are you sure you've maximized what you can from the knowledge you hold?"). SYSTEMS.md says WHAT each system is; this says ...
Creatures
- creatures/ -- the 2D creature factoryA small, reusable factory for procedural side-view animals, decomposed by concern (factories + a composer, not one huge file). It is consumed by the First Light gallery piece (../creatures.html) ...
About
- LicenceNatura is free software under the BSD 3-Clause licence.