Download

AI Problem (Awareness of NPC's lacking, AI blocking each other)

Not tested this to much, but it seems that my AI is not aware of other AI. Besides overall good results with navigation on a map for single AI, when you get more AI (NPC’s - None Player Characters), often they block each other.

Question:

Are there certain settings to avoid AI block each other?

If there is a solution, how would you implementing it into Behavior Tree?

Hello,
In your character blueprint, Avoidance : check “use RVOAvoidance”

Thanks man!

Getting AI to not block each other is kind of a ***** of a problem to be frank, the problem becomes greater the more AI you have in a scene or the smaller the passageways they have to navigate (RTS’s as an example). Use RVO Avoidance is one way to help, but be aware it might look kind of funny, and also the way it works can force the AI to push each other out of the navmesh if there isn’t any invisible walls to stop them. The other builtin-method is using a DetourCrowd controller which doesn’t work with RVO, is more performance-heavy, but will obey the navmesh. I’d try both methods out to see which one works best for you. E.g. if I were to develop a game with RVO avoidance as the primary method, and a lot of AI has to pass through doorways, I’d make the doors atleast double in size/large enough to allow at least two of them to pass through it.) RVO Avoidance tends to produce a sort of “bumper car” effect.

If that’s not enough for your particular needs, you can look into trying to implement a verison of Boids, also known as a flock behavior algorithm, though it’ll require more work in understanding how to set it up so it works correctly in blueprints versus UE4’s built-in solutions. Boids - Wikipedia

You can also perhaps do tricks such as adding a navigation mesh modifier to a character with a radius, and set it to be a very expensive area cost if your navigation is dynamic. If you set it to be area_null, the pathing simply wont work as the AI will be surrounded by null, but theoretically a high cost area instead should still allow the AI to navigate, while the other AI will avoid passing through another AIs space due to the highcost of navigation that surrounds it. (As a tip, you can actually make custom navigation area cost blueprints)

And you still can do other tricks, such as having a periodic raycast from the AI that for example, points slightly in its forward direction. If it strikes another AI, have one of the AI stop moving, and order the other to move to the left/right of it etc. You’ll notice this kind of trick used heavily on AI followers in games like Fallout4, which while not perfect, detects if the player bumps into a follower and basically orders the follower to try and move backwards; hopefully out of the players way.