Support Forum

JOB system RVO multi floor nav + avoiding walls

Hi,

I finally got the Job version of RVO working with my entities and need help clarifying a few things:

1- I just realized the y coordinate coming out of the simulator is always 0. So I checked the 3D scene. Am I correct to assume all you’re doing to handle 3D is ground the Y of every agent each frame? (The raycast in ApplyMove()).

2- I’m also assuming this means units will try to avoid each other, even if on different floors?

3- I’m having issues with entities being pushed out of the mesh. If I remember correctly, RichAI handles it by telling the RVOController when it hits a wall or gets off the mesh, but since I use the JOB version with thousands of entities, I skipped the controller and use the simulator directly (was that a bad idea?) and I’m a bit confused as to what still works and which code to look at for guidance.

Thank you and get well soon!

EDIT:
Just realized there are parameters I’m not using in the RVO agent, especially the LAYER… how could I miss that. Do all those parameters still work in the JOB version? And do you have auto layer changes implemented anywhere?

Sorry for the late reply.

That is incorrect. The RVO system tracks the Y coordinate of the agents as well. It treats the agents as cylinders, and makes them avoid each other if the cylinders overlap at any coordinate along the Y axis. Just make sure you set the position of the agents correctly.
Modifying the layer field is not necessary for this.

  1. Yes, See (1)

  2. If you have information that the agents have collided with a wall, you can use rvoAgent.SetCollisionNormal to give the simulator that information. It will prevent the agent from moving further into the wall.

No problem, I got around my Y coordinate issue by combining the Y from my ground check, but it’s good to know it’s not supposed to be 0. I have some checking to do.

A few other questions came up:

1-What’s the best way to check if thousands of units are inside or outside the nav mesh? And when units get out of the navmesh do I still inform the RVO sim using rvoAgent.SetCollisionNormal ? (FYI I use the beta / job version of RVO)

2-Since I’m not using your scripts and the RVO Controller, and create RVOAgents manually, is there anything I should know or may have missed about these values that should be set? IAgent - A* Pathfinding Project

3̶-I̶’̶m̶ ̶a̶s̶k̶i̶n̶g̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶I̶’̶m̶ ̶t̶r̶y̶i̶n̶g̶ ̶t̶o̶ ̶a̶d̶j̶u̶s̶t̶ ̶t̶h̶e̶ ̶b̶e̶h̶a̶v̶i̶o̶u̶r̶,̶ ̶I̶ ̶w̶o̶u̶l̶d̶ ̶l̶i̶k̶e̶ ̶t̶h̶e̶m̶ ̶t̶o̶ ̶b̶u̶n̶c̶h̶ ̶u̶p̶ ̶o̶n̶ ̶t̶h̶e̶ ̶t̶a̶r̶g̶e̶t̶ ̶a̶n̶d̶ ̶a̶c̶t̶ ̶m̶o̶r̶e̶ ̶l̶i̶k̶e̶ ̶a̶ ̶b̶l̶o̶b̶ ̶a̶t̶ ̶c̶l̶o̶s̶e̶ ̶r̶a̶n̶g̶e̶ ̶t̶h̶a̶n̶ ̶m̶o̶t̶h̶s̶ ̶a̶r̶o̶u̶n̶d̶ ̶a̶ ̶l̶i̶g̶h̶t̶b̶u̶l̶b̶.̶ ̶I̶ ̶r̶e̶a̶d̶ ̶s̶o̶m̶e̶t̶h̶i̶n̶g̶ ̶i̶n̶ ̶y̶o̶u̶r̶ ̶c̶o̶d̶e̶ ̶(̶c̶o̶m̶m̶e̶n̶t̶s̶)̶ ̶a̶b̶o̶u̶t̶ ̶a̶d̶j̶u̶s̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶b̶e̶h̶a̶v̶i̶o̶u̶r̶ ̶o̶f̶ ̶t̶h̶e̶ ̶a̶g̶e̶n̶t̶s̶,̶ ̶b̶u̶t̶ ̶c̶o̶u̶l̶d̶n̶’̶t̶ ̶f̶i̶n̶d̶ ̶d̶o̶c̶u̶m̶e̶n̶t̶a̶t̶i̶o̶n̶ ̶o̶n̶ ̶i̶t̶.̶

3- (update) I just found RVODestinationCrowdedBehavior is there documentation on how to implement it?

Thank you.

Hi

Sorry for the late reply. I’ve been quite sick these last few weeks.

The fastest way is probably to run var node = AstarPath.active.recastGraph.PointOnNavmesh(myPosition) and keep track of the node (if the agent is outside the navmesh the node will be null). The next frame you can do a faster check by checking node.ContainsPoint(myPosition) and only if that returns false you do a full PointOnNavmesh check. Caching the node the agent is inside will most likely give you a huge performance boost compared to doing a full lookup every frame. If the agent is outside you can look for the direction to the closest point on the navmesh, and use SetCollisionNormal to ensure the agent at least doesn’t move further away from the navmesh.

That’s hard to say… It’s a very vague question. Nothing in particular comes to mind.

Not really. That behavior is pretty experimental (and doesn’t work perfectly all the time). You can check how the AIPath script uses it.

Hi Aron, thank you for the last reply, your help is invaluable as always!

1 Like