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

Boids

In order to build our simulated flock, we must first create a model of a single autonomous bird like (Bird-oid, boid) character, that supports geometric flight. To this autonomous agent we add behaviours (heuristics and goals) that will generate corresponding forces that in turn will propel the boid through its environment in a realistic manner. Once this single agent is modelled accurately, or at least to some level of physical realism, we create an arbitrary number of them in order to generate the flock. The true test of our boid’s intelligence is the result of this duplication. If the behaviour applied to the boid is accurate, the flock should interact in a believable way, but if the individual behaviours are unbelievable so too will be the behaviour of our flock.

Simple Vehicle Model

In a paper by Craig Reynolds called “Steering Behaviours for Autonomous Characters” he describes a simple vehicle model that is used to simulate each boid’s physical motion. This model is based on forward Euler integration. At each simulation step a new force, the size and direction of which are determined by the boid’s behaviour mechanism, are applied to the vehicle’s point mass. Subsequently the acceleration is obtained and is added to the vehicle’s old velocity which gives a new velocity. This new velocity is constrained by the vehicle’s max_speed value.

The model also includes a set of N basis vectors which are used to represent the boid's local coordinate space during flight. That way the boid will always have an up, forward and sideways direction.

Code taken from “Steering Behaviours for Autonomous Characters” – Craig Reynolds


steering_force = truncate(steering_direction, max_force);
acceleration = steering_force / mass;
velocity = truncate(velocity + acceleration, max_speed);
position = position + velocity;



<< previous | next >>