Boids Algorithm

Simulating the flocking behaviour of birds

Alignment:

Cohesion:

Separation:


What are boids?

Boids is an algorithm developed by Craig Reynolds in 1986 and is used to simulate the flocking behaviour of birds.

The complexity in the movement of boids arises due to the interaction of each boid with other nearby boids on the basis of set of simple rules. The rules applied are:

separation diagram
Separation: steer to avoid crowding local flockmates
alignment diagram
Alignment: steer towards the average heading of local flockmates
cohesion diagram
Cohesion: steer to move toward the average position of local flockmates

However some other set of rules can also be applied to each boid like avoiding obstacles or goal seeking.
This algorithm was even used in movie Batman Returns (1992) to generate bat swarms.

[Github Repo]