NavAI - Navigation Artificial Intelligence


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

https://vimeo.com/231917700

Pathfinding

https://vimeo.com/231911242

Editor Mesh Generation

https://vimeo.com/231905539

Editor Inspector

Demo (Windows)


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.

  • Do you have any questions or comments on the listed features?
  • Would you have any unlisted feature to ask for or ask about?
  • Do you have any general thoughts or comments on the Demo?
  • Did the agents behave as you expected on the Demo?
  • Did you find any errors, bugs, or anything strange or unexpected on the Demo?
  • Would you like to see a different behavior on the agents?
  • 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.

Looks great! What’s better in this than Unity’s built-in Navmesh?

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.

https://vimeo.com/232264152

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)

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.

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!

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.

What if I wanted an Agent to path around other Agents instead of trying to move through them?

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?

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!

Hi

NavAI doesn’t seem to be in the asset store anymore, however it is showcased in the Unity Asset Store post https://assetstore.unity.com/give-your-characters-life

Is this asset no longer available?

Yeah, it looks like the project was abandoned, which sucks for those of us who paid for it, expecting it to be completed.

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.

1 Like

Mathias,
Can you please give an update on the next version of NavAI?
What are the features?
When will it be released?

Any news?

Hey, looks good, how about weight maps? So ai prefer to move on fast-moving paths instead of rough terrrain etc?

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.

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.

Any news on this, did you ever add runtime generation?

1 Like

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.

1 Like