I’ve been working on a top down camera game with multiple character selection where the characters move using the navmesh feature. It works well unless multiple characters try to move at the same time, when it breaks down since each character does not consider the movement and position of the others. I found a similar question here:
Where the answerer ue4-archive suggests that there would be a feature in release which solves this problem. I’ve tried to find information on this both online and in the source / docs but to no avail. Is this feature available now? Was it maybe scrapped before release? or is it still being finalized?
I could try to some kind of implementation myself, but if this exists / is on its way, I’d obviously rather wait and use it instead
There already is simple RVO avoidance implemented in engine, available for all actors using CharacterMovementComponent. To use it, set bUseRVOAvoidance flag to true in pawn’s constructor (turning it on after components are initialized is bugged right now).
You can adjust avoidance details with AvoidanceWeight, SetAvoidanceGroup(), SetGroupsToAvoid() and SetGroupsToIgnore() - where groups are used as set of flags (e.g. my group = “team 1, heavy”, avoid = “team1, team2”, ignore = “cloaked”) and basically agent A will try to avoid B when any flags of B.group is on A.avoid mask and none of B.group is on A.ignore. In most cases you don’t need to touch it and it will just work with all agents avoiding each other.
Only downside is, that avoidance doesn’t care about underlying navmesh and you can end up with AI agents getting pushed of cliffs, etc.
Detour crowds integration is currently being finalized and should be available soon (probably in 4.3 release).
Weird, I was writing about crowd stuff for update notes, but for some reason it’s not there. Anyway, code should be available to use.
In most cases all you need to do is replacing PathFollowingComponent’s class to CrowdFollowingComponent. Unfortunatelly, it can’t be easily done for blueprint only project (although from what I’ve heard, blueprint team is working on feature to replace native components).
(can’t really paste code sample here, no idea how to make it display triangle brackets correctly )
Additional info in AIModule/Classes/Navigation/CrowdManager.h and AIModule/Classes/Navigation/CrowdFollowingComponent.h.