Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    35
    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
  2. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    42
    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:
    558
    Ditto! I asked about this same thing not long ago!
     
    aFeesh likes this.
  4. Jakob_Unity

    Jakob_Unity

    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:
    558
    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:
    42
    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

    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:
    558
    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

    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:
    558
    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:
    35
    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

    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:
    393
    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:
    558
    @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:
    393
    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:
    558
    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:
    393
    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:
    558
    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.
  19. TheGamery

    TheGamery

    Joined:
    Oct 14, 2013
    Posts:
    94
    2.5 years later and still nothing, I guess Unity devs are working on the stuff for the IPO rather than their customers...
     
  20. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    393
    Just buy AStar PRO asset man. I didn't want to, but regret I didn't do it earlier
     
  21. TheGamery

    TheGamery

    Joined:
    Oct 14, 2013
    Posts:
    94
    Unfortunately it would require re-writing a large portion of my project, I managed to make some workarounds so the current situation is more tolerable, adding triggers to 'obstacles' and manually telling the AI to stop/wait etc.
     
    Last edited: Sep 21, 2020