Experiment / Boids

Emergent flocking

Craig Reynolds' boids algorithm — three simple rules produce complex collective motion. Click the canvas to place obstacles.

Separation: 1.5
Alignment: 1.0
Cohesion: 1.0
Speed: 4
Radius: 60
Boids: 300
FPS: 0 Boids: 0 Obstacles: 0
Separation avoids crowding • Alignment matches heading • Cohesion steers toward neighbors