QuasiPITech Contact
Project 04 · Simulation research · In build

Terra — a planet without turns.

A civilization simulation in continuous time on a real sphere. There are no turns and no visible hex grid: time can be paused or run at up to a year a second, people move as groups along great circles, and settlements spread across the planet in the order the land allows. It is built one layer at a time, and it has been deterministic from the first file.

Cells
163,842about 55 km apart, on a sphere
Tests
483all passing, 24 files
Source
19,405lines of TypeScript, tests excluded
Speeds
7plus pause, up to a year a second
Turns
0time is continuous

Tests and line count measured on the current build, 18 October 2026 · Terra 0.1.0

The idea

What a strategy game looks like without the board

Turn-based strategy games hand you a board: a grid you can see, a world that waits while you think, and history that advances in clicks. Terra asks what is left when all three are taken away. The data still lives on cells, but the picture is a continuous planet; time flows, and you choose how fast.

The unit of the simulation is a group — a band, a column, a village — not a single person and not an abstract number. That is the scale at which thousands of actors stay countable while the planet still looks inhabited. How each group is drawn is derived from its position, heading and size, so the simulation never needs to know where the eighteenth person in a band is standing.

A generated planet seen from orbit, with continents, inland lakes, cloud bands and a thin atmosphere at the limb
From orbitA generated planet with calibrated climate, latitude-banded clouds and the atmosphere at the limb.
The planet

A hex grid underneath, none of it on screen

Drawing the grid literally gave a hex board. Getting rid of it took three things together: sampling the cells continuously instead of giving each one a flat colour, deciding the coastline per pixel in the shader rather than per vertex, and warping the coast with noise at two scales. Below the grid’s own resolution, a fractal adds terrain detail per pixel, anchored in the world rather than the camera, so nothing swims as you zoom.

Close view of a continent with relief, a central lake and rivers drawn as thin ribbons down to the coast
Rivers as ribbonsDrawn along the flow graph with a centripetal spline. Before, a river was a 220 km blue smear in the shape of the grid.
A continent interior with lakes, winding rivers and a cloud band crossing a mountain range
Closer inLakes, rivers and a cloud band over the mountains. Fresh water multiplies what the land can feed by 1.45, so rivers decide where people settle.

Climate, calibrated

Land rainfall now matches Earth’s distribution (median 500 mm, quartiles 250 and 925), and the temperature profile is within 1.5 K of Earth’s in every latitude band that has land.

Off the main thread

Generating the world at this resolution takes about 20 seconds on one core. It runs in a worker that hands the grid back as typed arrays without copying, while the screen shows which stage it is on.

Fast where it counts

The finest grid renders at 147 frames a second. Routes are drawn only near the centre of view: 84 routes instead of 1,990, and 5.6 ms a frame instead of 18.9.

Under the hood

Four decisions the rest is built on

01

Deterministic from the first file

Two machines given the same state and the same commands must reach bit-identical results. All simulation maths is fixed-point, and a test scans the sources and fails the build on any forbidden function — Math.random, the clock, and every transcendental. Sine and cosine are replaced by CORDIC, which uses only additions and shifts; its error is about 7 cm of arc on an Earth-sized planet.

02

Speed is bought with coarseness, not steps

Twelve thousand years at a one-minute tick is 6.3 billion steps — 73 days of real time at a thousand steps a second. So the tick stays one simulated minute forever, and faster speeds take longer strides. Each system declares the stride where it becomes simplified or pauses, and the HUD names it out loud.

03

Real units, not points

What the land can feed is counted in people per square kilometre, from archaeological ranges: foragers at 0.02–0.2. Techniques form a ladder rather than a slider — gardening ×3.5, farming ×13, intensive farming ×28 — so a region adopts farming as an event instead of drifting into it.

04

Ideas travel further than they are invented

Almost nobody invented farming; almost everybody got it. Without diffusion every settlement reinvents the Neolithic alone, the map becomes uncorrelated noise, and there are no regions — which is the thing a civilization game is about.

Settlement and peoples

The planet fills in ecological order

Bands leave full settlements, look for better land and found new ones. Grassland and savanna fill first, temperate forest next, taiga and rainforest last. Settlements belong to peoples, each with a generated name, a capital and a territory that spreads over land and stops at a strait.

Peoples split when they sprawl and grow old, and the larger absorb the smaller. In a 9,000-year run: 89 peoples, 81 splits and 16 absorptions, and the map is still changing after 3000 BC.

A coastline dotted with settlements in pale and orange tones
The farming frontierSettlements coloured by how they feed themselves, from foraging (pale) to farming (warm). The frontier follows the climate. Captured on an earlier, coarser build.
What broke

The bugs that taught the most

Because the simulation does not know what a second is, millennia can be run headless in a terminal. Most of what is below was found that way — and most of it looked like something else at first.

Nobody was arriving anywhere

Walking distance per step was stored in a fixed-point format that tops out at 32,768 km. With a one-year step, a walker is “entitled” to 35,000 km; the value overflowed to negative, and a guard silently stopped the move. Every early measurement described a world where no one ever reached a destination. After the fix: 874 settlements instead of 592, and 26.5 million people instead of 18.7.

The planet grew with the grid

Carrying capacity was counted per cell without the cell’s area, so the planet’s capacity quadrupled with every subdivision. It looked like bands failing under load — 33,891 of them on the road — but it was arithmetic. Settlement counts are now independent of the grid: 618, 692 and 678 at three resolutions.

A planet that read like Mars

45% of the land was desert. Rainfall had been normalised linearly, which moves a value into 0–1 but keeps its skewed shape: the median land cell got 155 mm a year. Rank-normalising it to Earth’s curve cut desert to 25% and tripled temperate forest. The lesson: check the median, not the range.

200× faster, without touching performance

The first settlement runs left 15,180 bands wandering forever and took 391 seconds of compute. Four design faults later — joining before founding, thresholds that made settlements oscillate, bands returning to the village they had just left — the same run takes 1.9 seconds.

Status

What works, and what does not yet

Running today
  • Planet generation with calibrated climate, rivers, clouds and atmosphere
  • A deterministic clock with pause and seven speeds
  • Continuous movement and routing on the sphere
  • Groups, settlement, subsistence and the spread of knowledge
  • Peoples with territory, borders, splits and absorption
Not ready yet
  • Diplomacy and war, as continuous processes rather than turn states
  • Save, load and replay; pacing tools and alerts
  • The economy and technology still stall around 4000 BC
  • Relief is exaggerated, which stops the camera below about 200 km over mountains
  • Forests cover 21% of the land against Earth’s ~30%
Curious?

Questions or feedback

Terra is a personal research project and is not available to download. If you want to know more about how any part of it works, write to me.