Boids

Back to Posts

Development

Boids (bird-oid objects) is another well known agent-based simulation. Flocking behavior arises through adherence to three simple rules:

Cohesion - group together
Separation - don't collide
Alignment - steer in the same direction

Like real life birds, boids don't have awareness of all other individuals in the flock, so their observance of the rules is only in relation to boids in their vicinity. To make them more lifelike, I added the ability to perch. All of these rules can be toggled off to see what difference they make.

My favorite part is that the algorithm is easily extended to 3D, so this was my first opportunity to use Godot 3D. At the time of writing, it wasn't quite as straightforward as Unity but still very good. My 3D boids are supposed to resemble fish. The 3D doesn't seem to work on some browsers.

~

Links

Source code - GitHub


Built with Godot

~