I'm doing a simulation of flying birds for my thesis.
I am using the usual steering behaviors: Cohesion, Separation, Velocity Match and Obstacle Avoidance (to avoid terrain).
The program is written in C# and uses Unity3D. I have disabled physics for the boids.
I'm also using alglib to calculate K-nearest neighbors using AKNN. alglib uses k-d trees for this.
So here are the fps I get:
100 boids = 60 fps
200 boids = 35 fps
300 boids = 23 fps
500 boids = 13 fps
1000 boids = 5 fps
As the number of boids increases, performance degrades rapidly. I'd like to do something to improve it, but sadly I am using the free version of unity3D, which does not have a profiler.
Is the performance I'm getting good? I haven't found results online for this.
Should I find another library instead of alglib?
By the way, you can see the program online here. Requires unity3d plugin.