Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

C# wrapper for RVO2-3D Library?

Discussion in 'Navigation' started by BrianCrandell, Dec 22, 2018.

  1. BrianCrandell

    BrianCrandell

    Joined:
    Apr 3, 2013
    Posts:
    62
    Hello. I'm experimenting with A*, navmeshes, RVO2, and Recast to see if I can replace Unity's native pathfinding. The RVO2 Library was surprisingly easy to get working, mainly because I'm using the C# port. Unfortunately, this version of the library is 2D only, and they don't have a port of the 3D version. Is anyone aware of a C# wrapper for RVO2-3D? It would save me some time and probably be safer than porting it myself (my C++ is rusty).
     
  2. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    89
    Hi Brian, Did you ever come up with a solution or find a wrapper for this?
     
  3. BrianCrandell

    BrianCrandell

    Joined:
    Apr 3, 2013
    Posts:
    62
    No, unfortunately not, since I shifted focus to other projects. When I need 3D avoidance again, I expect I'll have to hire a programmer more qualified in C++, unless someone else makes a wrapper available first.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,476
    FYI as I've been implementing this for our own game.

    First off you can't use a third party RVO with the standard api if you want to do it right. You must use the experimental api's. Why is because navigating over a straight path involves using lower level api's to navigate it a bit at a time, since the straight path is in 2D. With the standard api Unity handles this for you, with the experimental api's you handle it yourself.

    For RVO I took the approach of simply doing a clean implementation and used the new Unity.Physics. Using capsule colliders and distance queries, but still moving everything manually. You don't need a physics engine but Unity.Physics just happens to have a really fast BVH so getting neighbors is really cheap and it makes the 3d part automatic pretty much. Agents separated by floors or whatever get filtered out by the physics queries so you don't even have to reason about 3D per say.
     
  5. Nebukam

    Nebukam

    Joined:
    Jun 6, 2014
    Posts:
    6
    When you say 3D, do you mean actual, three-dimensional avoidance simulation (velocity calculation accounting all three axis) or 3D as in "Z instead of Y" ? I know that sounds like a silly question but RVO2-3D does not support obstacles, so it would be only agent-agent simulation.

    I did my own port of RVO2 using jobs & burst, and didn't bothered with the 3D version due to the absence of obstacle support, but the calculations are almost the same.

    Using Unity.Physics for neighbors finding & filtering out surroundings is actually a really neat approach !
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,476
    Ya by 3D I mean being able to filter out agents that couldn't be obstacles to each other due to static geometry. The logic is all 2d.