Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Suggestion: Carve Specific NavMesh Surfaces with NavMesh Obstacles

Discussion in 'Navigation' started by aFeesh, Mar 7, 2017.

  1. aFeesh

    aFeesh

    Joined:
    Feb 12, 2015
    Posts:
    16
    Hello, I recently downloaded the Unity 5.6 beta and have been messing with the NavMesh surfaces. They are amazing btw!

    One recommendation:

    It would be super useful if when placing 'NavMesh Obstacles' we could have them carve specific NavMesh Surfaces instead of all of them.

    Right now I want to create a NavMesh obstacle that one of my agents can go through, but the other agent can not.

    I tried messing with the 'IncludeLayers' on the NavMesh surface and disabling the layer the obstacle was on, but it doesn't seem to apply to NavMesh Obstacles, only objects that are stationary.

    Also, if there's already a way to do this. Then please let me know! I've looked around, but can't find anything. Something similar to the 'Nav Mesh Modifier' 'Affected Agents' for NavMesh Obstacles would be perfect!
     
    Last edited: Mar 7, 2017
    Mizzleton, Tricktale and christougher like this.
  2. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    24
    This is something I would very much like to see implemented as well. I've got a specific case where I need the navmesh surface the player controlled agent is navigating, to not have a hole carved by a specific navmesh obstacle, but currently the obstacle carves a hole in all navmesh surfaces it intersects.

    I don't think there's a workaround for this either.
     
  3. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    Ditto! I asked about this same thing not long ago!
     
    aFeesh likes this.
  4. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    There's no workaround for this one - it is noted.
    I'd like to know what is preventing you from using `NavMeshModifierVolume` instead of carving obstacles ?
     
    aFeesh likes this.
  5. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    Runtime carving. For editor baking the two NavMeshModifiers do the trick wonderfully, only setback is the lack of runtime usage.
     
  6. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    24
    As christougher says, I need this for runtime carving. I have an obstacle that moves off of the navmesh and then back on periodically, that requires pathing to be adjusted for everything apart from the player agent.
     
    aFeesh likes this.
  7. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    > For editor baking the two NavMeshModifiers do the trick wonderfully, only setback is the lack of runtime usage.

    They work for runtime baking as well. Is runtime baking not feasible for your case - and why ?
     
  8. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    Well not that run time baking won't be feasible, they would work great for any baking scenario but I'm interested in carving with dynamic, moving obstacles that only affect certain agents. Can't be rebaking the nav mesh every time something moves, especially on mobile. NavMeshModifiers also don't affect LocalNavMeshBuilders that I can see either...
     
    Last edited: May 18, 2017
    IgorAherne and aFeesh like this.
  9. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    ok - so it's a performance problem i guess.
    The `LocalNavMeshBuilder` is supposed to be a simple example of the API, but it can be extended to support modifiers - e.g. similar to how it's done in NavMeshSurface.
     
  10. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    It's really more about getting the same runtime functionality we have from the navmesh obstacle, just expanded to include agent types.

    For my current games I have my nav meshes baked beforehand using NavMeshSurface. I have two agent types and I want certain moving obstacles to only affect one agent type. I'm targeting low end mobile (rhymes with kaizen *cough* *cough*) and higher.
     
    aFeesh likes this.
  11. aFeesh

    aFeesh

    Joined:
    Feb 12, 2015
    Posts:
    16
    Glad this got some traction! Seems I'm not alone.

    @Jakob_Unity when you say we should be using 'NavMeshModifierVolume' instead of Nav Mesh Obstacles, does that mean Nav Mesh Obstacles are considered Legacy? And can the NavMeshModifierVolume do everything a Nav Mesh Obstacle can do? I'll have to play around with them a little bit to learn more.

    Thanks!
     
  12. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
    @Time_Flys - they're not considered legacy. The NavMeshModifierVolume is different in many aspects, one thing it can do, that carving cannot is to change the area type.
     
    aFeesh likes this.
  13. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    342
    Jacob, I am facing large spikes when deploying to mobile device - overall, NavMeshModifierVolume is great, but it requires re-baking entire surface (or even multiple surfaces).

    I really require the surface to span across half of my level, so it's large. I also can't use multiple surfaces joined with links.

    If we compare to what the Obstacle does - it updates surface almost instantly and seems to only affect small region of topology. However, obstacle affects all the surfaces...

    Well, NavMeshSurface does allow to specify bounds when baking, making the procedure quicker. But it kills everything around and only that region survives.

    It would be a real save to have an option to bake a portion of surface (preserving its surrounding, previously-baked topology), similar to the traditional obstactle
     
    Last edited: Feb 24, 2018
  14. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    @Jakob_Unity isn't around anymore. As far as I can tell unity has stopped developing or caring about their navmesh. No one from unity participates in this forum. Regardless many of us have asked for runtime navmesh modifiers but Unity has had deaf ears since even before Jakob disappeared.
     
  15. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    342
    Arghhhhhh @Jakob_Unity come back man

    Well, it would still be good enough if navMeshObstacle would affect a specific navMeshSurface, not all surfaces at once
     
    Last edited: Feb 24, 2018
  16. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    Deaf ears I'm afraid. @adriant care to help clarify the state of navmesh development at unity since you are listed as a navmesh dev? The silence is deafening. In the meanwhile I've used A star pathfinding project pro. Aron Granberg is great and has definitely NOT stopped development or support(unlike Unity?).
     
  17. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    342
    Thanks @christougher I am looking into A star pro - does it support various diameters for agents? So that the big monster won't try to walk through a small door for smaller monsters

    Cheers
     
  18. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    418
    Yes, a similar question was just asked on his dedicated forum. You can do it with a similar approach to unity's by having multiple graphs with different settings. There are also tags and penalties. He's developing a navmesh modifier volume as well.

    http://forum.arongranberg.com
     
    IgorAherne likes this.