
Descripción
Flock Boid is a flocking plugin for Unreal Engine 5.8 that simulates birds, schools of fish and insect swarms as boids. Static mesh boids run on the GPU in Niagara, and skeletal mesh boids on a multithreaded CPU solver. Setting up a flock needs no Blueprint or C++.
Each kind of flock is a Flock Config data asset holding the mesh, speeds, flocking weights and how many flocks of how many boids to keep around. Place a Flock Spawn Point or a Flock Spawn Volume, assign one or more configs, and the spawner keeps flocks alive inside its area. Flocks fade in and can be given a lifetime, after which they fade out and are replaced. A spawner can also remove its flocks while every local player is out of range, and it streams in and out with World Partition like any other actor.
On the GPU path the game thread does little more than upload which flocks are alive and the obstacles and influences they react to. That work does not grow with the boid count; the simulation itself runs on the GPU. Skeletal mesh flocks are spread over worker threads and draw as one instanced skinned mesh, or as one skeletal mesh component per boid whose play rate follows that boid's speed. Where Niagara GPU simulation is unavailable, static mesh flocks drop to the CPU path on their own, and a config works the same on either path apart from the GPU's four-material-slot limit.
Boids follow separation, alignment and cohesion within a field of view, wander a little, bank into turns and stay within limits on climbing and diving. Obstacle components keep them away from objects, and influences attract, repel or orbit them. Eight channels decide which flocks react to what, so a repeller can scare the birds and leave the fish alone.
GPU and instanced CPU flocks pass each boid's animation phase, speed, bank angle, a random value and a tint to its material, and one material function reads them on both. Phase can drive a World Position Offset wing flap, or the playback time of vertex animation textures, for example from Epic's AnimToTexture plugin. With Play Rate At Max Speed above Play Rate At Min Speed, faster boids animate faster. Neither needs a skeletal mesh, which lets an animated flock stay on the GPU.
The plugin ships C++ classes, a Niagara system and module, a material function with an example material and three sample configs for birds, fish and insects. The samples use the engine's basic shapes, and no creature meshes are included. There are no Blueprint assets; spawners, obstacles and influences can be controlled from Blueprint, and spawners and flock components fire events when flocks spawn and leave.
Features
GPU flocking in Niagara, and multithreaded CPU flocking for skeletal meshes and as the fallback
Separation, alignment and cohesion with a field of view and a neighbour limit, plus wander, banking into turns, and limits on climbing and diving
Flock Spawn Point and Flock Spawn Volume actors, and a Flock Spawner component for any other actor, including moving ones
Spherical or box areas with soft containment, spawning anywhere in the area or around its centre
Several flock configs per spawner, with per-spawner overrides of flock count and boids per flock, and fixed or random seeds
A population that turns over: flock count and size ranges, lifetimes, respawn delays and fades
Despawning by distance from the local players, with hysteresis
Sphere and box obstacles, and attract, repel and orbit influences with an optional panic speed-up for repellers, filtered by eight channels
Three CPU render paths: instanced static mesh, instanced skinned mesh with phase-shifted animation tracks, or a skeletal mesh component per boid
Per-boid phase, speed, bank, random value and tint for materials, read by one material function on GPU and instanced CPU flocks
Data validation for configs: missing meshes or animations, inverted ranges, missing material usage flags, Nanite meshes without a fallback mesh
FlockBoid.CountScale scales boid counts and can be set per scalability level; FlockBoid.ForceCPU keeps every flock on the CPU
Editor visualizers for spawn areas, obstacles and influences
Blueprint events when flocks spawn and leave
Important Notes
Flocks do not trace against level geometry. Anything they should steer around needs a Flock Obstacle component or has to sit outside the flock's area.
Nothing is replicated. Every client simulates its own flocks, and players do not see the same boids in the same places. Dedicated servers spawn none.
No creature meshes or animations are included, and there is no demo map. The sample configs use the engine's basic shapes.
Flocks spawn on Begin Play. They appear in Play In Editor and Simulate, not in the editor viewport.
GPU flock state cannot be read from gameplay code. CPU flocks give C++ access to their boids' positions and velocities.
GPU flocks use at most four material slots.
Niagara does not draw a Nanite mesh that has no fallback mesh. Enable the fallback or run that flock on the CPU.
Materials need the usage flag for every path they can be drawn on, and GPU configs also need Used with Instanced Static Meshes for the CPU fallback. The editor sets a missing flag by itself, but a cooked build draws the default material instead.Win64, Linux and Mac. GPU simulation needs the SM5 feature level or higher and Niagara GPU particles; without them, flocks run on the CPU.