Antibody Behaviors

Anibody Behaviors

General Antibody Movement
Although there are two types of antibodies in the game, their movement behavior should be the same.
 * Flocking/Patroling
 * When the player is near, they should swarm the player and tag the player for the Macrophage.

Idle/Patrol
The center of the flock should just be a game object with no mesh. The only thing that it will do is move about through waypoints (not illustrated). The antibodies are their own game objects and they have a script that contains a reference to the flock center. Every so often, they should be trying to aim and move towards the flock center as the flock center moves. Effectively, we should have a script for the flock center and a script for the antibodies.

Pursue


Pursuing is defined as moving towards a moving object. As such, it is not as simple as just subtracting two vectors together. Instead, this function calculates where its target is going to go next based on its target's current movement vector.

The antibodies should just always be pursuing, whether what they are pursuing is the player or the center of the flock. When the player is not near, they should just be pursuing the center of the flock. When the player is near, they should be pursuing the player.

To make the antibodies smarter, before they pursue the player, they should shoot a raycast out towards the player to see if they are even near enough and for a few seconds return to pursuing the flock center.