An improvement of the flocking behaviour in Jabuka is available.
There are now very simplistic birds drawn, to give an idea of the boid’s orientation.
The separation behaviour has been fixed. The behaviour was garbage before, the force away from another boid was proportional to the distance away from it. Now the force increases the nearer another boid is.
The boid’s orientation is taken as the smallest angle between being aligned with the World’s x axis, and the boid’s velocity. The roll doesn’t behave realistically (see scene 13), but the boid’s behaviour isn’t realistic. A boid would really change its velocity by adjusting its orientation (change the wing shape to apply a torque to allow it to rotate…)
This paper describes how the steering behaviours should change the intention of the boid, instead of providing actual forces onto the boid.
A simple particle system has been introduced to allow the path of a few individual boids to be more easily seen.
Running under the Visual Studio profiler, most of the time was seen to be spent finding the flockmates in proximity of the boid.
The same calculation was being done twice, for both the cohesion and alignment behaviours. Adding a ProximityFinderCache increased the frame rate by 50%, with no change in the calculations. Adjusting the code so that the boids in proximity are only calculated on every third iteration added another 20% to the framerate (giving 15fps with only two TrailGenerators attached).