Skip to content

Commit 86e51a0

Browse files
authored
Merge pull request godotengine#8199 from timothyqiu/nav-markup
Improve the navigation documentation markup
2 parents e269ed9 + aa83e4b commit 86e51a0

10 files changed

+83
-83
lines changed

tutorials/navigation/navigation_connecting_navmesh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ navigation region edge connections on the NavigationServer and should be avoided
2626
Exactly means exactly for the vertex position merge. Small float errors
2727
that happen quite regularly with imported meshes will prevent a successful vertex merge.
2828

29-
Alternatively navigation meshes are not merged but still considered as ``connected`` by
29+
Alternatively navigation meshes are not merged but still considered as **connected** by
3030
the NavigationServer when their edges are nearly parallel and within distance
3131
to each other. The connection distance is defined by the ``edge_connection_margin`` for each
3232
navigation map. In many cases navigation mesh edges cannot properly connect when they partly overlap.

tutorials/navigation/navigation_debug_tools.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ Navigation debug tools
55

66
.. note::
77

8-
The debug tools, properties and functions are only available in Godot debug builds.
8+
The debug tools, properties and functions are only available in Godot debug builds.
99
Do not use any of them in code that will be part of a release build.
1010

1111
Enabling navigation debug
1212
-------------------------
1313

14-
The navigation debug visualizations are enabled by default inside the Editor.
15-
To visualize navigation meshes and connections at runtime too, enable the option ``Visible Navigation`` in the editor ``Debug`` menu.
14+
The navigation debug visualizations are enabled by default inside the editor.
15+
To visualize navigation meshes and connections at runtime too, enable the option **Visible Navigation** in the editor **Debug** menu.
1616

1717
.. image:: img/navigation_debug_toggle.png
1818

1919
In Godot debug builds the navigation debug can also be toggled through the NavigationServer singletons from scripts.
2020

2121
.. tabs::
2222
.. code-tab:: gdscript GDScript
23-
23+
2424
NavigationServer2D.set_debug_enabled(false)
2525
NavigationServer3D.set_debug_enabled(true)
2626

@@ -60,21 +60,21 @@ The connections can be made visible through geometry with ``enable_edge_connecti
6060
Debug performance
6161
-----------------
6262

63-
To measure NavigationServer performance a dedicated monitor exists that can be found within the Editor Debugger under `Debugger->Monitors->NavigationProcess`.
63+
To measure NavigationServer performance a dedicated monitor exists that can be found within the Editor Debugger under *Debugger->Monitors->Navigation Process*.
6464

6565
.. image:: img/navigation_debug_performance1.webp
6666

67-
NavigationProcess shows how long the NavigationServer spends updating its internals this update frame in milliseconds.
68-
NavigationProcess works similar to Process for visual frame rendering and PhysicsProcess for collision and fixed updates.
67+
Navigation Process shows how long the NavigationServer spends updating its internals this update frame in milliseconds.
68+
Navigation Process works similar to Process for visual frame rendering and Physics Process for collision and fixed updates.
6969

70-
NavigationProcess accounts for all updates to ``navigation maps``, ``navigation regions`` and ``navigation agents`` as well as all the ``avoidance calculations`` for the update frame.
70+
Navigation Process accounts for all updates to **navigation maps**, **navigation regions** and **navigation agents** as well as all the **avoidance calculations** for the update frame.
7171

7272
.. note::
7373

74-
NavigationProcess does NOT include pathfinding performance cause pathfinding operates on the navigation map data independently from the server process update.
74+
Navigation Process does NOT include pathfinding performance cause pathfinding operates on the navigation map data independently from the server process update.
7575

76-
NavigationProcess should be in general kept as low and as stable as possible for runtime performance to avoid frame rate issues.
77-
Note that since the NavigationServer process update happens in the middle of the physics update an increase in NavigationProcess will automatically increase PhysicsProcess by the same amount.
76+
Navigation Process should be in general kept as low and as stable as possible for runtime performance to avoid frame rate issues.
77+
Note that since the NavigationServer process update happens in the middle of the physics update an increase in Navigation Process will automatically increase Physics Process by the same amount.
7878

7979
Navigation also provides more detailed statistics about the current navigation related objects and navigation map composition on the NavigationServer.
8080

tutorials/navigation/navigation_using_navigationagents.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Using NavigationAgents
44
======================
55

6-
NavigationsAgents are helper nodes that combine functionality
6+
NavigationsAgents are helper nodes that combine functionality
77
for pathfinding, path following and agent avoidance for a Node2D/3D inheriting parent node.
8-
They facilitate common calls to the NavigationServer API on
8+
They facilitate common calls to the NavigationServer API on
99
behalf of the parent actor node in a more convenient manner for beginners.
1010

1111
2D and 3D version of NavigationAgents are available as
1212
:ref:`NavigationAgent2D<class_NavigationAgent2D>` and
1313
:ref:`NavigationAgent3D<class_NavigationAgent3D>` respectively.
1414

15-
New NavigationAgent nodes will automatically join the default navigation map on the World2D/World3D.
15+
New NavigationAgent nodes will automatically join the default navigation map on the :ref:`World2D<class_World2D>`/:ref:`World3D<class_World3D>`.
1616

1717
NavigationsAgent nodes are optional and not a hard requirement to use the navigation system.
1818
Their entire functionality can be replaced with scripts and direct calls to the NavigationServer API.
@@ -39,7 +39,7 @@ NavigationAgent Pathfollowing
3939
After a ``target_position`` has been set for the agent, the next position to follow in the path
4040
can be retrieved with the ``get_next_path_position()`` function.
4141

42-
Once the next path position is received move the parent actor node of the agent
42+
Once the next path position is received move the parent actor node of the agent
4343
towards this path position with your own movement code.
4444

4545
.. note::
@@ -50,8 +50,8 @@ towards this path position with your own movement code.
5050
NavigationAgents have their own internal logic to proceed with the current path and call for updates.
5151

5252
The ``get_next_path_position()`` function is responsible for updating many of the agent's internal states and properties.
53-
The function should be repeatedly called `once` every ``physics_process`` until ``is_navigation_finished()`` tells that the path is finished.
54-
The function should not be called after the target position or path end has been reached
53+
The function should be repeatedly called *once* every ``physics_process`` until ``is_navigation_finished()`` tells that the path is finished.
54+
The function should not be called after the target position or path end has been reached
5555
as it can make the agent jitter in place due to the repeated path updates.
5656
Always check very early in script with ``is_navigation_finished()`` if the path is already finished.
5757

@@ -74,7 +74,7 @@ Pathfollowing common problems
7474
There are some common user problems and important caveats to consider when writing agent movement scripts.
7575

7676
- The path is returned empty
77-
If an agent queries a path before the navigation map synchronisation, e.g. in a _ready() function, the path might return empty. In this case the get_next_path_position() function will return the same position as the agent parent node and the agent will consider the path end reached. This is fixed by making a deferred call or using a callback e.g. waiting for the navigation map changed signal.
77+
If an agent queries a path before the navigation map synchronisation, e.g. in a ``_ready()`` function, the path might return empty. In this case the ``get_next_path_position()`` function will return the same position as the agent parent node and the agent will consider the path end reached. This is fixed by making a deferred call or using a callback e.g. waiting for the navigation map changed signal.
7878

7979
- The agent is stuck dancing between two positions
8080
This is usually caused by very frequent path updates every single frame, either deliberate or by accident (e.g. max path distance set too short). The pathfinding needs to find the closest position that are valid on navigation mesh. If a new path is requested every single frame the first path positions might end up switching constantly in front and behind the agent's current position, causing it to dance between the two positions.
@@ -94,7 +94,7 @@ In order for NavigationAgents to use the avoidance feature the ``enable_avoidanc
9494

9595
.. image:: img/agent_avoidance_enabled.png
9696

97-
The velocity_computed signal of the NavigationAgent node must be connected to receive the ``safe_velocity`` calculation result.
97+
The ``velocity_computed`` signal of the NavigationAgent node must be connected to receive the safe velocity calculation result.
9898

9999
.. image:: img/agent_safevelocity_signal.png
100100

@@ -132,7 +132,7 @@ NavigationObstacles can be used to add some environment constrains to the avoida
132132
Avoidance does not affect the pathfinding. It should be seen as an additional option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently in order to move around them.
133133

134134
Using the NavigationAgent ``enable_avoidance`` property is the preferred option
135-
to toggle avoidance. The following code snippets can be used to
135+
to toggle avoidance. The following code snippets can be used to
136136
toggle avoidance on agents, create or delete avoidance callbacks or switch avoidance modes.
137137

138138
.. tabs::
@@ -179,7 +179,7 @@ The following sections provides script templates for nodes commonly used with Na
179179
Actor as Node3D
180180
~~~~~~~~~~~~~~~
181181

182-
This script adds basic navigation movement to a Node3D with a NavigationAgent3D child node.
182+
This script adds basic navigation movement to a :ref:`Node3D <class_Node3D>` with a :ref:`NavigationAgent3D <class_NavigationAgent3D>` child node.
183183

184184
.. tabs::
185185
.. code-tab:: gdscript GDScript
@@ -214,7 +214,7 @@ This script adds basic navigation movement to a Node3D with a NavigationAgent3D
214214
Actor as CharacterBody3D
215215
~~~~~~~~~~~~~~~~~~~~~~~~
216216

217-
This script adds basic navigation movement to a CharacterBody3D with a NavigationAgent3D child node.
217+
This script adds basic navigation movement to a :ref:`CharacterBody3D <class_CharacterBody3D>` with a :ref:`NavigationAgent3D <class_NavigationAgent3D>` child node.
218218

219219
.. tabs::
220220
.. code-tab:: gdscript GDScript
@@ -248,7 +248,7 @@ This script adds basic navigation movement to a CharacterBody3D with a Navigatio
248248
Actor as RigidBody3D
249249
~~~~~~~~~~~~~~~~~~~~
250250

251-
This script adds basic navigation movement to a RigidBody3D with a NavigationAgent3D child node.
251+
This script adds basic navigation movement to a :ref:`RigidBody3D <class_RigidBody3D>` with a :ref:`NavigationAgent3D <class_NavigationAgent3D>` child node.
252252

253253
.. tabs::
254254
.. code-tab:: gdscript GDScript

tutorials/navigation/navigation_using_navigationlayers.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Using NavigationLayers
66
NavigationLayers are an optional feature to further control which navigation meshes are considered in a path query and which regions can be connected.
77
They work similar to how physics layers control collision between collision objects or how visual layers control what is rendered to the Viewport.
88

9-
NavigationLayers can be named in the ``ProjectSettings`` the same as PhysicsLayers or VisualLayers.
9+
NavigationLayers can be named in the **ProjectSettings** the same as physics layers or visual layers.
1010

1111
.. image:: img/navigationlayers_naming.png
1212

@@ -15,12 +15,12 @@ If two regions have not a single compatible layer they will not be merged by the
1515
If a region has not a single compatible navigation layer with the ``navigation_layers`` parameter of a path query this regions navigation mesh will be skipped in pathfinding.
1616
See :ref:`doc_navigation_using_navigationpaths` for more information on querying the NavigationServer for paths.
1717

18-
NavigationLayers are a single ``int`` value that is used as a ``bitmask``.
18+
NavigationLayers are a single ``int`` value that is used as a **bitmask**.
1919
Many navigation related nodes have ``set_navigation_layer_value()`` and
2020
``get_navigation_layer_value()`` functions to set and get a layer number directly
2121
without the need for more complex bitwise operations.
2222

23-
In scripts the following helper functions can be used to work with the navigation_layers bitmask.
23+
In scripts the following helper functions can be used to work with the ``navigation_layers`` bitmask.
2424

2525
.. tabs::
2626
.. code-tab:: gdscript GDScript
@@ -64,4 +64,4 @@ trigger large scale updates on the NavigationServer.
6464
Changing the navigation layers of NavigationAgent nodes will have an immediate
6565
effect on the next path query. Changing the navigation layers of
6666
regions will have an immediate effect on the region but any new region
67-
connect or disconnect will only be in effect after the next physics_frame.
67+
connect or disconnect will only be in effect after the next physics frame.

tutorials/navigation/navigation_using_navigationlinks.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Using NavigationLinks
55

66
.. image:: img/nav_navmesh_links.png
77

8-
NavigationLinks are used to connect navigation mesh polygons from :ref:`NavigationRegion2D<class_NavigationRegion2D>`
8+
NavigationLinks are used to connect navigation mesh polygons from :ref:`NavigationRegion2D<class_NavigationRegion2D>`
99
and :ref:`NavigationRegion3D<class_NavigationRegion3D>` over arbitrary distances for pathfinding.
1010

11-
NavigationLinks are also used to consider movement shortcuts in pathfinding available through
11+
NavigationLinks are also used to consider movement shortcuts in pathfinding available through
1212
interacting with gameplay objects e.g. ladders, jump pads or teleports.
1313

14-
2D and 3D versions of NavigationJumplinks nodes are available as
15-
:ref:`NavigationLink2D<class_NavigationLink2D>` and
14+
2D and 3D versions of NavigationJumplinks nodes are available as
15+
:ref:`NavigationLink2D<class_NavigationLink2D>` and
1616
:ref:`NavigationLink3D<class_NavigationLink3D>` respectively.
1717

18-
Different NavigationRegions can connect their navigation meshes without the need for a NavigationLink
18+
Different NavigationRegions can connect their navigation meshes without the need for a NavigationLink
1919
as long as they are within navigation map ``edge_connection_margin`` and have compatible ``navigation_layers``.
2020
As soon as the distance becomes too large, building valid connections becomes a problem - a problem that NavigationLinks can solve.
2121

@@ -25,17 +25,17 @@ See :ref:`doc_navigation_connecting_navmesh` to learn more about how to connect
2525
.. image:: img/nav_link_properties.png
2626

2727
NavigationLinks share many properties with NavigationRegions like ``navigation_layers``.
28-
NavigationLinks add a single connection between two positions over an arbitrary distance
28+
NavigationLinks add a single connection between two positions over an arbitrary distance
2929
compared to NavigationRegions that add a more local traversable area with a navigation mesh resource.
3030

3131
NavigationLinks have a ``start_position`` and ``end_position`` and can go in both directions when ``bidirectional`` is enabled.
3232
When placed a navigationlink connects the navigation mesh polygons closest to its ``start_position`` and ``end_position`` within search radius for pathfinding.
3333

34-
The polygon search radius can be configured globally in the ProjectSettings under ``navigation/2d_or_3d/default_link_connection_radius``
35-
or set for each navigation ``map`` individually using the ``NavigationServer.map_set_link_connection_radius()`` function.
34+
The polygon search radius can be configured globally in the ProjectSettings under ``navigation/2d_or_3d/default_link_connection_radius``
35+
or set for each navigation **map** individually using the ``NavigationServer.map_set_link_connection_radius()`` function.
3636

3737
Both ``start_position`` and ``end_position`` have debug markers in the Editor.
38-
The visible radius of a position shows the polygon search radius.
38+
The visible radius of a position shows the polygon search radius.
3939
All navigation mesh polygons inside are compared and the closest is picked for the edge connection.
4040
If no valid polygon is found within the search radius the navigation link gets disabled.
4141

@@ -48,6 +48,6 @@ The visibility of the debug can also be controlled in the Editor 3D Viewport giz
4848

4949
NavigationLinks do not move agents between the two link positions by themselves.
5050

51-
A navigation link does not provide any automated movement through the link. Instead, when
52-
an agent reaches the position of a link, game code needs to react (e.g. through area triggers) and provide means for the agent
51+
A navigation link does not provide any automated movement through the link. Instead, when
52+
an agent reaches the position of a link, game code needs to react (e.g. through area triggers) and provide means for the agent
5353
to move through the link to end up at the links other position (e.g. through teleport or animation) to continue along the path.

tutorials/navigation/navigation_using_navigationmaps.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Default navigation maps
2121

2222
By default Godot creates a navigation map for each :ref:`World2D<class_World2D>` and :ref:`World3D<class_World3D>` of the root viewport.
2323

24-
The 2D default navigation ``map`` RID can be obtained with ``get_world_2d().get_navigation_map()`` from any :ref:`Node2D<class_Node2D>` inheriting Node.
24+
The 2D default navigation map RID can be obtained with ``get_world_2d().get_navigation_map()`` from any :ref:`Node2D<class_Node2D>` inheriting Node.
2525

26-
The 3D default navigation ``map`` RID can be obtained with ``get_world_3d().get_navigation_map()`` from any :ref:`Node3D<class_Node3D>` inheriting Node.
26+
The 3D default navigation map RID can be obtained with ``get_world_3d().get_navigation_map()`` from any :ref:`Node3D<class_Node3D>` inheriting Node.
2727

2828
.. tabs::
2929
.. code-tab:: gdscript GDScript

tutorials/navigation/navigation_using_navigationmeshes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ that appear in the top bar of the editor when a NavigationRegion2D is selected.
3030

3131
.. image:: img/nav_polydrawtool.png
3232

33-
The NavigationPolygon draw tools can be used to create and edit navigation meshes by defining ``outline`` polygons.
33+
The NavigationPolygon draw tools can be used to create and edit navigation meshes by defining **outline** polygons.
3434
The outline polygons are later converted to real navigation mesh resources for the NavigationServer regions.
3535

3636
.. image:: img/nav_polymatroschka.png

tutorials/navigation/navigation_using_navigationpaths.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To obtain a 3D path, use ``NavigationServer3D.map_get_path(map, from, to, optimi
1616
For more customizable navigation path queries that require additional setup see :ref:`doc_navigation_using_navigationpathqueryobjects`.
1717

1818
One of the required parameters for the query is the RID of the navigation map.
19-
Each game ``World`` has a default navigation map automatically created.
19+
Each game world has a default navigation map automatically created.
2020
The default navigation maps can be retrieved with ``get_world_2d().get_navigation_map()`` from
2121
any Node2D inheriting node or ``get_world_3d().get_navigation_map()`` from any Node3D inheriting node.
2222
The second and third parameters are the starting position and the target position as Vector2 for 2D or Vector3 for 3D.

tutorials/navigation/navigation_using_navigationregions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Using NavigationRegions
44
=======================
55

6-
NavigationRegions are the visual Node representation of a ``region`` of the navigation ``map`` on the NavigationServer.
6+
NavigationRegions are the visual Node representation of a **region** of the navigation **map** on the NavigationServer.
77
Each NavigationRegion node holds a resource for the navigation mesh data.
88

99
Both 2D and 3D version are available as :ref:`NavigationRegion2D<class_NavigationRegion2D>`

0 commit comments

Comments
 (0)