Wander

Wander behaviour causes the boid to randomly wander around its environment, without any influences other than the standard flocking behaviours. Wandering can be achieved by a number of methods.

Random Steering Force

This method involves generating a random steering force vector (truncated by the boid’s individual maximum force value) on each time step. Doing this does give the result of an undetermined final motion path, but the motion is twitchy and not very lifelike. Randomly generating the steering vector gives no relationship between forces from one frame to the next.

Spherical Constraint Steering

Rather than change the steering force on each frame, small random displacements are made to it at each step. A virtual sphere is projected slightly in front of the boid, and the new steering vector is constrained so that it must lie somewhere on the surface of that sphere. The vector from the previous time step is also constrained with a smaller sphere, attached to the larger one. This sphere defines the range of motion that the vector can make in the next time step.

This method generates a more interesting flowing motion, as the boid will not make drastic changes in its motion from frame to frame.

Procedural Noise

Using a procedural noise function like Perlin noise allows the creation of a velocity grid in 3D space. As the flock members pass through this grid, they use the noise vectors as the force direction to apply at each world position.