This was a project in creating C++ classes In unreal. I created an Actor that used a boid system to move meshes. The challenge was to create a standard boid swarm, then modify it so that it appeard to move like insects.
The challenge in this is to make the boid object not factor in this was to update the parameters; a standard boid system uses the three parameters, of seperation, alignment, and cohesion, but these allow birds to flock; Insects have a sporatic patten of movment, unorganised, but still forms emrgent grouping behavior.
Here we can see the Insects have a swarm "Center" : this center has a rotational pull the farther the insects get away from it.
This video shows a standard boid movement, with the three parameters working togeather to create uniform, aligned movement in a direction. moves well, but not insect-like
There are a lot of papers trying to simulate this phenomenon. However, in this case the best solution was to me, the easiest; since insects are different, they need different parameters. In this case, the alignment parameter was removed, and the strength of other parameters modified.
Additionally, it is obsereved that insects have different objectives in a swarm; they are typically looking for mates, and trying to stay close togeather so as to be fivislbe to other insects farther away. Thus, a goal parameter and a swarm parameter were introduced. The goal was another insect within the swarm; the swarm reference the swarm center. Insects would move toawrds these elements while maintainting the cohesion and seperation from before. Small other rules also updated the strength, such as moving too far away from the center forced the insect to obey only the swarm goal
Here we can see the boid center moving as the mean position of all the insects. Moving out of its radius makes the insect return.
Showcasing exposed variables from the C++ class. You can modify the boid inputs as well as the container boxes size/visibility.
This project was usful in learning actor coding/construction in Unreal; to expose and make things work in the interface, different properties had to be set at different stages. This was a very fun project and I liked the result so I posted it!
An example of implementing parts of an actor at different stages.