Flocking! (Plus Obstacle Avoidance)
This was my second assignment for my advanced Ai class where the goal was to integrate flocking to work well with the obstacle avoidance that we learned last week. This weeks implementation was a lot better for me in terms of completion because of my discovery of scriptable objects. Using the scriptable objects, it made organization of the individual flocking algorithms (Avoidance, Alignment, and Cohesion) much easier since everything is located in the Unity inspector. Now the normal combination of these three does create a flock its not the most appetizing to look at, so, making the cohesion smoother using the Vector2.SmoothDamp function makes it much more appealing to the eye. As for the obstacle avoidance, labeling the obstacles with a obstacle tags makes it easy to track them and have the avoidance script reused and called on the boid when it comes near a obstacle. more is explained in the video below!