For this project we are working on, the AI pawns are designed to move to waypoints that we place. They have RVO avoidance to avoid each other, but as a result, a crowding bug occurs. This occurs because AI pawns cannot get to the waypoints they want to get to, either because too many pawns have their RVO radius blocking the path entirely or because they are moving to the same waypoint but cannot for the same RVO radius reason.
As shown, the pawns are moving towards the waypoint that lies near the doorsteps of the house. They get stuck because again they are moving to the same waypoint but cannot reach it. Even if they did reach it, they would get stuck again trying to get out because the other pawns and their RVO radiuses are blocking their path.
A few fixes I believe could work and I’m modifying include increasing the acceptance radius of the target waypoints to moveTo within the behavior Tree of the AI Pawns and reduce the Pawn’s RVO radius.
Another bug/undesirable side effect we are having is because of these tight corners, sometimes the AI Pawns are pushed out of the navMesh into the houses, which are destructible meshes and they destroy them by moving straight through them. This could be a problem related to force exerted by the Pawn, but they shouldn’t even be pushed out of the NavMesh; the houses are blocked by Nav Modifier Volumes, yet they can do destroy buildings that only the player can destroy.
The pawns did this, not the player. I don’t know how to approach fixing this particular bug of pushing themselves out of the Mesh, let alone having them destroy the meshes by running into them.
Any help would be greatly appreciated. Thanks.
To start from the end, RVO doesn’t care about navmesh and that’s a “feature”. If you use that then you may end up with AI being pushed out of navigable space.
The “Someone’s standing on my goal location” avoidance problem is a tough one and it’s not really solvable on the simulation level - this requires higher level logic like pinging that other someone to move away since he’s standing where someone else needs to go. Increasing radii and in general being more forgiving in terms of goal reaching is definitely a good thing to do, regardless of higher level solution.
Have you tried using Detour Crowd integration we have? To enable it your AIControllers need to use
CrowdFollowingComponent rather than
PathFollowingComponent (currently this is doable only via C++), or just derive your
AIController class from
DetourCrowdAIController. Remember to disable to RVO on characters if you choose this route - these two do not cooperate.
Hope it helps.
I’ll give it a shot. Deriving from DetourCrowdAIController via blueprint is ok, followed by setting the Pawn blueprint to use that controller.
Also, do you know why the buildings get destroyed an AI Pawn runs through it. I’m working on AI so I’m not clear on this part while other team members are responsible for the destructable meshes but we don’t know why this happens if the pawn gets pushed out of the navmesh and tries to move back into it and destroys the building in the process on its own. Is there some force component of the pawn that is doing this?
After a bit of thinking, I want to ask how exactly is CrowdFollowing different from PathFollowing? We may stick with PathFollowingComponent as our AI Pawns have their own target waypoints to move to individually rather than a group. We may think about putting them as groups however.
From your tutorial site, I see how to enable the CrowdFollowingComponent over the PathFollowingComponent, but I don’t see a real tutorial on what it actually does, or rather the differences between the two.
I believe the ‘CrowdFollowingComponent’ is just a confusing name, and is not meant to imply that it be used only for when AI should move in groups. It’s simply a different algorithm for avoidance - instead of PathFollowingComponent + RVO, you just use CrowdFollowingComponent.
It’s clearly a more flexible algorithm giving you more control, however it’s also entirely undocumented and I haven’t been able to find any example use anywhere. It’s built on Recast/Detour, for which there is an API reference here. That might help if you want to dig into it. I personally found the behaviour with the default configuration was giving me problems, so I’ve disabled it and am waiting for some UE4 specific documention or tutorial.
@MieszkoZ Thank you for your explanation, it helped me a lot!! In the character class, I selected the Detour class as the default AI, I attach a picture to explain what I did.