A realistic flocking simulation featuring 80 custom alien fish — each one an independent agent following Boids rules that together produce the emergent, coordinated schooling behavior of a living creature.
This project implements the classic Boids algorithm — a set of three simple rules that, when applied to a group of agents simultaneously, produce the complex, organic-looking flocking behavior seen in schools of fish or flocks of birds. It was built as a solo PCG course project with the added challenge of custom agent visuals and scalability.
The simulation runs 80 custom-designed alien fish agents (single large eye, smooth animated tail, inspired by Subnautica) and is architected to scale to hundreds of agents — requiring an efficient spatial awareness system rather than naive O(n²) neighbor checks.
Core Boids BehaviorsImplemented all three foundational Boids rules from scratch: separation (agents steer away from neighbors that are too close), alignment (agents match the velocity of nearby neighbors), and cohesion (agents steer toward the average position of the flock). The interaction of these three rules alone produces convincing schooling behavior.
Wandering ComponentAdded a wandering force that gives each agent a small, smoothly varying random steering impulse — preventing the flock from settling into rigid, repetitive formations and maintaining the organic, unpredictable quality of real animal movement.
Fake Fish Perception SystemImplemented a custom perception cone system that limits each agent's awareness to neighbors within a configurable field of view and radius — mirroring how real fish sense their environment. This also serves as a key optimization, dramatically reducing the number of agents each fish needs to consider per frame.
Custom Agent DesignEach of the 80 agents is a custom-modeled alien fish with a large single eye and smooth procedural tail animation — showcasing that agent-based simulations don't need to sacrifice visual quality for technical depth.
Scalable ArchitectureThe simulation was engineered to scale efficiently to hundreds of agents, making it applicable to real game scenarios — e.g. ambient wildlife in an underwater level — rather than just a demo.