Implementing Crowd Flows

Hi there!

I am working on a RTS-style game and am looking into different options on unit flocking/local avoidance/steering/etc… I cam across this Crowd Flows in my search for different solutions or algorithms. I was wondering if this would be something I could implement with UE4. And if so, would I be unable to use navmesh? Also are there any different solutions that would be more simple to implement in UE4?


I think there is basic crowd support

Of course you can integrate your favorite solution, but might be quite some work :wink:

UE4 comes with an implementation of dtCrowd (Detour, see: )

More info here: dtCrowd | Unreal Engine Documentation

I haven’t really looked that much into it, but I think having a closer look at the CrowdFollowingComponent is a good starting point.

By default an AIController only implements a PathFollowingComponent for movement. Adding and/or replacing it with a CrowdFollowingComponent should get you started.

The UCrowdManager class provides an interface for managing the crowd (adding/removing agents, setting targets etc.)

Looking into these classes should get you started.

I have tried using detourCrowds, but units always slow down a ton whenever they get near each other(not even very close). This then causes an issue because I have my units set up to move out of the way if their are close enough(checking if a overlap only capsule component I have on each pawn is overlapping), because the units slow down to a crawl near other units, these capsules never overlap and my units no longer move out of the way for each other. But I do need to have something there for when units are weaving through each other or if they are moving around units set to a halt command.

With units you mean agents, I assume?

Without seeing your implementation it’s hard to give some further advice.

Yes, by units I mean agents. In the context of my game I call them units, sorry about that. Currently the detour crowd implementation is set up just like the wiki page suggests, I haven’t changed any settings. But when an agents moves towards another agent it sometimes will slow down to a very slow pace, which is not something at is intended in the game. Are there any settings I can change to keep that from happening?