This is a Boids-inspired fish system running in a single Niagara Emitter, designed to be easy to use and performance-efficient. The project was developed over the course of four weeks part-time, from the first iteration to the final product.
My main goal with this project was to deepen my understanding of Scratch Pad Modules in Niagara, as they offer a lot of potential once you've mastered them. I wanted the system to truly serve its purpose more than just being a good-looking tech demo and I believe I succeeded in that task.

Niagara Emitter

The fish swim by generating a target point in space and moving toward it in a "rubber band" fashion. They must first turn to face the point before accelerating toward it, creating a more natural, fluid motion.
At the core of the system, each fish follows two target points: one unique to the individual fish, and one shared global point used by all fish. The fish switch between these points based on whether they should swim independently or as part of a flock.

Finding new target points and swimming toward them

I've implemented "distance fields" in Unreal to allow the fish to scan their environment and avoid obstacles. The system works by having each fish check for the nearest surface—if a surface is too close, the fish simply swims in the opposite direction and abandons its initial path. Despite the simplicity of the behavior, it actually works surprisingly well when navigating through crevices and similar tight spaces.

Visualized avoidance

Navigation through crevices

Unreal Engine has its own built-in LOD system, but I felt it didn’t quite meet my needs—it either culled too early or didn’t behave as expected. So, I decided to create my own custom system using a Scratch Pad module. This setup dynamically switches the fish mesh based on the camera's distance, giving me more control and better visual results.

Fish LODs

I wanted to experiment with having the fish swim away from threats, with the player being one of those threats. The idea was to tag actors as "threat" so that the fish would react accordingly. Although I encountered some challenges in getting it to work perfectly, I managed to have the fish at least swim away from the player.

Fishes fleeing from the player

I wanted the system to be as intuitive as possible for anyone to use, so I added a wide range of parameters to give users full control over its behavior. I’ve shared it with a few people, and they’ve all been able to use it easily and effectively for their own purposes. The system was used in Kajsa Rickling's Zoo Project, specifically for the aquarium segment of her level.
The caustics and water shader were created by Karim Abou Shousha,
Artstation: https://www.artstation.com/artwork/9NDqvW
Youtube: https://www.youtube.com/watch?v=nuOCcw0i9ms
Back to Top