I’m doing a simple group movement path test as pictured below:
The brown circle up top is the destination. The obstacles are simple cube meshes. The green agents use a combination of AIPath and RVOController. A recast graph was built with a ‘Character Radius’ parameter equal to 1.5 times the agent radius. I’ve written no custom code in my example.
I’ve tried getting this to work in three ways:
Case #1: Running the example as is. The agents reach their destination, but with many agents, they will start to “tunnel” through the obstacles as they get pushed around by the other agents. This is to be expected as the obstacles only effect the NavMesh, and aren’t doing any real blocking.
Case #2: Putting in RVOSquareObstacles to fit exactly over the cube obstacles. This yields pretty good results, as pictured below:
Case #3: Removed the RVOSquareObstacles from Case #2, added RvoNavmesh components to the obstacles, then rebaked the graph. This doesn’t work, as it blocked my agents from progressing past the first chokepoint. I think what’s going on here is that, as pictured above, the path will “hug” the obstacles, after factoring in the ‘Character Radius’ padding. However, the RvoNavmesh also uses the ‘Character Radius’ to pad itself out. This results in a lock condition where the agent has to be close to the obstacle, but is being pushed away at the same time.
So one way to fix this might be to make the agents follow a longer path further away from the obstacles. I’m not sure how to do this but it’s most likely doable.
Another way is for me to make a custom RVOObstacle that more accurately fits the mesh.
Or maybe I just don’t understand what’s going on … Is there an example I can find that uses RVONavmesh? I wasn’t able to find one in the distribution. But as this is quite a new feature, that is understandable.