I developed Rat Horde in Unreal Engine, a personal project that allowed me to refresh my knowledge and gain a better understanding of how to program complex behaviors in Niagara. This project showcases the incredible potential and versatility of Niagara, which can be used for various purposes, including driving gameplay logic.
The Rat Horde simulation I created features various states for each rat, a Level of Detail (LOD) system, and vat animations. The rats interact with the player and also check for nearby light sources in the surroundings, avoiding them.
It is not only visually engaging but also cost-effective in terms of performance, considering the number of particles spawned.
The system uses Niagara for GPU particle simulation. Rats in the system detect and avoid the player and lights. They can be killed by stomping or shooting. [SOUND ON]
A state machine has been developed in the Niagara system, utilizing GPU parallel processing to enable thousands of actors to exhibit unique behaviors at a low GPU cost.
I added a simple minigame to the system. Only one white rat spawns, and we can create unique gameplay logic from it. No Particle Persistent IDs have been used.
The system has four available rat mesh LODs. LOD 0 uses Vertex Animation Textures (VAT) to animate the rats. The higher LODs apply World Position Offset (WPO) in the shader to reduce rendering cost for distant rats.
The systmem reads the location and radius of light sources, and as a result, the particles tend to avoid those areas.
The system is pretty flexible. It took me a couple of minutes to modify the behavior of the rats in order to make the horde crawling out from a sewer.