What this is, why it looks like this, and what the sliders do.
This started as a personal experiment: could I get the classic boids algorithm — three simple rules, no global plan — to produce something that actually looks like a starling murmuration? Not a physics paper, not a production tool. Just me and a browser trying to figure out what makes those evening sky-dances tick.
It grew from my earlier fish boids playground, but the two simulations share no code. Murmurations demanded a different approach — thousands of birds instead of ten fish, topological neighbors instead of fixed radii, and a whole set of extensions to the basic three rules that turned out to be more interesting than I expected.
The playground is currently what I'd call an "engineering model." It intentionally exposes a lot of parameters — more than a polished demo would — because the interactions among them are the interesting thing. Crank up front bias and watch the leading edge destabilize. Drop max force and see the flock carve wider arcs. Dial homing to zero and watch stray clusters drift off permanently.
I may simplify the interface later, but for now the full parameter set is deliberate. If you're the kind of person who likes tweaking knobs to see what happens, this is for you.
The slider panel has fourteen parameters grouped into three sections. Here are the ones that matter most for shaping the murmuration's character:
How strongly each bird matches its neighbors' heading. This is the dominant murmuration force — it's what makes the flock move as a coherent mass and propagates turn waves across the group. High alignment produces sweeping, coordinated movement. Low alignment makes the flock dissolve into noise.
How much more weight birds give to neighbors ahead of them vs. behind. At 1.0 (default), it's equal. Higher values make the leading edge less stable — leaders have fewer birds ahead to follow — while trailing birds lock on tightly. This produces the rolling, folding-in-on-itself motion that's characteristic of real murmurations.
These three together control the "feel" of the flock's flight. Max speed sets the top speed; min speed (as a percentage of max) sets the stall speed — birds are boosted to at least this speed so they can't hover. Max force caps how quickly a bird can change direction. Fast birds with moderate force make wide, graceful arcs — slow turns, big sweeps. Fast birds with high force turn on a dime. The ratios matter more than any single value.
How strongly isolated birds pull back toward the flock's center. At zero, any cluster that breaks away stays lost. At high values, stray birds get yanked back aggressively. The default (0.75) is a middle ground — breakaway groups drift back gradually, which looks natural.
How many nearest birds each bird considers for alignment and cohesion. More neighbors means longer-range coherence — the flock behaves as a larger, more unified structure. Fewer neighbors means more local, fragmented behavior. This is separate from separation, which uses its own (smaller) neighbor count.
Two starting points that show different sides of the simulation.
Front bias cranked to 4 means birds weight forward neighbors four times more than those behind — the leading edge is unstable while trailing birds lock on tight, creating rolling, folding-in-on-itself wave patterns. Edge alignment (2.5) stiffens the boundary so the waves stay contained rather than shedding birds. A wide personal space (4.7) enforces uniform spacing, making the internal density waves visible. Very low min speed (8%) lets birds nearly stall during compression phases, amplifying the stretch-and-compress rhythm. High cohesion and homing keep everything together despite the instability.
A tension between two opposing forces. Strong separation (7.5) aggressively pushes birds apart, while very high homing (8.5) yanks scattered birds back toward the center. High max speed (23) means birds cover ground fast when the flock blows open. The cycle: flock holds together, separation pressure builds, the flock explodes outward, homing pulls everyone back, repeat. No front bias or edge alignment — this preset is the raw push-pull between dispersal and gathering.
Found a combination you like? You can save it as a preset with one click and switch back to it anytime.
.json file — useful for backing up a favourite or sharing
it with someone..json or .txt file and adds it to your saved
presets.Everything stays local — your presets are stored in your browser and nothing is uploaded anywhere. The downloaded files are plain JSON, so you can edit them by hand if you want.
Real murmurations do things this simulation doesn't yet capture — dramatic shape-shifting, sudden splits and recombinations, cascading turn waves that move faster than the birds fly. Those probably involve predator avoidance (a hawk triggers a panic wave) and possibly information transfer beyond simple velocity matching. That's the frontier.
For now, I'm happy that three local rules plus a few extensions can produce something that genuinely looks like starlings at dusk. If you find an interesting parameter combination, I'd love to hear about it.
Open the Playground →