Implementing agent avoidance
It comes as no surprise that, most of the time, you will be working with more than a single agent in a level, and this means there will be a high probability that they will have crossing pathfinding rules; this means that your poor AI entities will be at a significant risk of colliding with each other. As funny as it may be, I guess that’s not the intended behavior in your game.
That’s why Unreal Engine provides an out-of-the-box – but disabled by default – avoidance system. In this section, we are going to consider how to make AI agents avoid each other.
As always, we will start with a brand-new gym.
Creating the level
As a first step, we will need a gym with some obstacles around. To get started, do the following:
- From the main menu, select File | New Level.
- Navigate to the
Maps/LevelInstances
folder and drag an instance of LI_Lighting inside your level; set its transform Location value to(0,
0, 0)
...