Skip to content

Update NavigationPathQueryObjects to explain all (new) options #11044

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jun 22, 2025

Updates NavigationPathQueryObjects to explain all (new) options (or flesh out existing).

.. available for NavigationPathQueryParameters2D / NavigationPathQueryParameters3D.

  • How to do a basic NavigationServer path query using parameters and result objects.
  • What all the different path postprocessing options do and how they should be used.
  • Path simplification.
  • Path meta data.
  • Filtering regions with the newer exclude or include filters.
  • Clipping paths and setting search limits

path_postprocess_diff

This is for Godot 4.5 only as some of the options are not available in older Godot versions or behave differently.

@Mickeon Mickeon added area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:navigation labels Jun 22, 2025
Comment on lines +6 to +8
.. tip::

For more advanced uses consider :ref:`doc_navigation_using_navigationpathqueryobjects` over NavigationAgent nodes.
Copy link
Member

Choose a reason for hiding this comment

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

Feels like this tip is better suited to the bottom of this section.
It's not even begun talking about navigation agents and the page is already suggesting to rethink your choice

Comment on lines +6 to +13
.. tip::

Path query parameters expose various options to improve pathfinding performance or lower memory consumptions.

They cater to more advanced pathfinding needs that the high-level nodes can not always cover.

See the respective option sections below.

Copy link
Member

Choose a reason for hiding this comment

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

This doesn't sound like a tip. It's describing exactly what these objects are for, I assume. Not sure what to do about that.

Updates NavigationPathQueryObjects to explain all (new) options.
@skyace65
Copy link
Contributor

Is this only applicable to 4.5?

@smix8
Copy link
Contributor Author

smix8 commented Jun 23, 2025

Is this only applicable to 4.5?

This is for Godot 4.5 only as some of the options are not available in older Godot versions or behave differently.

I was sneaky and placed that note at the very bottom below the image :D

@@ -3,6 +3,14 @@
Using NavigationPathQueryObjects
================================

.. tip::

Path query parameters expose various options to improve pathfinding performance or lower memory consumptions.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Path query parameters expose various options to improve pathfinding performance or lower memory consumptions.
Path query parameters expose various options to improve pathfinding performance or lower memory consumption.


Path post-processing differences depending on navigation mesh polygon layout.

A path query search travels from closest navigation mesh polygon edge to closest edge along the available polygons.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A path query search travels from closest navigation mesh polygon edge to closest edge along the available polygons.
A path query search travels from the closest navigation mesh polygon edge to the closest edge along the available polygons.


- The ``PATH_POSTPROCESSING_CORRIDORFUNNEL`` post processing shortens paths by funneling paths around corners **inside the available polygon corridor**.

This is the default post processing and usually also the most useful as it gives the shortest path result **inside the available polygon corridor**. If the polygon corridor is already suboptimal, e.g. due to a suboptimal navigation mesh layout, the funnel can snap to unexpected polygon corners causing detours.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This is the default post processing and usually also the most useful as it gives the shortest path result **inside the available polygon corridor**. If the polygon corridor is already suboptimal, e.g. due to a suboptimal navigation mesh layout, the funnel can snap to unexpected polygon corners causing detours.
This is the default post processing and usually also the most useful as it gives the shortest path result **inside the available polygon corridor**.
If the polygon corridor is already suboptimal, e.g. due to a suboptimal navigation mesh layout,
the funnel can snap to unexpected polygon corners causing detours.


- The ``PATH_POSTPROCESSING_EDGECENTERED`` post processing forces all path points to be placed in the middle of the crossed polygon edges **inside the available polygon corridor**.

This post processing is usually only useful when used with strictly tile-like navigation mesh polygons that are all evenly sized and where the excepted path following is also constrained to cell centers, e.g. typical grid game with movement constrained to grid cell centers.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This post processing is usually only useful when used with strictly tile-like navigation mesh polygons that are all evenly sized and where the excepted path following is also constrained to cell centers, e.g. typical grid game with movement constrained to grid cell centers.
This post processing is usually only useful when used with strictly tile-like navigation mesh polygons that are all
evenly sized and where the excepted path following is also constrained to cell centers,
e.g. typical grid game with movement constrained to grid cell centers.

Copy link
Member

Choose a reason for hiding this comment

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

I believe every single mention of "post processing" should be hyphenated ("post-processing"), too.

Path point difference with or without path simplification.

If ``simplify_path`` is enabled a variant of the Ramer-Douglas-Peucker path simplification algorithm is applied to the path.
This algorithm straightens paths by removing less relevant path points depending on the used ``simplify_epsilon``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This algorithm straightens paths by removing less relevant path points depending on the used ``simplify_epsilon``.
This algorithm straightens paths by removing less relevant path points depending on the ``simplify_epsilon`` used.

Path length clips can be helpful to create paths that better fit constrained gameplay, e.g. tactical games with limited movement ranges.

- Property ``path_return_max_length`` can be used to clip the returned path to a specific max length.
- Property ``path_return_max_radius`` can be used to clip the returned path inside a circle (2D) or sphere (3D) radius around the start position.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Property ``path_return_max_radius`` can be used to clip the returned path inside a circle (2D) or sphere (3D) radius around the start position.
- The ``path_return_max_radius`` property can be used to clip the returned path inside a circle (2D) or sphere (3D) radius around the start position.

- Property ``path_return_max_length`` can be used to clip the returned path to a specific max length.
- Property ``path_return_max_radius`` can be used to clip the returned path inside a circle (2D) or sphere (3D) radius around the start position.

Query parameters allow to limit the path search to only searched up to a specific distance or a specific amount of searched polygons.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Query parameters allow to limit the path search to only searched up to a specific distance or a specific amount of searched polygons.
Query parameters allow limiting the path search to only search up to a specific distance or a specific number of searched polygons.

Query parameters allow to limit the path search to only searched up to a specific distance or a specific amount of searched polygons.
These options are for performance and affect the path search directly.

- Property ``path_search_max_distance`` can be used to stop the path search when going over this distance from the start position.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Property ``path_search_max_distance`` can be used to stop the path search when going over this distance from the start position.
- The ``path_search_max_distance`` property can be used to stop the path search when going over this distance from the start position.

These options are for performance and affect the path search directly.

- Property ``path_search_max_distance`` can be used to stop the path search when going over this distance from the start position.
- Property ``path_search_max_polygons`` can be used to stop the path search when going over this searched polygon amount.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Property ``path_search_max_polygons`` can be used to stop the path search when going over this searched polygon amount.
- The ``path_search_max_polygons`` property can be used to stop the path search when going over this searched polygon number.

- Property ``path_search_max_distance`` can be used to stop the path search when going over this distance from the start position.
- Property ``path_search_max_polygons`` can be used to stop the path search when going over this searched polygon amount.

When the path search is stopped by reaching a limit the path resets and creates a path from the start position polygon to the so far found polygon that is closest to the target position.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
When the path search is stopped by reaching a limit the path resets and creates a path from the start position polygon to the so far found polygon that is closest to the target position.
When the path search is stopped by reaching a limit the path resets and creates a path from the start position polygon
to the polygon found so far that is closest to the target position.

@skyace65 skyace65 added this to the 4.5 milestone Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:navigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants