How to force AI to keep distance between each other in UE4?

Started by
4 comments, last by G-Dot 5 years, 4 months ago

Hello, everybody! I've got a very simple AI wich is just run towards the player until he reaches him. But the problem is that if it is too much of them they start to run in one line wich is not very interesting. I've tried to solve this problem with use RVO Avoidance set to try in chatacter movement component. But this looking not very great and Actors start to fly on the ground in every directions. So may be there is a solution with EQS, but I don't get it. Or maybe there is some kind of node wich do magic and keep distance beetwen AI actors.

Advertisement

Have you tried something like making them move in random directions, and only attack the player when they see him? The AI I use calculates a random target location inside a particular radius, then using an AIPerception, the AI will move and attack the player only when he is inside the sight radius. You can also put a wait task in there so they do not attack at the same time. It's a kind of a hack to make them attack from different lines but it also depends on how your AIs are set up in your map. 

The problem is that the type of enemy wich cause problem is close combat enenmy. Meaning that he must constanly run to the player and when reaching a specific distance he starts to attack player. And he will always run towards the player, even if he cannot see him.

Did you try Detour Crowds? I found a tutorial on it:

 

 

No, I don't heard about this. I've tried it and yes it solved my problem immediatley! Thank you very much.

This topic is closed to new replies.

Advertisement