Simulating lifelike behaviour in game entities always struck me as something that would always be incredibly complicated. However sometimes even with just a few rules complex emergent behaviour can be created. Such in the case with Boids. Boids are a flocking creature designing originally by Craig Reynolds and at their core there are just three logic rules:
- Separation - Boids don't want to be flying too close to another Boid
- Alignment - Boids want to be flying in the same direction as nearby Boids
- Cohesion - Boids want to be in the centre of nearby Boids
The controls below show the radius of the effect of the various rules. Changing the values will result in different flocking behaviour, for example shrinking the separation constraint will result in the Boids flying closer together.