Flocking System Breakdown

Flocking Systems | Boids | Geometric Flight | Flocking Behaviour | Collision Avoidance | Velocity Matching | Flock Centring | Examples | Steering Behaviours | Seek and Flee | Pursuit and Evasion | Arrival | Wander | Path Following | Wall Following and Containment

Pursuit and Evasion

Similar to seek except that the target is another moving character. In order for pursuit to be effective, a boid must predict where the target will be in the future. The method described by Reynolds in his “Steering Behaviours for Autonomous Characters” paper uses a simple mathematical predictor and re-evaluates it at each time step. This predictor can take any form the programmer likes, so long as it is able to make reasonable assumptions on the quarry’s next location.

An example is a linear velocity based predictor, which assumes that the quarry will not turn during the prediction phase. Although this assumption is often wrong, it will only be in use for one time step (Usually about 1/30 of a second) Therefore, the predictor can be assumed to be roughly accurate.

The position of the quarry T number of time units in the future can then be obtained by scaling its velocity by T and adding that offset to its current position. This predicted target is then passed to a seek behaviour routine which steers the boid in the correct direction.


Evasion is the same as pursuit, except that instead of using seek to steer the boid, flee is used, which drives the boid away from the pursuer.

<< previous | next >>