How would I make two AIs avoid following the same path to a target?

Hey all. I want to make two AIs work together to hunt down the player, but I don’t want them to follow the same path. I want one AI to chase the player and another AI to try cutting the player off. How would I go about this? Thanks in advance.

hey @TheRealRoboMan0

Im not too great with AI but in my head this would work like this:

AI1 target the player use the shortest route

AI2 get the players position, get his directional vector, determine a location X amount distance ahead and resolve to that world coordinate as a target

Any help?

Stewart

Cutting a player off would take some smart ai. Some of this depends on how much you’re okay with your ai cheating and how much linearity you have in levels.

Consider a simple map that’s a ring, where the player only has two directions to go clockwise or counterclockwise around the ring. This is the simplest case that allows for one ai to cut off the player while the other pursues. As long as one goes the same direction as the player, the other could just circle around the other way. While having an entire level be like this is impractical. Thinking about designing sections of a level like this could help with allowing the behavior to occur in a somewhat natural manner.

To support this you would need to be able to identify when the player is entering one of these ring sections. When the event occurs you could have an ai manager tell one of your ai to run an aggressive follow behavior tree. Then you could have the other one use a find tactical location behavior tree, then when it reaches that point run the same aggressive follow behavior.