📚 Encyclopedia

Games & Graphics · updated 2026-10-13

Procedural planet generation with causes (A Planet With a Past)

procedural-generationworldbuildingclimatehydrologydeterminismwebglweb-workers

A Planet With a Past (justinahampton.com/fun/freetime/planet/) generates a whole world from one seed on a WebGL globe, where every layer is caused by the one before, and a tap anywhere explains "why here" with a trail of causes. The interesting parts are the layer order, the shortcuts that read as realistic, and keeping it deterministic across browsers.

Layer order (each causes the next)

Tectonic plates -> plate boundaries -> height (uplift, erosion, sea level) -> temperature (latitude, height, ocean currents) and belt winds -> moisture and rain shadows -> rivers and lakes -> biomes -> town sites -> provinces and routes -> 3,000 years of history in 10-year steps. Generation runs in a Web Worker (1.6 to 1.8 s on the desktop); the worker posts a preview of bare elevation after the plates stage so a globe appears about halfway through the wait.

Shortcuts that work

Determinism across engines

Text that cannot lie

Every sentence of the "why here" explainer may assert only what the stored data supports, and the harness checks for contradictions: a wet rain shadow, an old range taller than its hill, a desert at a latitude with 500 mm, rain on an ice sheet, a current named where none acts, "taken in war" without a conquest that decade. Add a check with every new sentence. Give each realm one fixed name (rank at its height plus an ordinal, "the second Kingdom of Oan"); size-by-decade names made one realm read as three.

Rendering

Per-vertex relief plus three octaves of ridged noise lit by finite differences, snow line from a color channel, coastline darkening via fwidth, tapering rivers. A quality valve drops fine relief after 12 slow frames in a row. On phones the globe is position: sticky (48dvh) so it stays visible while text scrolls.

Known weaknesses

History churns (every world ends with ~100 realms); rain and biome maps show straight latitude bands; seasonal swing depends only on distance to the sea. Never tested on a real phone GPU.

See also

Linked from

Sources: justinahampton memory (freetime-planet, vacation-planet), tldr post #1760, 2026-10-12/13