Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detailed Navigation Debug Visualization #62601

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jul 1, 2022

Implements proposals #4507 as far as possible for now.

  • Adds more customization options for navigation debug to ProjectSettings.
  • Displays navregion edge connections and navigation polygon edges in editor and at runtime.
  • Majority of debug code moved from SceneTree to NavigationServer.
  • Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.

nav_debug_visuals

Customization options in ProjectSettings

Navigationmesh polygons are now displayed with a line mesh so it is easier to spot suboptimal navigation layouts or sources of pathfinding problems. Each face has the option to be displayed in a slightly different, randomized color which helps when level geometry is placed on top the navigation mesh to spot where large polygons start and end.

The colors for faces and edges of the navigation mesh or for edge connections are now all separated options. Edges and connections now also have xray option to disable depth test.

The old settings Geometry Color and Disabled Geometry Color are still available for now as they are still used by some 2D features that I did not want to touch rightnow e.g. TileMaps.

nav_debug_options

Navregion edge connections in editor and at runtime

This displays the edge connections between two different region navigation meshes so users can now see immediatly if they are connected or withing distance of the edge_connection_margin. In order to get this information the NavigationServer must run.

nav_edge_connection2d
nav_edge_connection3d

@smix8 smix8 requested review from a team as code owners July 1, 2022 17:32
@Calinou Calinou added this to the 4.0 milestone Jul 1, 2022
@smix8 smix8 force-pushed the navigation_3d_debug_4.x branch 2 times, most recently from e2d27f1 to e9b49eb Compare July 1, 2022 17:59
@Zireael07
Copy link
Contributor

FINALLY!!!

(I did drop the navmesh approach for my racer mostly due to how finicky it was to debug without a real visualization)

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me.

Maybe @AndreaCatania @Scony @lawnjelly want to have a closer look too :)

servers/navigation_server_3d.cpp Outdated Show resolved Hide resolved
doc/classes/NavigationServer3D.xml Outdated Show resolved Hide resolved
doc/classes/ProjectSettings.xml Outdated Show resolved Hide resolved
scene/2d/navigation_region_2d.cpp Outdated Show resolved Hide resolved
scene/3d/navigation_region_3d.h Outdated Show resolved Hide resolved
scene/resources/navigation_mesh.cpp Show resolved Hide resolved
scene/resources/navigation_mesh.cpp Outdated Show resolved Hide resolved
@smix8 smix8 force-pushed the navigation_3d_debug_4.x branch 2 times, most recently from efc4283 to e09e3a7 Compare July 28, 2022 20:16
- Adds more customization options to ProjectSettings.
- Displays navregion edge connections and navigation polygon edges in editor and at runtime.
- Majority of debug code moved from SceneTree to NavigationServer.
- Removes the irritating debug MeshInstance child node from NavigationRegion3D and replaces it with direct RenderingServer API.
@akien-mga akien-mga merged commit 8b454f8 into godotengine:master Jul 29, 2022
@akien-mga
Copy link
Member

Thanks!

@jgillich
Copy link
Contributor

jgillich commented Jul 30, 2022

I'm confused by this change, is there no way to turn this off? Disabling gizmos doesn't do it, and I see nothing in the settings.

And the old NavigationRegion3D gizmo still exists, is there are need for both?

@dmaz
Copy link
Contributor

dmaz commented Jul 31, 2022

yeah this seems to be borked... if you have a nav mesh in the scene it's always on even on build.

@smix8
Copy link
Contributor Author

smix8 commented Jul 31, 2022

That it is always turned on in debug builds was an oversight from testing, it should only show in the Editor if the Gizmo is turned visible or when "Visible Navigation" is enabled in test runs like the old debug did. PR #63708 should fix this.

The individual settings are in ProjectSettings -> Debug -> Shapes.
The Debug -> Visible Navigation from the Editor top menu controls if it is visible in test runs.

I will remove the old leftovers e.g. debug mesh with another pr as I couldn't remove it immediately without breaking other builds while this pr was not merged.

@jgillich
If you disable "NavigationRegion3D" in the Editor View -> Gizmo options it should disappear as that Editor logic has not changed only the visuals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants