PRIMORDIUM

Simple rules → emergent life. Hit Randomize to spawn a new organism. [hide] [about]
seed
keys · space r m e p a n h
interaction matrix · drag cells ↕

PRIMORDIUM

An emergent particle-life ecosystem. Hundreds of particles, each one of a few species (colours), obey one tiny rule: how strongly am I pulled toward — or pushed away from — each other species? Those forces live in the colour grid under the controls. Nothing is scripted; every cell, chaser, membrane and pulsing creature you see emerges from that grid alone.

The force law

For two particles at distance r (scaled to the interaction radius, 0→1):

The grid is asymmetric — A chasing B need not equal B chasing A — and that imbalance is what turns dull symmetry into life-like pursuit.

Make it yours

Every organism is generated from a 32-bit seed: copy it to save a creature or paste a friend's, then Load. Mutate nudges the rules; Evolve keeps mutating so the ecosystem drifts on its own. Drag a matrix cell up/down to hand-tune one relationship, and drag the canvas to stir the swarm. The presets (Cells, Chase, Snakes, Gas) are hand-built starting points.

Sound

Toggle Audio (the a key, or the button) and the swarm conducts a generative ambient piece: a breathing drone under a soft pentatonic melody, washed through a long feedback delay. The swarm's kinetic energy is the conductor — frantic motion makes the notes busier, higher and brighter, while settling into stable structures makes the music sparse, low and calm. Pentatonic tuning means it never hits a wrong note, and every run is different. All synthesised live with the Web Audio API — still no files, no network.

Keyboard

space pause · r randomize · m mutate · e evolve · p palette · a sound · n respawn · h hide panel · i this panel

A single self-contained HTML file · no libraries, no network, no assets. Real-time O(n) spatial-hash simulation. Built with Claude.

drag on the canvas to stir the swarm