QuasiPITech Contact
Simulation research

Terra

In build · 0.1.0

A civilization simulation in continuous time on a real sphere — no turns, no visible hex grid.

TypeScriptThree.jsDeterministic simulationFixed-point
Illustration for Terra
cells
163,842on a real sphere
tests
483determinism enforced
lines
19,40570 files
turns
0continuous time
What it is

Terra in short

Time can be paused or run at up to a year a second. Movement follows great circles over 163,842 cells, and the HUD says out loud what the current time scale simplifies. It is built layer by layer, with determinism required from the first file.

Status

What works, and what does not

Works today
  • Planet generation baked into a fast simulation grid, rendered as a smooth sphere
  • A deterministic clock with pause and seven speeds, up to a year per second
  • Continuous space: fixed-point spherical geometry, A* and smoothed routes
  • Groups of people rather than individuals or abstractions
  • Settlement, subsistence, knowledge diffusion and peoples with territory and borders
Not ready yet
  • Diplomacy and war (as continuous processes rather than turn states) is the next layer.
  • Save/load, replay, pacing UI and alerts come after that.
  • The economy and technology still stall around 4000 BC.
Under the hood

What had to be got right

01

Deterministic from the first file

Two machines given the same state and commands must reach bit-identical results. A test scans the sources and fails the build on any forbidden function.

02

Speed is bought with coarseness, not steps

The base tick is one simulated minute, forever. Faster speeds take longer strides, and each system declares where it becomes simplified — the HUD names it.

03

A sphere, not a board

The data grid is hexagonal but the picture is continuous: coastlines are thresholded per pixel, so no hex board shows through.

In pictures

See it

A generated planet seen from orbit, with continents, lakes, clouds and atmosphere
The planet from orbit.
A continent with relief and rivers drawn as ribbons
Rivers drawn as ribbons along the flow graph.