Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Official Experimental AI Navigation Package

Discussion in 'AI & Navigation Previews' started by mplantady_unity, Jun 16, 2021.

  1. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    Experimental package now available from the package manager!
    An experimental package allows us to share early development with the community, but please keep in mind this is meant to collect your feedback while we progress toward a fully supported released functionality. As such experimental packages should not be used in production until they reach their Released state.

    Introduction
    The AI Navigation package provides a workflow for building and using NavMeshes at runtime and at edit time through components.

    To get started with AI Navigation, we recommend that you checkout the Documentation.

    High-level features summary
    It allows configuring NavMeshes for different types of agents. Updating NavMesh topology at runtime. Creating more complex configurations, via NavMeshLinks and modifiers. And creating more flexible projects by leveraging NavMeshes in prefabs.

    Current state
    This package is based on NavMeshComponents project that was available on Unity public GitHub. The experimental AI Navigation Package is still under development, and some API or data structures may change in the future.

    What’s next?
    AI Navigation is expected to become the new default workflow for Navigation in Unity. Before being able to sunset the legacy workflow, some missing features (like HeightMesh) need to be reimplemented in this component-based system. A special attention will also be given to the user experience, to facilitate the setting of navigation in a project and helping its debugging.

    It is our intention to deliver those functionalities as a fully supported increment of released versions you can use in production. So our first goal is really to consolidate the existing experimental functionalities and fully support them for production as soon as possible.

    More information about the full roadmap for this product will be communicated later.

    Installation
    • Download Unity 2021.1 or newer through the Hub.
    • Create or open a Unity project.
    • Go to Window > Package Manager.
    • Follow “Adding a registry package by name” instructions and add “com.unity.ai.navigation”

    Sharing feedback
    This forum is the best place to open discussions and ask questions. When you encounter a bug, please use the Unity Bug Reporter in the Unity Editor, accessible via Help > Report a Bug. Include “AI Navigation” in the title to help our staff triage things appropriately!

    For more details on how to report a bug, please visit this page..
     
    Last edited: Jun 16, 2021
  2. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    785
    Will this also improve the DOTS NavMeshQuery api? Thats been experimental with 2018, and you have to jump through many hoops to get useful results out of it.
     
  3. MiFrilke

    MiFrilke

    Joined:
    Dec 14, 2016
    Posts:
    40
    Glad to see that Navmesh Components are finally making the transition to a Unity Package!

    We have been working with the navmesh components for quite a while now and I have a few things I want to address right away:
    • Please expose the debug building & visualization features by default on the NavmeshSurface component. It helps a lot when trying to figure out why a specific corner of the navmesh doesn't come out the way you want it to. But not a lot of users know the debug data/views exist since it is hidden behind a few different APIs.
    • Please take a look at the underlying NavMeshBuilder again, there are still issues to be solved there. I recently reported this issue regarding navmesh modifiers (detailed info in this forum post).
    • Add the possibilty to use arbitrary meshes as volume modifiers, the current restriction to boxes only is severely limiting and caused us to use countless workarounds to block navmesh inside of pre-built geometry.
    • If at all possible, please move the NavMeshBuilder out of black-box land into the package! It would go a long way to be able to see what is happening and being able to modify it if needed.

    Thank you
     
  4. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    95
    Feature Request

    Make MavMeshPath include offmesh links rather than just Vector3's that way offmeshlinks can be usable.

    My last project I had to spatially search to try and match vector3's to offmesh links, its slow and unreliable :(
     
    mplantady_unity likes this.
  5. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    136
    Do you plan to add some feature to get rid of disconnected NavMesh islands? Something what NavMesh Cleaner asset does in current system.
     

    Attached Files:

  6. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    The Unity 2021.2 beta is available for feedback unity blog mentions:
    "Editor: Scene View tool overlays, quality-of-life improvements, Editor performance optimizations, a beta of the Apple Silicon Editor, the AI Navigation experimental package, feature sets"
    But still I cannot find the AI Navigation package in the package manage in Unity Registry list. Not even if I enable the experimental packages.
    Does this means that we still have to add the AI Navigation package by name, as you suggested even in 2021.2 too?
    But then why the blog mentions that it is available in the editor?
     
  7. Lhawika

    Lhawika

    Joined:
    May 27, 2015
    Posts:
    52

    The part of the blog post you quoted says "the AI Navigation experimental package".
    If I'm not wrong, experimental means "hidden and should be added by name", preview means "visible if preview packages are enabled".
    It seems to me that it is normal to still not see the package in the package manager even though the blog post mentioned it.
     
    mplantady_unity and DevViktoria like this.
  8. DevinW

    DevinW

    Joined:
    Jun 19, 2014
    Posts:
    36
    upload_2021-6-27_15-22-36.png
    I'm confused

    upload_2021-6-27_15-23-40.png
     
  9. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,984
    Plus, please do not duplicate your post.
     
  10. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    Thanks for your feedback!

    Also, notes that using the roadmap website for feature requests and voting for what is more important to you, could also help us to prioritize our work:
    https://unity.com/roadmap/unity-platform/navigation-game-ai
     
    JoNax97 likes this.
  11. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    Until the package is verified it cannot be displayed in the package manager, and it will be necessary to add it by name.

    The current version of the package is compatible with earlier version than 2021.2, it was just announced in this version because it match the release of the experimental package.
    Also keep in mind, that future planned improvement of the package will need update in the core API and will require to increase the minimum compatible version of the package.
     
    Tanner555 and DevViktoria like this.
  12. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    It is an undocumented feature, but you can also use "Add package from git URL" with a package id ("com.unity.ai.navigation") in 2020.

    "Add package by name" was added to make that explicit in 2021.
     
    Rootbeard, Tanner555 and DevViktoria like this.
  13. MrTestOne

    MrTestOne

    Joined:
    Feb 21, 2018
    Posts:
    7
    Do I understand correctly, that the current "AI Navigation Package" at current state is exactly the same like the NavMeshComponents Addon, available via Git? (https://github.com/Unity-Technologies/NavMeshComponents)

    Which means: If I'm using the old NavMeshComponents - there is no need to update/change scripts for this "AI Navigation Package" at this point? (later, when the planned features will be implemented, then of course an update makes sense)
     
  14. putragonist

    putragonist

    Joined:
    Aug 13, 2013
    Posts:
    8
    It takes forever to install. How much is the size of the package? tftd.PNG
     
  15. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    Currently the only difference between the Git version and the package are a few fixes. You can check the Changelog to know what have changed:
    http://docs.unity3d.com/Packages/com.unity.ai.navigation@1.0/changelog/CHANGELOG.html
     
  16. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    It should only takes a few seconds to install (the package size is 3MB). Maybe you should reopen Unity and retry.
     
  17. MrTestOne

    MrTestOne

    Joined:
    Feb 21, 2018
    Posts:
    7
    Nice, thanks for the link! There is indeed already some movement on the fixing area. Looking forward for future major steps towards new and improved functionality! ;)
     
  18. Rhyusaky

    Rhyusaky

    Joined:
    Jan 22, 2016
    Posts:
    20
    Do you plan to support 2D navmeshes any time soon...?
     
  19. TyroByte

    TyroByte

    Joined:
    Mar 16, 2017
    Posts:
    25
    Is there anyway to add this package to the 2019.4 LTS Package Manager?
     
  20. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    903
    Is this package opensource? Or will it?
     
  21. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    It is not clearly planned yet, but don't hesitate to vote for it in our road map: https://unity.com/roadmap/unity-platform/navigation-game-ai. It will help us to prioritize the next NavMesh features to be released.
     
  22. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
  23. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    49
    Thaina likes this.
  24. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    1,797
    Hi @mplantady_unity. How about dots AI Navigation package? Will dots AI Navigation package be reimplemented in pure dots way or build on top of this AI Navigation Package?
     
    lclemens likes this.
  25. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,353
    Ya this package is highly misleading as to what it actually is and has confused a ton of people ever since it first hit on github. It's a high level api over existing lower level public api's.

    That needs to just be clearly stated.
     
    ZiadJ likes this.
  26. Syganek

    Syganek

    Joined:
    Sep 11, 2013
    Posts:
    85
    Do you have any ETA when it will arrive into a preview or released state? We're just beggining a new project in a studio and it would be great for our game but we're worried about it being an experimental package. We'd be considering it if it would get to at least preview state before we'd release the game.
     
  27. Rootbeard

    Rootbeard

    Joined:
    Nov 10, 2015
    Posts:
    6
    I'm overjoyed to see movement on this!

    On the roadmap page (https://unity.com/roadmap/unity-platform/navigation-game-ai) there is mention of reworking the entire baking process for performance. Will this involve making runtime baking async?

    It hurts that BuildNavMesh() hangs a single frame.
     
  28. DarkMerchant

    DarkMerchant

    Joined:
    Oct 29, 2020
    Posts:
    1
    I have an issue with the package though... When I use UpdateNavMesh() for my NavMesh I see the new NavMesh (or at least the changes since last recalculation). Unfortunately it seems that my NavMeshAgents are also considered as obstacles and create a not moveable area around them, leavng them on a small walkable island.

    In the documentation is written, that neither NavMeshAgents nor NavMeshObstacles should be taken into consideration while updating the NavMeshSurface. So I'm a little bit confused at this point... Can you help me with that?

    Perhaps there is something I didn't see...
     
  29. behemothdan

    behemothdan

    Joined:
    Jul 24, 2017
    Posts:
    9
    I guess I am a bit confused about this package is bringing in. I added by name as instructed, I have UnityEngine.AI imported to the file I am working on. But when I do the most basic item, defining an array with
    Code (CSharp):
    1.     public NavMeshSurface[] surfaces;
    Unity tells me it cannot find NavMeshSurface. Is there something else that needs to be added to my project other the item indicated?
     
  30. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,984
    Have you checked the OP and followed the installation instructions?
     
    behemothdan likes this.
  31. behemothdan

    behemothdan

    Joined:
    Jul 24, 2017
    Posts:
    9
    Yeah, as I mentioned I added it by name as instructed. Hence my confusion why it doesn't recognize it.
     
  32. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,984
    Sorry, just double check, a lot of people forget these things. Next one: are you using ASMDEF files? If the answer is yes, you need to add the package's ASMDEF as reference.
     
  33. behemothdan

    behemothdan

    Joined:
    Jul 24, 2017
    Posts:
    9
    No worries, I understand. I can't say that I am using the ASMDEF files. I see them in this repo: https://github.com/Unity-Technologies/NavMeshComponents/tree/master/Assets/NavMeshComponents/Scripts but my understanding was using the package from the com file replaced the need to import these scripts? Maybe I am incorrect and actually still need them? None of the tutorials I was watching brought them in, hence the reason I had not yet.
     
  34. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,984
    Just downloaded the package real quick, it works for me. Could you please share the file where you're experiencing the problem and the exact error message?

    No, you don't need the github repo if you downloaded and installed the package version.
     
  35. behemothdan

    behemothdan

    Joined:
    Jul 24, 2017
    Posts:
    9
    So when I import the scripts from that Github package into my project I get the following warnings:
    upload_2021-11-4_0-56-45.png

    However if I remove those files and only have the com package I get an error that says this:
    upload_2021-11-4_0-57-52.png

    The file at the moment is pretty empty. I have the imports at the top, some boilerplate and defining the array.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using System.Linq;
    4. using UnityEngine;
    5. using UnityEngine.AI;
    6. using UnityEngine.SceneManagement;
    7.  
    8. public class ModularDungeonGeneration : MonoBehaviour {
    9.     public NavMeshSurface[] surfaces;
    10.     private Module[] Modules;
    11.     public int Iterations = 5;
    12.     public bool logBuildMessages = true;
    and some more variable definitions. I'll check back tomorrow, gotta crash for the night. Thanks for the suggestions so far!
     
    Last edited: Nov 4, 2021
  36. darashayda

    darashayda

    Joined:
    Jun 27, 2020
    Posts:
    255
    Hello to Unity friends at AI Navigation.

    We have developed Free Form Generative AI that produces entire Unity 1st and 3rd Person games with infinitely variational landscape and Addressable assets.

    I like to say hello and introduce us to the AI Navigation team. We are a subscribed customer and already in multiple stores and UDP.

    With great pleasure I need to announce that our first usage of AI Navigation on Unity 2021.2.0b15 was instantly successful, rewarding and most impressive! Congrats to all of you at this team!

    In our computing ream the player or the game designer could simply specify an image:

    http://64.60.141.195/photos/72jpegs/207913N2.jpg

    and our generative AI constructs a 3D Embossed and textured structure with multiple-NavMesh within 12-20s!

    The assets then Streams from our computational cloud or from CCD buckets as Addressables ... you can imagine the rest.

    What you see in the attached scenes, are based upon multiple Shortest Tour Graph Theoretic algorithms

    FindShortestTour
    https://reference.wolfram.com/language/ref/FindShortestTour.html

    If need be
    SortestPath
    https://reference.wolfram.com/language/ref/FindShortestPath.html

    The 3D structure has multiple layer, Top, Middle and Bottom, Top and Bottom have NavMesh and the Points for the Patrol are obtained from the above algorithms in Wolfram Cloud.

    The shortest tours are JSON transported into the Unity live-running game and are used for Patrol and Attack navigations.

    We have 100s of examples as such, and most important feature of these examples is that they are NOCODE with Free Form English interface which I provide examples if interested at a later date.

    Within 20s or less, fully variational 3D game is generated by the Free Form Generative AI, with applicable part-Unit-NavMesh at run-time and part of Graph-Tours from our graph algorithms!

    I wrote, because we need to take this to new heights at Unity and my support director asked me to contact the forums and here we are

    Dara
     

    Attached Files:

    ImpossibleRobert likes this.
  37. darashayda

    darashayda

    Joined:
    Jun 27, 2020
    Posts:
    255
    From an old embroidery book's pencil drawn images, our generative AI can synthesizes games!
     

    Attached Files:

  38. darashayda

    darashayda

    Joined:
    Jun 27, 2020
    Posts:
    255
    Players and designers could add Tubular Knots, from Knot Theory, and the AI computes run-time Navmesh...
     

    Attached Files:

    ImpossibleRobert likes this.
  39. darashayda

    darashayda

    Joined:
    Jun 27, 2020
    Posts:
    255
    Players and designers could simply enter a few rules for a fractal and the 3D game generated with NavMesh at run-time... Amazing and much gratitude to the team here.
    D
     

    Attached Files:

  40. Nurallaerel

    Nurallaerel

    Joined:
    May 6, 2015
    Posts:
    13
    Stumbled upon the problem when my mesh was not properly runtime-baked on Android devices (all good in editor).
    Found out that the reason were mesh colliders. Switching my prefabs to the box colliders solved the problem
     
  41. lic1227

    lic1227

    Joined:
    Jul 14, 2015
    Posts:
    41
    Greate,and what about DOTS AI Package?Is there any plan for this ?
     
    Tanner555 likes this.
  42. hawkdanny

    hawkdanny

    Joined:
    Jun 29, 2017
    Posts:
    1
    I was wondering if there is a better solution for discluding triggers in the navmesh surface bake that having to add a NavMeshModifier component to them? I love being able to use the colliders for the navmesh baking, but now my triggers volumes are being included. I think an option on the navmesh surface bake to ignore triggers would be swell.

    Separately, the driving factor behind me adopting this new navigation package is the NavMeshModifierVolume, because it is super useful to be able to micromanage the navmesh areas in order to encourage believable/normal pathfinding from npcs. I would also love some other volume shapes beside the rectangular prism. Namely something round like a cylinder or a sphere.

    Thanks so much!
     
  43. AurochJapeth

    AurochJapeth

    Joined:
    Oct 25, 2021
    Posts:
    2
  44. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    935
    the namespace is Unity.AI;

    Basically you need three namespaces

    using Unity.AI;
    using UnityEngine.AI;
    using Unity.AI.Navigation;

    Hope this helps.

    Also, what is going on with this package?
     
    Tanner555 likes this.
  45. Matt-Cranktrain

    Matt-Cranktrain

    Joined:
    Sep 10, 2013
    Posts:
    127
    I too would very much like to know where Unity is with Navigation!

    Having used it for the last five years it really does feel like the AI/Navmesh stuff is all on life support, or close enough. It's not alone in that regard, the move to DOTS and the engineering that has required has really rocked a lot of important bits of Unity, and I don't blame them. But it's hard to take the posted roadmap seriously as anything other than wishful thinking when it's so clearly been in stasis/maintenance for years.
     
    Bilyam, Tanner555 and AurochJapeth like this.
  46. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    256
    Looks like Unity just (April 17th) added stuff to the roadmap in the Animation and 3D characters section (for some reason).
    You can vote for AI and Navigation here to improve the chance of it happening! Board Link
     
  47. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    84
    This package does seem to be dead. What's everyone using as a replacement?
     
  48. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I have workflows that depend on NavMesh.CalculateTriangulation(); and baking with modifier. I don't consider this API dead at all. In fact I'm looking for some kind of guarantee that if it's deprecated there will be functionally equivalent replacements.
     
    x4000 likes this.
  49. darashayda

    darashayda

    Joined:
    Jun 27, 2020
    Posts:
    255
    @hippocoder hello again, could you share some of your code? I have had very little trouble with this amazing package at high FPS but need to gain more experience from a Unity developer. Thanx

    I do not wish to be here, if possible email me with some of your code if you decide to do so, not here.

    Disclaimer: None of the presented materials by any stretch of imagination were meant to Advertise nor Spam any Unity organization. Nor meant to solicit business from anyone at Unity nor its customer base. Materials are solely meant for non-commercial Work-In-Progress presentation.
     
    Last edited: May 15, 2022
  50. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Nope, sorry.