Ai move to Ai

Hi, I was wondering how to make an AI move to another Ai. Not another player. Also, if there are multiple of the same Ai to chase, how does it decide which one to go after? Thanks so much.

-PRISM

It depends on the situation you are trying to emulate. Here’s a GDC talk from the developers of Sunset Overdrive talking about things they did.

Depending on the situation, the actual implementation details can range from being an afternoon’s work to taking a year. So, defining your goals is the most important thing to do first.

If you haven’t already check out this guide:

https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/

The logic for a ‘Follow AI’ or ‘Move to AI’ task would be very similar to this part:

https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/12/index.html

Your AI’s Blackboard may need to store a different type if your intended AI target class is different from your PlayerCharacter class. The general idea is the same though.

If you want more in depth on the basics, you might want to pick up an UE4 book like Unreal Engine 4.X by Example, from Benjamin Carnell. It has a similar tutorial to the one linked above with a little more in depth explanation.

Or check the web! There is bound to be a blog out there, going over Tasks and using Blackboards to set targets and remember other values.

The logic for a chase AI will be more complex, and as CDMc said will be highly dependent on other context in your game