Skip to content

Commit ce50017

Browse files
authored
Merge pull request godotengine#8028 from ershn/improve_the_navigation_docs_wording
Improve the navigation documentation wording
2 parents ce79337 + fa132e9 commit ce50017

11 files changed

+151
-155
lines changed

tutorials/navigation/navigation_connecting_navmesh.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _doc_navigation_connecting_navmesh:
22

3-
Connecting NavigationMeshes
4-
===========================
3+
Connecting navigation meshes
4+
============================
55

66
Different NavigationMeshes are automatically merged by the NavigationServer
77
when at least two vertex positions of one edge exactly overlap.
@@ -26,10 +26,10 @@ 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 ``NavigationMesh``s 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
32-
navigation map. In many cases NavigationMesh edges cannot properly connect when they partly overlap.
32+
navigation map. In many cases navigation mesh edges cannot properly connect when they partly overlap.
3333
Better avoid any navigation mesh overlap at all time for a consistent merge behavior.
3434

3535
.. image:: img/navigation_edge_connection.png

tutorials/navigation/navigation_debug_tools.rst

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,53 @@
11
.. _doc_navigation_debug_tools:
22

3-
Navigation Debug Tools
3+
Navigation debug tools
44
======================
55

66
.. note::
77

88
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

11-
Enabling debug navigation
11+
Enabling navigation debug
1212
-------------------------
1313

14-
The navigation debug visualization is enabled by default inside the Editor.
15-
To visualize navigation meshes and connections also at runtime
16-
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.
1716

1817
.. image:: img/navigation_debug_toggle.png
1918

20-
In Godot debug builds the navigation debug can also be toggled on the NavigationServers from scripts.
19+
In Godot debug builds the navigation debug can also be toggled through the NavigationServer singletons from scripts.
2120

2221
.. tabs::
2322
.. code-tab:: gdscript GDScript
2423

2524
NavigationServer2D.set_debug_enabled(false)
2625
NavigationServer3D.set_debug_enabled(true)
2726

28-
Debug navigation settings
27+
Navigation debug settings
2928
-------------------------
3029

31-
The appearance of navigation debug can be change in the ProjectSettings under ``debug/shapes/navigation``.
32-
Certain debug features can also be enabled or disabled at will but may require a scene restart to apply.
30+
The appearance of navigation debug can be changed in the ProjectSettings under ``debug/shapes/navigation``.
31+
Certain debug features can also be enabled or disabled at will but may require a scene restart to take effect.
3332

3433
.. image:: img/nav_debug_settings.png
3534

3635
Debug navigation mesh polygons
3736
------------------------------
3837

39-
If ``enable_edge_lines`` is enabled the edges of navigation mesh polygons will be highlighted.
40-
If ``enable_edge_lines_xray`` is also enabled the edges of navigationmeshes will be visible through geometry.
38+
If ``enable_edge_lines`` is enabled, the edges of navigation mesh polygons will be highlighted.
39+
If ``enable_edge_lines_xray`` is also enabled, the edges of navigation meshes will be visible through geometry.
4140

42-
if ``enable_geometry_face_random_color`` is enabled each navigation mesh face receives
43-
a random color that is mixed with the main color from ``geometry_face_color``.
41+
If ``enable_geometry_face_random_color`` is enabled, the color of each navigation mesh face will be mixed with a random color that is itself mixed with the color specified in ``geometry_face_color``.
4442

4543
.. image:: img/nav_debug_xray_edge_lines.png
4644

47-
4845
Debug edge connections
4946
----------------------
5047

51-
Different navigation meshes connected within ``edge_connection_margin`` distance are overlaid.
52-
The color of the overlay is controlled with the navigation debug ``edge_connection_color``.
53-
The connections can be made visible through geometry with the navigation debug ``enable_edge_connections_xray`` property.
48+
When two navigation meshes are connected within ``edge_connection_margin`` distance, the connection is overlaid.
49+
The color of the overlay is controlled by ``edge_connection_color``.
50+
The connections can be made visible through geometry with ``enable_edge_connections_xray``.
5451

5552
.. image:: img/nav_edge_connection2d.gif
5653

@@ -60,7 +57,7 @@ The connections can be made visible through geometry with the navigation debug `
6057

6158
Edge connections are only visible when the NavigationServer is active.
6259

63-
Debug Performance
60+
Debug performance
6461
-----------------
6562

6663
To measure NavigationServer performance a dedicated monitor exists that can be found within the Editor Debugger under `Debugger->Monitors->NavigationProcess`.

tutorials/navigation/navigation_different_actor_area_access.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ A typical example for different area access in gameplay are doors that connect r
99
with different navigation meshes and are not accessible by all actors all the time.
1010

1111
Add a NavigationRegion at the door position.
12-
Add an appropriated navigationmesh the size of the door that can connect with the surrounding navigationmeshes.
13-
In order to control access enable / disable navigation layer bits so path queries
14-
that use the same navigation layer bits can find a path through the "door" navigationmesh.
12+
Add an appropriate navigation mesh the size of the door that can connect with the surrounding navigation meshes.
13+
In order to control access, enable / disable navigation layer bits so path queries
14+
that use the same navigation layer bits can find a path through the "door" navigation mesh.
1515

1616
The bitmask can act as a set of door keys or abilities and only actors with at least
1717
one matching and enabled bit layer in their pathfinding query will find a path through this region.
@@ -22,7 +22,7 @@ See :ref:`doc_navigation_advanced_using_navigationlayers` for more information o
2222
The entire "door" region can also be enabled / disable if required but if disabled will block access for all path queries.
2323

2424
Prefer working with navigation layers in path queries whenever possible as enabling or disabling
25-
navigation layers on a region triggers a performance costly recalculation of the navigation map connections.
25+
navigation layers on a region triggers a costly recalculation of the navigation map connections.
2626

2727
.. warning::
2828

tutorials/navigation/navigation_introduction_2d.rst

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _doc_navigation_overview_2d:
22

3-
2D Navigation Overview
3+
2D navigation overview
44
======================
55

66
Godot provides multiple objects, classes and servers to facilitate grid-based or mesh-based navigation and pathfinding for 2D and 3D games.
@@ -11,66 +11,68 @@ Godot provides the following objects and classes for 2D navigation:
1111
- :ref:`Astar2D<class_Astar2D>`
1212
``Astar2D`` objects provide an option to find the shortest path in a graph of weighted **points**.
1313

14-
The AStar2D class is best suited for cellbased 2D gameplay that does not require actors to reach any possible position within an area but only predefined, distinct positions.
14+
The AStar2D class is best suited for cell-based 2D gameplay that does not require actors to reach any possible position within an area but only predefined, distinct positions.
1515

1616
- :ref:`NavigationServer2D<class_NavigationServer2D>`
1717
``NavigationServer2D`` provides a powerful server API to find the shortest path between two positions on a area defined by a navigation mesh.
1818

19-
The NavigationServer is best suited for 2D realtime gameplay that does require actors to reach any possible position within an navmesh defined area.
20-
Meshbased navigation scales well with large gameworlds as a large area can often be defined with a single polygon when it would require many, many grid cells.
19+
The NavigationServer is best suited for 2D realtime gameplay that does require actors to reach any possible position within a navigation mesh defined area.
20+
Mesh-based navigation scales well with large game worlds as a large area can often be defined with a single polygon when it would require many, many grid cells.
2121

2222
The NavigationServer holds different navigation maps that each consist of regions that hold navigation mesh data.
2323
Agents can be placed on a map for avoidance calculation.
24-
RIDs are used to reference the internal maps, regions and agents when communicating with the server.
24+
RIDs are used to reference internal maps, regions, and agents when communicating with the server.
2525

2626
The following NavigationServer RID types are available.
2727
- NavMap RID
2828
Reference to a specific navigation map that holds regions and agents.
29-
The map will attempt to join changed navigation meshes of regions by proximity.
29+
The map will attempt to join the navigation meshes of the regions by proximity.
3030
The map will synchronize regions and agents each physics frame.
3131
- NavRegion RID
3232
Reference to a specific navigation region that can hold navigation mesh data.
33-
The region can be enabled / disabled or the use restricted with a navigationlayer bitmask.
33+
The region can be enabled / disabled or the use restricted with a navigation layer bitmask.
3434
- NavLink RID
3535
Reference to a specific navigation link that connects two navigation mesh positions over arbitrary distances.
3636
- NavAgent RID
37-
Reference to a specific avoidance agent with a radius value use solely in avoidance.
37+
Reference to a specific avoidance agent.
38+
The avoidance is specified by a radius value.
3839
- NavObstacle RID
39-
Reference to a specific avoidance obstacle used to affect and constrain avoidance velocities of agents.
40+
Reference to a specific avoidance obstacle used to affect and constrain the avoidance velocity of agents.
4041

4142
The following SceneTree Nodes are available as helpers to work with the NavigationServer2D API.
4243

4344
- :ref:`NavigationRegion2D<class_NavigationRegion2D>` Node
4445
A Node that holds a NavigationPolygon resource that defines a navigation mesh for the NavigationServer2D.
4546

4647
- The region can be enabled / disabled.
47-
- The use in pathfinding can be further restricted through the navigationlayers bitmask.
48-
- Regions can join their navigation meshes by proximity for a combined navigation mesh.
48+
- The use in pathfinding can be further restricted through the ``navigation_layers`` bitmask.
49+
- The NavigationServer2D will join the navigation meshes of regions by proximity for a combined navigation mesh.
4950

5051
- :ref:`NavigationLink2D<class_NavigationLink2D>` Node
51-
A Node that connects two positions on navigation mesh over arbitrary distances for pathfinding.
52+
A Node that connects two positions on navigation meshes over arbitrary distances for pathfinding.
5253

5354
- The link can be enabled / disabled.
5455
- The link can be made one-way or bidirectional.
55-
- The use in pathfinding can be further restricted through the navigationlayers bitmask.
56+
- The use in pathfinding can be further restricted through the ``navigation_layers`` bitmask.
5657

5758
Links tell the pathfinding that a connection exists and at what cost. The actual agent handling and movement needs to happen in custom scripts.
5859

5960
- :ref:`NavigationAgent2D<class_NavigationAgent2D>` Node
60-
An optional helper Node to facilitate common NavigationServer2D API calls for pathfinding and avoidance
61-
for a Node2D inheriting parent Node.
61+
A helper Node used to facilitate common NavigationServer2D API calls for pathfinding and avoidance.
62+
Use this Node with a Node2D inheriting parent Node.
6263

6364
- :ref:`NavigationObstacle2D<class_NavigationObstacle2D>` Node
64-
A Node that can be used to affect and constrain avoidance velocities of avoidance enabled agents.
65-
This Node does NOT affect the pathfinding of agents which requires changing the navigation mesh instead.
65+
A Node that can be used to affect and constrain the avoidance velocity of avoidance enabled agents.
66+
This Node does NOT affect the pathfinding of agents. You need to change the navigation meshes for that instead.
6667

6768
The 2D navigation meshes are defined with the following resources:
6869

6970
- :ref:`NavigationPolygon<class_NavigationPolygon>` Resource
70-
A resource that holds 2D navigation mesh data and provides polygon drawtools to define navigation areas inside the Editor as well as at runtime.
71+
A resource that holds 2D navigation mesh data.
72+
It provides polygon drawing tools to allow defining navigation areas inside the Editor as well as at runtime.
7173

7274
- The NavigationRegion2D Node uses this resource to define its navigation area.
73-
- The NavigationServer2D uses this resource to update navmesh of individual regions.
75+
- The NavigationServer2D uses this resource to update the navigation mesh of individual regions.
7476
- The TileSet Editor creates and uses this resource internally when defining tile navigation areas.
7577

7678
.. seealso::
@@ -83,8 +85,8 @@ The 2D navigation meshes are defined with the following resources:
8385
Setup for 2D scene
8486
------------------
8587

86-
The following steps show the basic setup for a minimum viable navigation in 2D that uses the
87-
NavigationServer2D and a NavigationAgent2D for path movement.
88+
The following steps show the basic setup for minimal viable navigation in 2D.
89+
It uses the NavigationServer2D and a NavigationAgent2D for path movement.
8890

8991
#. Add a NavigationRegion2D Node to the scene.
9092

@@ -99,8 +101,7 @@ NavigationServer2D and a NavigationAgent2D for path movement.
99101
.. note::
100102

101103
The navigation mesh defines the area where an actor can stand and move with its center.
102-
Leave enough margin between the navpolygon edges and collision objects to not get path
103-
following actors repeatedly stuck on collision.
104+
Leave enough margin between the navigation polygon edges and collision objects to not get path following actors repeatedly stuck on collision.
104105

105106
#. Add a CharacterBody2D node in the scene with a basic collision shape and a sprite or mesh
106107
for visuals.
@@ -211,5 +212,4 @@ NavigationServer2D and a NavigationAgent2D for path movement.
211212

212213
.. note::
213214

214-
On the first frame the NavigationServer map has not synchronized region data and any path query
215-
will return empty. Await one frame to pause scripts until the NavigationServer had time to sync.
215+
On the first frame the NavigationServer map has not synchronized region data and any path query will return empty. Wait for the NavigationServer synchronization by awaiting one frame in the script.

0 commit comments

Comments
 (0)