Home▸Animals & Their World▸Starling Murmuration: 2D Boid Flocking Lab

Starling Murmuration: 2D Boid Flocking Lab

Top-down 2D murmuration: separation, alignment and cohesion boid rules over a spatial grid, a live order-parameter readout, and a click-to-scare interaction that lets you watch the flock scatter and re-form.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-starling-flock-control-simulation ↗ Open standalone

This 2D companion runs the same three local boid rules as the 3D original — separation, alignment and cohesion — but from directly overhead, on a plain canvas built around a uniform spatial grid so hundreds of birds can be tested neighbour-by-neighbour every frame without a quadratic slowdown. A slow-drifting attraction point keeps the flock swirling rather than settling into a static blob, and a live "order parameter" readout — the length of the flock's mean velocity vector divided by its mean speed — turns the qualitative "does it look like a murmuration" question into a number between 0 (disordered swarm) and 1 (perfectly aligned flock) that visibly rises and falls as you retune the separation, alignment and cohesion weights. Click or tap the canvas to send a scare impulse through the nearest birds and watch the flock scatter and re-cohere.

⚙ Under the hood

2D top-down boid flock with separation/alignment/cohesion rules over a rebuilt-per-frame spatial grid, a slow-drifting swirl target, a live order-parameter readout, and a click-to-scare interaction.

boid flockingmurmurationseparation alignment cohesionemergent behaviorspatial gridorder parameter

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)