Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

C# wrapper for RVO2-3D Library?

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

  1. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    130
    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:
    135
    Hi Brian, Did you ever come up with a solution or find a wrapper for this?
     
  3. crandellbr

    crandellbr

    Joined:
    Apr 3, 2013
    Posts:
    130
    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:
    3,356
    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:
    7
    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:
    3,356
    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.
     
  7. gayoso

    gayoso

    Joined:
    Mar 17, 2016
    Posts:
    10
    Hey! I was setting up to try out your ORCA implementation but I'm getting an error on a missing function from the Collections package (ContainsKey() on NativeHashMap<>). I don't use the package manager much, but I noticed there are several different previews for the same version of Collections and the other pacakges. Do you know which preview version you are using? The Collections changelog wasn't much help.