Navigation Menu

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 NavigationAgent Path Debug Visualization #71543

Merged
merged 1 commit into from Feb 1, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jan 17, 2023

Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.

The NavigationAgent build-in path debug visuals are toggleable per agent in the inspector with debug_enabled property. Custom properties like path color or rasterized point size can be also used per agent instead of the global values when debug_use_custom is enabled.

agent_debug

As with other navigation debugs the global values can be controlled in the ProjectSettings from ProjectSettings->Debug->Shapes.

agent_debug_ps

While 2D always had an easy time just adding the navigation path points array to a Line2D node for display such an option did not exist for 3D and creating a debug mesh for paths was actually a ton of work and troublesome for beginners. Even for 2D using a node for display was troublesome as it messed with the SceneTree and child functions.

The debug visuals now use the RenderingServer directly, so no unexpected debug Nodes that appear in the SceneTree or RemoteSceneTree and mess up child functions and also no Node overhead. The rendering is updated only once when the agent path or properties change and not every frame to keep runtime performance cost low.

@Scony
Copy link
Contributor

Scony commented Jan 28, 2023

I'll be testing & reviewing this within the next 16h

scene/2d/navigation_agent_2d.cpp Outdated Show resolved Hide resolved
doc/classes/ProjectSettings.xml Outdated Show resolved Hide resolved
scene/3d/navigation_agent_3d.cpp Show resolved Hide resolved
scene/3d/navigation_agent_3d.cpp Show resolved Hide resolved
scene/2d/navigation_agent_2d.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga requested a review from Scony January 30, 2023 12:36
@smix8 smix8 force-pushed the navigation_agent_debug_4.x branch 2 times, most recently from 857a9df to 1282204 Compare January 30, 2023 17:26
@smix8
Copy link
Contributor Author

smix8 commented Jan 31, 2023

I removed the reliance on the Editor->Debug->Visible Nvaigation enabled and the NavigationServer debug_enabled. I still kept the reliance on debug_navigation_enable_agent_paths but this is enabled by default. Users need to go to the ProjectSettings and intentionally disable this. I guess if someone intentionally disables all agent paths it is expect that they do not appear so requires no further documentation why they don't appear anymore.

Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.
@akien-mga akien-mga modified the milestones: 4.x, 4.0 Feb 1, 2023
@akien-mga akien-mga merged commit 67ab9d8 into godotengine:master Feb 1, 2023
@akien-mga
Copy link
Member

Thanks!

@smix8 smix8 deleted the navigation_agent_debug_4.x branch February 1, 2023 19:22
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.

None yet

4 participants