Driving Subprocessors - MegaPunkGames/MegaBoidsDemo GitHub Wiki
Driving subprocessors are aptly named since they are meant to provide conscious driving forces. Steering forces by themselves leave you with a pack of useless, floating entities since nothing is driving them forward. In nature, birds flap their wings and fish wag their tail to move forward; they have some mechanism to produce a propulsion force. The driving subprocessors are meant to provide both steering and propulsion.
Steering and propulsion forces are different because there is no restriction on the direction of propulsion forces whereas steering forces are limited to the YZ plane. Propulsion is not limited to the forward direction because living being can also strafe or jump sideways. Therefore, we do not want to limit these forces to a single direction and it will be the movement model's responsibility to handle this properly. We also do not want to restrict where you define these forces because some are part of the basic movement of the boid but oftentimes it's environment or use-case specific. Therefore, you can determine driving subprocessors on both the data asset and on the spawner.
On the boid config data asset, you will find a list of driving subprocessors. These define the idle, or default, forces to apply to your boid. You will want to avoid subprocessors that require environment data, like a spline to follow, or those that involve coordination between different boid configurations. Those would be specialized driving forces, but most entities in a group have some form of basic movement. Butterflies flap their wings aimlessly, bunnies jump at irregular intervals, etc. As a general rule, you do not want to have too much movement in your idle forces because it makes specialization harder. You should also aim to have some level of noise or randomness to make it feel more natural. Be creative, you have the tools within MegaBoids to create complex movement!
Once you have defined an acceptable basic movement for your entities, you might also need to give them environmental context. Doing so requires references to actors or components in your level. Therefore, it needs to be setup in the level too and the proper location turns out to be the MegaBoids spawner actor.
Specialized driving forces can be applied to all your spawner configurations or only to some of them. To configure which boids get which subprocessors, you can use the configuration selector that is attached to every specialized driving subprocessor within the spawner.
Note that we take no precautionary measure to ensure you only use specialized subprocessors in the spawner and vice versa. The reason is that you might want some basic driving forces to only apply in a specific level, but also because we trust you to be intelligent and not add a subprocessor requiring a reference you cannot set inside your data asset. We might change that in the future for clarity.
MegaBoids provides a number of driving subprocessors out of the box, see the list below. To create your own, see the technical reference
Important
More driving subprocessors will be developed as we move towards Beta and final release. Feel free to contact us with your requests. This valuable feedback will drive our efforts and is one of the reasons we are releasing in Alpha.
Subprocessor | Details | |
---|---|---|
Constant |
Constant, uniform force Properties |
![]() |
Impulse |
Provides a single frame of randomized force when the selected trigger is activated. Properties (for each element in list) |
![]() |
Burst |
Static force applied every frame after the trigger is activated, for a random duration. Properties (for each element in list) |
![]() |
Random Forward |
Random force applied in the boid's forward vector direction. Properties |
![]() |
Follow path |
(Specialized) Reach a point moving on a spline. Properties |
![]() |
Leader | Marks the boid as a leader, to be followed by boids using the 'Follow the Leader' subprocessor. |
|
Follow The Leader |
Followers will look for neighbors that are tagged as leaders and will follow them. Requires at least 2 boid configurations on the spawner. Properties |
![]() |
Sequence |
Linear/Sequential state machine. Goes from state to state applying the provided subprocessors. The boid will switch to the next state when the trigger gets activated. Loops back to first state after completing the last. Properties For each state: |
![]() |
In the above driving subprocessors, many use a trigger to determine applicability or to activate an action. Triggers are a general purpose mechanism which evaluate some state and return an activation boolean (true/false). They can be used for various situations to trigger behaviors in your boids, like changing the state of a driving subprocessor. MegaBoids provides multiple triggers out-of-the-box. To create your own, see the technical reference.
Important
More triggers will be developed as we move towards Beta and final release. Feel free to contact us with your requests. This valuable feedback will drive our efforts and is one of the reasons we are releasing in Alpha.
Trigger | Details | |
---|---|---|
Delay |
Waits for a random amount of time to pass before triggering once. Properties |
![]() |