As you can see in the picture, the agents in the top left corner of the screen got stuck on the square RVO obstacle.
I wish to use RVO obstacles to block NPCs runtime when there is some dynamic obstacle getting in their way.
I though that might be cheaper (performance wise) solution to do that, cheaper than runtime nav mesh carving at least. Stuff is moving almost all the time in the game. I also want the agents to push the obstacle in case they actually have no other choice than to go through (rather than get stuck in a dead end hallway for example). This is another reason why the RVO obstacles are (I believe) a better approach than a NavMesh cutting.
Does this seem like a bug? Did I do something wrong? Is that by design?
Is this even a good approach I’m taking?
If this behavior I’m seeing seems alright to you and you think this is a correct use of RVO obstacles - should I then just do some “agent is stuck” checking and subsequent repathing? (though it will probably not work very well, since it seems pathfinding ignores RVO obstacles in the first place as the one in the example picture is static and the path leads straight through)
I hope my rumbling makes sense If not, I can rephrase. English is not my first language.
EDIT: Tried the latest beta version, 4.3.11. Could not test it since SimulationBurst::AddObstacle method throws NotImplementedException. Besides that, I also noticed that NPC agents RVOs now almost never avoid player custom RVO (implemented based on ManualRVOAgent.cs). They mostly seem to ignore it. All settings and everything are the same as when I was using the latest stable version from the Asset Store.
EDIT2: Also due to the NotImplementedException from the first EDIT the NPC agents are leaving the navmesh due to avoidance. That happens since the RVONavmesh component can’t add the necessary walls/obstacles.
EDIT3: Also regarding the first EDIT, I found out what’s probably the cause of the issue of RVOAgent <> ManualRVOAgent interaction/avoidance. SimulatorBurst.Agent::ForceSetVelocity has two TODOs. So just my bad luck with encountering unfinished BETA stuff I suppose
EDIT4: I should also mention that the NPC agents are based off of the RVOExampleAgent class.
I solved it… my fault… I noticed there is more to RVO than just attaching the RVOController component. The RVOController component doesn’t actually call the SetCollisionNormal method which seems to be paramount in such cases as illustrated in my screenshot.
Solution is to use a movement script that call the SetCollisionNormal method like RichAI for example. Or call it yourself obviously.
One more thing I noticed. In my case the RVO quality (agent to larger obstacle) seems to be (HEAVILY!) influenced by NavMesh tile size. The smaller, the better. When it’s too large, the obstacle avoidance can actually break completely and in combination with root motion (using MecanimBridge component) the agent can at least sometimes walk straight through the obstacle, not even seemingly trying to avoid it. Just walks right though it.
This came as a surprise to me. I thought RVO is quite simple and doesn’t care for NavMesh node at all. But it seems (from my observations) that repeating repathing in combination with RVO improves the obstacle avoidance. That pathfinding perhaps even takes RVO obstacled covering nodes into account. But don’t take my word for it, these are just my random observations. I just know that NavMesh tile size plays major role in RVO obstacle avoidance in my case.
Only the legend (the one and only @aron_granberg) can shed some trustworthy light on this.
EDIT: Let me add one thing. I have huge experience with unity native NavMeshAgent behavior, RVO, NavMeshes, NavMeshComponents etc. A* Pathdinding Project lets you tweak and customize so many things. Also the RVO seems to be more advanced. Unity NavMeshAgent RVO easily leads to stuck agents. That didn’t happen to me with A*PP. I love this asset. Literally must have. Like literally… you can’t achieve almost anything with the native navigation. Workaround here, workaround there, no access to source code, just a few properties to control stuff… bad docs… can’t make it run in FixedUpdate without making RVO behave like crazy in the process…
In summary - I will never go back to the native navigation