← All projects

Evolution Sim

Live demo · open source

Artificial-life simulation · Solo developer · 2026

A browser-based artificial-life simulation. Every organism starts as the same unarmed plant eater, and every trait costs energy every tick. Nobody is told to be a predator, a scavenger, or a colony: those roles, along with arms races and new species, emerge from random mutation and that one rule.

The demo link opens the full “grand world” with every feature switched on. The seed is in the address, so the same link replays the same history for anyone, in any browser. Click an organism to inspect its genes and family, and scroll down for the charts and the family tree.

Role
Solo developer
Stack
TypeScript · Web Workers · Canvas 2D · Vitest · GitHub Actions · AWS
Proof
799 automated tests · about 3,200 worlds audited
License
Open source (MIT)

In motion

The Evolution Sim simulator running the grand world: a map of continents, seas and dots for animals on the left, and a control panel with seed, speed and world settings on the right
The simulator running the grand world at seed 888871: continents and seas, plants, and animals as dots.
A time-lapse of one run: green plant eaters, then red meat eaters appear and a food web forms
Seed 12 over 60,000 ticks. Everyone starts as a green, unarmed plant eater. The first kill comes at tick 60, the first scavenger at 566, and by tick 8,690 a lineage lives mostly on meat (red).
The audited grand world over 120,000 ticks: green dots are plant eaters, yellowish dots the mixed eaters, and the ground brightens where plants stand
The audited grand world over 120,000 ticks (seed 210): green dots are plant eaters, yellowish dots are mixed eaters, and the ground brightens where plants stand.
A family tree of one run: green branches are plant eaters, orange and red are meat eaters, and red crosses mark extinctions
Family tree of one run (seed 4, 406,000 ticks): 27 species so far, 3 alive. Meat-eater branches appear around tick 30,000 and keep splitting off short-lived offshoots.

What emerges

How it's built

  • One simulation, two front ends. An npm-workspaces monorepo: a pure TypeScript core with no browser or Node APIs, a browser viewer that runs it in a Web Worker and draws it on a canvas, and a headless Node runner for batch experiments.
  • Deterministic. The same seed and settings give the same history in any browser, on a laptop or in the cloud. All randomness comes from one seeded generator, and a repo-wide test bans math functions whose rounding differs between browsers.
  • Two ledgers, checked by tests. Energy flows one way (sun, plants, eaters, heat) and balances to better than one part in a billion. Matter goes round in a circle and is never created or destroyed.
  • 799 automated tests. Every push runs the type check, the full test suite, and the build on GitHub Actions, and the site deploys to GitHub Pages.
  • A cloud experiment runner. One on-demand AWS machine per experiment, a cost ceiling that has to be approved before anything starts, resumable runs, and a machine that shuts itself down. Results are compared seed by seed, and a claim counts only when its 95% range excludes no change and it holds up on fresh seeds.
Open problem

What didn't work

The full grand world never kept a lasting group of meat eaters. An audit of about 3,200 worlds, then a long hunt for the cause, found that four features together (seasons, harmful mutations, sex, and kin restraint) erase them, because each hurts a small group more than a large one. A “hunters” preset that removes all four does grow them. Many fixes were tried in the full world and none held up on a long confirmation, and small 8-world screens repeatedly overstated results that 16 fresh worlds then shrank. It's reported as an open problem, with the write-up in What we found.

I built this with AI coding tools, directing the design and checking behavior through the tests, the two ledgers, and many-seed comparisons rather than trusting any single run.