Emergent Behaviour
A boids simulation made in Unity.






This was a project for Procedural Generation. The goal was to program emergent behaviour by simulating a sufficient amount of moving objects interacting with each other. I attempted to create the classic Boids, which is an artificial life simulation developed by Craig Reynolds. Plenty of research was readily available on this topic and I was happy with what I managed to create. I programmed a spatial partitioning grid to efficiently manage and find neighbours for entities. The grid divides the world into cells, allowing an entity to check only its immediate surrounding cells instead of the naive approach of scanning every single one in the scene. This allowed me to get up to 500 entities on the screen at one time with minimal performance hit, so I was very proud of that. The boids eventually lose emergent behaviour and start following in a pattern after enough time. I'm assuming this is because the rules need to be weighted differently. While optimization is great, I think if I could do this again I'd focus on functionality first and optimization second.

Back to Portfolio