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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Assets NavAI - Navigation Artificial Intelligence

Discussion in 'Works In Progress - Archive' started by MathiasDG, Sep 1, 2017.

  1. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    HeaderSmall.png
    About
    NavAI is a new complete navigation and pathfinding solution for Unity. This upcoming asset is capable of generating a triangular navmesh for any type of 3D scenario, finding paths for agents of any size and steering them towards their goal while avoiding collisions with other agents and other obstacles.


    Features

    Navmesh Features
    • Editor navmesh generation
    • Fast multi-threaded navmesh updates at runtime
    • Supports hundreds of dynamic obstacles
    • Multiple navigation zones active on the same scene
    • Free moving, rotating and scaling of navigation zones (unless it uses Unity Terrain)
    • Editor includes quick settings, and also optional advanced settings
    • Surface height queries
    • Closest navmesh point queries (includes finding the closest point free of collision for a given radius)
    • Visibility queries
    • Discrete and dynamic collision queries
    Pathfinding Features
    • Pathfinding for agents of any size
    • Multi-threaded pathfinding with a priority queue
    • Finding best possible paths when goal cannot be reached
    • Pathfinding to moving agents
    • Automatic periodic path updates
    Collision Avoidance Features
    • Multi-threaded RVO inspired collision avoidance
    • Supports hundreds of agents
    • Supports agent collision avoidance priority
    • Supports idle agents moving out of the way of active agents
    • Includes a solution for moving multiple agents through a narrow corridor
    • Includes a solution for multiple agents surrounding a target agent (or for the target to move out of that scenario)
    Agent Features
    • Can be controlled by setting a point destination
    • Can be controlled by setting another agent as destination
    • Can be controlled by setting the desired velocity
    • Can be controlled by applying an external velocity (pushing the agent)
    • Can be controlled by setting the position (warping the agent)
    • Supports a command to hold position / hold rotation
    • Supports teams for collision avoidance priority rules (friendly vs enemy)
    • Find all agents within distance of a point queries
    • Supports automatically sopping when close enough to the goal if its already occupied by another agent
    Media
    Collision Avoidance

    Pathfinding

    Editor Mesh Generation

    Editor Inspector
    Inspector1.png

    Demo (Windows)
    Demo2.png
    Download Link: NavAI Demo - 0.4.20

    Feedback
    These are some topics we are looking forward to receiving feedback on, but feel free to initiate a feedback on any other related topic you would like.
    1. Do you have any questions or comments on the listed features?
    2. Would you have any unlisted feature to ask for or ask about?
    3. Do you have any general thoughts or comments on the Demo?
    4. Did the agents behave as you expected on the Demo?
    5. Did you find any errors, bugs, or anything strange or unexpected on the Demo?
    6. Would you like to see a different behavior on the agents?
    7. Would you consider using this asset on your game?
    We are also looking for beta testers. If you're interested, you can send me a private message here on the forums saying you are interested in beta testing NavAI and i will get back to you with some questions about the project you are working on.
     
    Last edited: Sep 15, 2017
  2. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Looks great! What's better in this than Unity's built-in Navmesh?
     
  3. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    NavAI and Unity's built-in navigation system are quite similar, but NavAI offers some improved features over Unity's. These are the key advantages listed in the features. Note that it is possible to achieve some of them with Unity's buil-in navigation, but it would require a lot of work.
    • Multiple navigation zones active on the same scene
    • Free moving, rotating and scaling of navigation zones (unless it uses Unity Terrain)
    • Editor includes quick settings, and also optional advanced settings
    • Pathfinding for agents of any size
    • Finding best possible paths when goal cannot be reached
    • Pathfinding to moving agents
    • Supports idle agents moving out of the way of active agents
    • Includes a solution for moving multiple agents through a narrow corridor
    • Includes a solution for multiple agents surrounding a target agent (or for the target to move out of that scenario)
    • Agents can be controlled by setting another agent as destination
    • Agents can be controlled by setting the desired velocity
    • Supports teams for collision avoidance priority rules (friendly vs enemy)
    • Find all agents within distance of a point queries (similar to OverlapSphere)
    • Supports automatically sopping agents when close enough to the goal if its already occupied by another agent
    In short, NavAI offers the same features (and many more), but with higher quality:
    • Agents will collide less, move more in a smarter and smoother way.
    • Navmesh is much more precise and pathfinding much more responsive to mesh changes.
    • You only need one navmesh for all agent sizes (no need to bake 1 navmesh for each different agent size)
    • Agents are guaranteed to reach their destination (if it is possible) and will not get stuck.

    Here is a video comparing some of NavAI's features vs Unity's built-in navigation features. In the video, both NavAI and Unity's navmesh receive exactly the same inputs, and everything AI related on the video was achieved with very little coding.
     
  4. umauj

    umauj

    Joined:
    Nov 20, 2011
    Posts:
    80
    Looks really nice! Impressive work! We have more than once already been hitting the limitations of Unity's navmesh.

    In your video I saw that after the first couple of agents surrounded the target agent, the others kept moving in circles at the outside. Any plans to counter this?

    Next question: can agents be assigned a priority? E.g. In the corridor example one group could have a higher priority, so the overall movement and avoidance looks better? (Agents should stop moving if there is not enough space)
     
  5. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    There is an option for agents to stop after some time without having progress towards the path goal (progress = has the remaining path length reduced?).
    This option is currently disabled if the path goal is another agent because it is tricky to check progress towards something that is moving (it could be moving faster and away from you, and you would never reduce the remaining path length, but you would still hope to catch up at some point)
    This could be enabled in the future if the path target is not moving (or maybe even if it is moving), and have the agent stop after some time (after 3 seconds moving in circles, for example)

    Yes. Agents can have a collision avoidance priority assigned, which is an inspector pre-defined variable (it can also be changed via script at runtime), but this priority works individually for each agent, and not for a group of agents entering the corridor from one side vs another group of agents entering the corridor from the other side.

    I imagine what you're trying to ask for is something like "first everyone moves from left to right, then everyone from right to left". The problem is, it is quite difficult for agents to look ahead and see "hey, this is a narrow corridor I'm trying to go through, and it is crowded. Maybe I should wait." It's probably doable, but costly.

    I can think of having the individual priority assigned to each agent during this situations being related to the direction they want to go, and have the direction with priority change over time. This would be a less guaranteed solution, because we don't really know how long the corridor is and how long it will take for the agents to get thought it. so how frequently should we change the direction? If we change it too soon, then the group will lose priority before it exits the corridor.
    I'll add this to a list of possible future improvements.

    Nevertheless, these are exceptional situations where the corridor is not wide enough for two or more agents. If wide enough, there should be a more natural flow of two rows, each going one direction.
     
    Last edited: Sep 5, 2017
  6. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    NavAI Update
    • Collision avoidance is now a lot smoother (Increased collisions time horizon, meaning agents no longer instantly move out of collision)
    • Navmesh updates are now 3x faster (Simplified triangulation data structure. Triangulation now has 2x less bytes per triangle)
    • Fixed a bug where obstacles would sometimes not update their carve when rotating / scaling
    • Editor improvements (Inspector icons, new options, bug fixes)
    • Updated Demo App to version 1.2.0 (Includes colors, new commands and the above changes, as well as some other minor changes)
    We are currently working on documentation, editor improvements, example scenes and tutorials. Once these are done the asset is to be submitted to the asset store. From there, we will continue to work on new features. Some of these upcoming features are:

    Upcoming Features

    • Runtime multi-threaded navmesh generation (Useful for procedurally generated levels)
    • Ability to connect two or more navmeshes (Can be used to connect an existing navmesh with a newly generated one)
    • Off-mesh links (Including both automatic and manual link generation)
    • Layered meshes (Also known as 3D navmeshes generated with voxel. Useful for having surfaces on top of each other, such as bridges or tunnels)
    • Additional faster navmesh options (grid based, non-dynamic, locally-dynamic)
    • Additional agent behaviors (flee, pursue, wander)
    • Agent group formation (As in strategy games)
    • And more!
     
  7. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    NavAI Update
    • Fixed a bug where agents would not avoid collisions using the correct time horizon (agents would only start avoiding collisions when too close to one another)
    • Demo improvements
      • Added a floating moving platform that agents can move on.
      • Agent selection is now clearer (bunny color will change when selected)
    The latest demo can always be downloaded at the original post download link.
     
  8. Lecht

    Lecht

    Joined:
    Jul 1, 2014
    Posts:
    24
    What if I wanted an Agent to path around other Agents instead of trying to move through them?
     
  9. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    An agent will try to move through a group of agents if (A) or (B):
    (A) - The agents in the group are moving - This means that the agent will individually avoid collision with each agent of the group, while expecting them to also avoid collisions with it. This is called reciprocal collision avoidance. If there is an agent to the right, and another one to the left of our pathing agent, then the pathing agent will try to move between these two agents.
    (B) - The agents in the group have a lower collision avoidance priority (and are on the same team as the agent) - Naturally, agents that are idle will have lower collision avoidance priority, but you can set a default collision avoidance priority for each agent.

    Collision Avoidance priority can be disabled in the NavAI settings (under collision avoidance settings), and then case (B) will no longer happen.

    If the grouped agents are not moving, and priority rules do not affect them, then the agent will move around them using an algorithm called "bug-like behavior" (which is the same algorithm responsible for a group of agents completely surrounding their target).
    What this algorithm does, is it considers agents that we can't move through as walls, and it tells the agent to follow these walls, as if it were a maze.
    The idea of this algorithm is similar to the "Wall Follower" algorithm described here: https://en.wikipedia.org/wiki/Maze_solving_algorithm

    If it is desired for the agent to path around other agents that are moving, without using these behaviors described above, then it would be needed an algorithm to precisely predict the position over time of each agent and use that information for pathfinding.
    Even if we could predict the position over time of every agent, such algorithm would still be unstable because of possible input changes, such as agents changing their destination.

    While we don't have any plans on implementing movement predicting pathfinding, if the current collision avoidance solutions are not enough to steer the agent towards it's goal, then we could certainly think of adding new strategies for solving this problem.

    Do you have a more detailed example of a situation where you would desire this feature?
     
    Last edited: Sep 21, 2017
  10. Shudrum

    Shudrum

    Joined:
    Apr 3, 2011
    Posts:
    63
    Hi! Impressive project!

    I'm currently working with A* Pathfinding project, but it doesn't fit all my needs :
    - Manging more than thousand units
    - Effective, and very low consumming mesh update
    - Working quite large maps

    I would very happy to test your tool (and here I dont ask for a beta access, just that I will be really happy to test your tool when released).

    Have you done some perf / render comparison with A* Pathfinding project?

    Good luck!
     
  11. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
  12. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Yeah, it looks like the project was abandoned, which sucks for those of us who paid for it, expecting it to be completed.
     
  13. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    NavAI has been removed from the asset store for being outdated for too long.

    I have recently resumed working on NavAI and there will be a new version on the asset store soon.

    Previous versions of NavAI had problems generating the navigation mesh for interiors and scenes with multiple floors. This next update will have a brand new navmesh generation process that is able to handle interiors, multiple floors and everything else.
     
    one_one likes this.
  14. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
    Mathias,
    Can you please give an update on the next version of NavAI?
    What are the features?
    When will it be released?
     
  15. WalterEspinar

    WalterEspinar

    Joined:
    Aug 23, 2011
    Posts:
    83
  16. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    396
    Hey, looks good, how about weight maps? So ai prefer to move on fast-moving paths instead of rough terrrain etc?
     
  17. MathiasDG

    MathiasDG

    Joined:
    Jul 1, 2014
    Posts:
    114
    I am currently working on the new navmesh generation, which will support world voxelization for worlds with multiple layers of walkable meshes.
    This next version of navai will be limited to this new feature.
    The estimated release date for this next version is 2 to 4 weeks from now.
    There will be more version updates after this with additional features.

    Unfortunately, navai will not support weight maps any time soon. The triangulations used by navai are unable to support this feature.
     
  18. wallycrooze

    wallycrooze

    Joined:
    Feb 23, 2018
    Posts:
    3
    Keen to see the upcoming NavAI and its feature set. Any updates on when you expect the next release?

    Weights aren't a huge issue for me for what I need now, but I think it is a must have feature.

    I think the "stock" implementation by Unity have a few drawbacks, both some illogical nav mesh generation and then path calculation. I also see a bug where the agent transports itself from one mesh intersection to another... and the agents have a bit of an intelligence issue sometimes crossing mess intersections where they decide to do a mini jump, yet it is a flat surface.
     
  19. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    Any news on this, did you ever add runtime generation?
     
    Flurgle likes this.
  20. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    158
    Will it work with open world? (floating origin, basically moving everything and keeping everything working)
    This is a must for many projects...
    I bought the first version but still cannot use it in my game.
     
    eaque likes this.
  21. sfc1320

    sfc1320

    Joined:
    Mar 18, 2019
    Posts:
    1
    good job!! how can i get it?NavAI
     
  22. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    158
    This is an abandoned asset, lost $100 =/
    I stopped buying expensive assets via the Asset Store, no support, no refund, so bad. Worst experience with paid code projects.
     
    PhoenixAdvanced likes this.
  23. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    To be fair, a one-time payment of $100 for multiple thousand lines of code is pretty competitive pricing in many cases, even without any sort of support. This is more of a general remark by the way. It seems like a common sentiment on the forums here that for a one-time payment of ~$50, asset authors are required to offer support within 2 or 3 days and update assets to new unity version within a few weeks. Most asset authors definitely aren't raking in big money, most probably would be far better of financially doing freelance work instead of sinking hours into an asset. And this is a big issue, because Unity's asset eco-system is a very big plus for the rest of us who just work on games.

    Sure, some level of support should be maintained, but Unity usually pulls asset from the store if they haven't been updated to newer versions for a while, which also means that developers must be at least kind of active to keep their stuff on the store - and I find it hard to believe that you cannot get a refund through Unity if you really want/need it.

    In which contexts did you have better experiences with paid code projects at a similar price point?
     
  24. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    158
    I know that the author should not provide support forever, of course not. But simple questions during the sales period would be the minimum...

    It had a private forum support website that is currently down. I've got no reply there right after buying the asset, even with simple questions like if this would support a floating origin solution or not. I have paid $100 for an asset that I cannot use (without doing lots of changes), and I could not know that before buying. $100 right into the trash...

    On the other side, there are assets that costs $15 or less and the author at least replies simple questions... This does not mean changing the code or making custom requests, just giving a reply if it supports such case or not.

    On the same Asset Store with other creators. For example, look at A* Path Finding, the author offers a great support for years. Or Enviro, a sky system. Lots of updates, lots of support on forum, even more than expected.

    Now I read the forum thread and ask first, buy later, just to be sure that it is not an abandoned asset.
     
    one_one likes this.
  25. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I understand your frustration there and I wasn't trying to say it's completely unfounded.

    Those assets definitely exist, but I wonder how many of the well supported assets are running at a loss, to be honest.

    I think that is the safest path and also what I do. Anyway, I'll not derail this thread further and I hope you manage to get a refund.