← All demos

LifeSim

A particle-life sandbox with up to ten species. Tune how every species attracts or repels every other one, add chemistry-like reactions, or roll a random world and watch what emerges.

Loading 0%

Click the game to give it keyboard focus. Best on a desktop browser.

Each particle has a species. A 10 × 10 force matrix says how strongly one species pulls or pushes another, and reactions of the form inputs + [catalysts] → outputs convert, create and destroy particles when the right neighbours meet.

Start from a preset (particle life, rock–paper–scissors, predator & prey) or from a random seed. The same seed always gives the same world, so interesting seeds can be shared.

How it's made

Built by agents, designed by me

I acted as orchestrator and architect: I set the requirements, the architecture rules and the verification approach, and AI coding agents wrote the code and documentation inside those rules.

Home-made ECS and DI

The simulation runs on Morphic, a small entity-component-system and dependency-injection framework written for these demos instead of an off-the-shelf one. Every system declares its signature (what it reads, writes, emits, creates and destroys), and the world rejects any access outside that signature.

Designed as a graph of morphisms

The program is described as a graph of data transformations in the spirit of category theory. The graph is generated from the code, kept in the docs and checked by a test, so the documentation cannot drift from the implementation.

Verified

The core is engine-free C#. Tests run both in plain .NET and in Unity: they check determinism (same seed gives the same world), reaction stoichiometry, the population cap, rule round-tripping and a closed morphism graph.

An unhandled error has occurred. Reload 🗙