Boids Aquarium — a little society behind glass

A self-contained artificial society

A little society, behind glass.

Not another flocking demo. These boids pair up and drift apart, raise families, grow old, catch epidemics, evolve their colours and get hunted — a whole population living and dying while you watch. Open the tank and steer it, and see how long your society lasts.

scroll ↓

Why it's different

Most boids simulations are a swarm. This one is a society.

The classic boids model gives you cohesion, alignment and separation — three sliders and a pretty flock. Boids Aquarium keeps that graceful motion underneath, then builds an entire population biology on top: who bonds with whom, who breeds, who ages, who gets sick, whose colours win. Every number you see is a living demographic, not a physics constant.

cohesion slider alignment slider separation slider marriage & divorce Gompertz aging inbreeding depression epidemics with an R number a colour gene pool

What's alive in the tank

Six systems, one glass box

01 — society

Bonds & families

Pairs form by bumping into the right stranger, glow while fertile, raise a family, and sometimes divorce. Couples that drift too far apart stop having children, and stray far enough and they grow apart for good. Singles never settle; some boids court their own sex. Courtship even has taste — an eye for big eyes, a weakness for long beaks.

marry · breed · drift apart · divorce · widow
02 — demography

Birth, age & death

Everyone is born, matures, and ages under a real mortality curve. Seed a lone founding population and watch it climb to target — or an overcrowded one and watch it thin. A live population pyramid shows the age–sex structure, and three feedback arms quietly steer the whole thing home.

pyramid · 50/500 rule · founding growth · immigration
03 — genetics

Colour is the genome

Each boid's hue and saturation are its genes; children blend their parents' colours with the odd mutation. A preferred family sweeps the tank in an endless cycle, and a thin gene pool brings on inbreeding depression.

heredity · mutation · diversity
04 — epidemics

Disease that spreads

Infection passes by contact, trickles across pair bonds, and either kills — far more often in an inbred population — or leaves lifelong immunity. The dashboard reads out an actual R number.

contact · immunity · R factor
05 — predation

Hunger with an agenda

Predators share the boids' physics and an appetite. Set their diet to the "wrong" colour family and they become an evolutionary force, accelerating the colour cycle they feed against.

hunt · starve · shape the gene pool
06 — depth

A third dimension

Turn on depth and the flock gains a z-axis: boids swim toward you past full size and shrink into the distance, personal space turns three-dimensional, and the whole tank reads as a window instead of a wall.

2.5D · perspective · near & far

How it runs

One HTML file. A dashboard, a tank, and a kiosk export.

The whole thing is a single self-contained page — no server, no build, no dependencies to fetch. Open it and you get a control dashboard; hit a button and the aquarium opens fullscreen in its own tab, steered live from the dashboard. Or export a standalone copy: a self-running fullscreen build that works completely offline, anywhere a WebGL browser runs.

Deliveryone self-contained .html
RendererPixiJS · WebGL, embedded
Dependenciesnone — runs offline
Controllive dashboard ⇄ tank
Targetany modern WebGL browser
Boidsa few hundred, at 30 fps
Bodiesteardrop, or your own images

Pull up a chair

Watch a society run its course.

Set the rules, open the glass, and see whether your population thrives, drifts inbred, or gets eaten — and the society will get on with it.

Above is a short recorded clip, looping. Press Run it live to embed the real simulation — then give it a couple of minutes: the cluster dynamics take time to unfold as groups form, drift, merge and break apart. A five-second glance won't show it. · open clip full size ↗