Godot: Enhanced 3d Navigation Mesh Feature Suggestions.

Created on 5 Dec 2016  路  14Comments  路  Source: godotengine/godot

Currently the 3d navigation mesh does not interact with other navigation meshes or collision meshes in any meaningful way. In coming versions of the engine this may be fixed, but I would like to make sure the concern is at least written down somewhere.


Issue:

  • All navigation meshes are treated separately. This causes AI to get stuck in a navigation segment.
    How it should be:
    How it should be
    [Simulated] How Godot Does It:
    [Simulated]How Godot Does It

Example:

  • One can get a 3d road asset and connect them end to end. If an AI is placed at the end of the road and tell it to navigate to the other end, it would be unable to.

Suggestion:

  • To solve this I would suggest merging all the navigation meshes, unless it is possible to make pathing cross multiple adjacent or overlapping navigation meshes without connecting them.

Issue:

  • The navigation mesh generator does not handle obstacles at all. This causes AI to get stuck on objects it should route around.
    How it should Be
    How it should Be
    [Simulated] How Godot does it.
    [Simulated]How Godot does it. Simulated]

Example:

  • If one were to place a a box or chair on the floor and have the navigation mesh generator would not react to the fact that there is an obstacle in contact with the navigation mesh.

Suggestion:

  • My suggestion is that all collision node types should have an option for 'Things that affect the nav mesh' eg: Sofas/cars/buildings and 'Things that do not affect the nav mesh' eg: litter/debris/boxes. The result should be a hole in the nav mesh surrounding the obstacle.
feature proposal editor navigation

Most helpful comment

@atllllll The main change I want to make with the first in the follow up revision is a fairly simple refactor to the Recast integration in such a way that it is not built into the EditorPlugin but rather has the functionality contained within the NavigationMeshInstance itself so that it can be generated from within the game, not just the editor. The EditorPlugin should be just a simple interface to the methods.

From there, there's more that can be done for navmeshes. One feature I would quite like to see is the ability to define different navmesh areas, which agents traversing the mesh could favor above others. I believe this is something which can be set up within Recast, but Godot's internal navigation system is currently not setup to be able to take advantage of such a feature. This is also the same situation for dynamic obstacles; Recast has functionality to create navmeshes which are actually subdivided into 'islands' which can be triggered to dynamically rebuild themselves when static objects are moved around, and this would give you the most robust system for creating AI which can traverse highly dynamic environments. Again though, both of these features are predicated on further changes which would have to be made to the actual traversal and internal navmesh code. At the moment, the Recast integration I did is not deeply integrated; it currently converts the meshes it generates into formats that Godot's navigation system was already working with, and was simply meant to add in-editor shortcuts for functionality which would otherwise have to be done in Blender. I might want to defer some of this, but the first thing I would suggest before we can expand and improve Recast integration would be to overhaul Godot's own internal navigation system.

As for the first example where the navmesh comes out as unconnected. I'm not sure why it's doing that. I'll have to take a further look, but it might be worth attempting to tweak the settings.

All 14 comments

I hope something like this.
http://xenko.com/blog/new-version-1-9-0/#navigation-meshes

Further extensions to nav mesh would be a great feature to shoot for. Highly support it here.

Don't navmeshes merge automatically now?

Shouldn't this be closed? I believe navmeshes merge automatically now.

Assuming so. Feel free to comment/reopen if it's not fixed yet in the master branch.

I would like to Reopen it because:

  1. navmeshes do not currently collapse. It still has the same behavior as 2.1 . So that means that if i put 2 ground planes together the navigation would not be able to cross over to the opposite plane.
  1. Because there are no navigation mesh collapsing, you can not make obstacles.

As an extra there should be a way to create and update all the navigation meshes at once. perhaps the navigation node has a create and an update button that will traverse the tree looking for navmesh nodes to update. Preferably also exposed in gdscript too.

I will have to try but i think the navmesh you want to merge need to share vertices

They do but, that;s not really feasible when you are dealing with 3d assets from different sources. How exactly are you supposed to share vertices for a bridge with the terrain? How do you prevent the ai from walking into the water if you can't mark the water itself as a navigation obstacle? All meshes with navigable navigation nodes should be merged and the navigable area calculated from the merged mesh.

We have now entered release freeze for Godot 3.0 and want to focus only on release critical issues for that milestone. Therefore, we're moving this issue to the 3.1 milestone, though a fix may be made available for a 3.0.x maintenance release after it has been tested in the master branch during 3.1 development. If you consider that this issue is critical enough to warrant blocking the 3.0 release until fixed, please comment so that we can assess it more in-depth.

Just wanted to bring in @SaracenOne on this since they added basic Recast integration last year (92e77d5). If you're able to find the time, SaracenOne, could you write a brief write-up on the plugin's current functionality and a plan for how it could be developed further, please? That would be great! You said you'd need a moment to collect your thoughts and refresh your memory, so no rush. I believe that functional navigation mesh generation would make Godot more competitive, so hopefully we can all work together on this feature.

@atllllll The main change I want to make with the first in the follow up revision is a fairly simple refactor to the Recast integration in such a way that it is not built into the EditorPlugin but rather has the functionality contained within the NavigationMeshInstance itself so that it can be generated from within the game, not just the editor. The EditorPlugin should be just a simple interface to the methods.

From there, there's more that can be done for navmeshes. One feature I would quite like to see is the ability to define different navmesh areas, which agents traversing the mesh could favor above others. I believe this is something which can be set up within Recast, but Godot's internal navigation system is currently not setup to be able to take advantage of such a feature. This is also the same situation for dynamic obstacles; Recast has functionality to create navmeshes which are actually subdivided into 'islands' which can be triggered to dynamically rebuild themselves when static objects are moved around, and this would give you the most robust system for creating AI which can traverse highly dynamic environments. Again though, both of these features are predicated on further changes which would have to be made to the actual traversal and internal navmesh code. At the moment, the Recast integration I did is not deeply integrated; it currently converts the meshes it generates into formats that Godot's navigation system was already working with, and was simply meant to add in-editor shortcuts for functionality which would otherwise have to be done in Blender. I might want to defer some of this, but the first thing I would suggest before we can expand and improve Recast integration would be to overhaul Godot's own internal navigation system.

As for the first example where the navmesh comes out as unconnected. I'm not sure why it's doing that. I'll have to take a further look, but it might be worth attempting to tweak the settings.

How feasible would it be to have a negative navigation system, meaning the character is free to go anywhere except certain spots

Navigation issues will be reevaluated for Godot 3.2, moving to that milestone.

I assume that at least part of these suggestions are handled by the new NavigationServer in Godot 4.0.

If any points are still relevant in the master branch, please open new dedicated proposals on godot-proposals.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n-pigeon picture n-pigeon  路  3Comments

Spooner picture Spooner  路  3Comments

nunodonato picture nunodonato  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments

timoschwarzer picture timoschwarzer  路  3Comments