MOHIBB MALIK

emergent flocking, in your browser

Murmuration

Hundreds of boids, each one only aware of its nearest neighbors, follow three simple rules — separation, alignment, cohesion — and the whole flock wheels and swirls like a starling murmuration. Click and hold anywhere over the flock to pull it toward your cursor. Tune the rules below.

Your browser does not support canvas, which is required to display this simulation.

01 Flock

150
55
1.5
1.0
1.0
4.0

Each boid only looks at neighbors inside its own perception radius — the flock's shape is a side effect of many local decisions, not a single global plan.

02 Environment & interaction

0.08
2.0
1.5

03 Seed

The seed fixes every boid's starting position and heading, so the same seed always spawns the same flock.

04 Appearance

#b4471f
#0b0d12

A 2D flocking simulation after Craig Reynolds' 1986 Boids model — separation, alignment and cohesion, plus wall avoidance and an interactive pull force, all computed on a spatial grid so it stays fast at up to 1500 boids. For the vectors behind every rule, open .