Flocking is a game resource able to add life to the world. It is based on using entities that follow a combination of simple rules to navigate the world.
I implemented my flocking algorithm inside Unreal Engine 4.
My implementation supports the steering behaviors of:
- Alignment
- Cohesion
- Separation
- Bound Limiting
- Obstacle Avoidance
- Predator evasion
- Leader Following
- Wander
I am handling the collision checks between boids to find neighbors myself, so that I can parallelize it.
For optimization purposes, I use instance rendering and parallelization. Right now, I am able to have 4000 boids in screen while running at 60 FPS.
Future work
The performance can still be increased more. Right now, I am not using any kind of space partitioning algorithm, so I need to check collisions between all the boids. Adding an Octree for example will boost the performance as most of the checks will be avoided.