AI Attacking each other
Author: Hayden Rodgers
This week when working with the AI with multiple of the grunts in the scene they would attempt to attack each other instead of going after the player character. The AI would only register the first entity that would enter the radius. This was causing issues for that the AI would not attack the player unless it was alone or the surrounding AI had been killed.
To fix the issue I had to add in the ability for the AI to register teams. With the team register the AI would look to see if the target that entered their range was a hostile or a friendly. This change helped to have the AI detect the player but there was another issue with the fix. The AI could register the player but do to having a large amount of AI within a scene they would eventually not be able to attack the player due to it detecting a high amount of friendlies near by. To fix this issue I had to implement a bool where the AI would check to see if it had seen the player, making it true if it had sensed the player. This allows for the AI to chase the player upon detection and to ignore the fellow AI by it.
With the fixes it now allows for this situation where the player can be chased by multiple AI
Comments
Post a Comment