You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/navigation/navigation_debug_tools.rst
+15-18Lines changed: 15 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,56 +1,53 @@
1
1
.. _doc_navigation_debug_tools:
2
2
3
-
Navigation Debug Tools
3
+
Navigation debug tools
4
4
======================
5
5
6
6
.. note::
7
7
8
8
The debug tools, properties and functions are only available in Godot debug builds.
9
9
Do not use any of them in code that will be part of a release build.
10
10
11
-
Enabling debug navigation
11
+
Enabling navigation debug
12
12
-------------------------
13
13
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.
17
16
18
17
.. image:: img/navigation_debug_toggle.png
19
18
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.
21
20
22
21
.. tabs::
23
22
.. code-tab:: gdscript GDScript
24
23
25
24
NavigationServer2D.set_debug_enabled(false)
26
25
NavigationServer3D.set_debug_enabled(true)
27
26
28
-
Debug navigation settings
27
+
Navigation debug settings
29
28
-------------------------
30
29
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.
33
32
34
33
.. image:: img/nav_debug_settings.png
35
34
36
35
Debug navigation mesh polygons
37
36
------------------------------
38
37
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.
41
40
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``.
44
42
45
43
.. image:: img/nav_debug_xray_edge_lines.png
46
44
47
-
48
45
Debug edge connections
49
46
----------------------
50
47
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``.
54
51
55
52
.. image:: img/nav_edge_connection2d.gif
56
53
@@ -60,7 +57,7 @@ The connections can be made visible through geometry with the navigation debug `
60
57
61
58
Edge connections are only visible when the NavigationServer is active.
62
59
63
-
Debug Performance
60
+
Debug performance
64
61
-----------------
65
62
66
63
To measure NavigationServer performance a dedicated monitor exists that can be found within the Editor Debugger under `Debugger->Monitors->NavigationProcess`.
Copy file name to clipboardExpand all lines: tutorials/navigation/navigation_introduction_2d.rst
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
.. _doc_navigation_overview_2d:
2
2
3
-
2D Navigation Overview
3
+
2D navigation overview
4
4
======================
5
5
6
6
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:
11
11
- :ref:`Astar2D<class_Astar2D>`
12
12
``Astar2D`` objects provide an option to find the shortest path in a graph of weighted **points**.
13
13
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.
``NavigationServer2D`` provides a powerful server API to find the shortest path between two positions on a area defined by a navigation mesh.
18
18
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.
21
21
22
22
The NavigationServer holds different navigation maps that each consist of regions that hold navigation mesh data.
23
23
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.
25
25
26
26
The following NavigationServer RID types are available.
27
27
- NavMap RID
28
28
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.
30
30
The map will synchronize regions and agents each physics frame.
31
31
- NavRegion RID
32
32
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.
34
34
- NavLink RID
35
35
Reference to a specific navigation link that connects two navigation mesh positions over arbitrary distances.
36
36
- 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.
38
39
- 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.
40
41
41
42
The following SceneTree Nodes are available as helpers to work with the NavigationServer2D API.
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.
71
73
72
74
- 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.
74
76
- The TileSet Editor creates and uses this resource internally when defining tile navigation areas.
75
77
76
78
.. seealso::
@@ -83,8 +85,8 @@ The 2D navigation meshes are defined with the following resources:
83
85
Setup for 2D scene
84
86
------------------
85
87
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.
88
90
89
91
#. Add a NavigationRegion2D Node to the scene.
90
92
@@ -99,8 +101,7 @@ NavigationServer2D and a NavigationAgent2D for path movement.
99
101
.. note::
100
102
101
103
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.
104
105
105
106
#. Add a CharacterBody2D node in the scene with a basic collision shape and a sprite or mesh
106
107
for visuals.
@@ -211,5 +212,4 @@ NavigationServer2D and a NavigationAgent2D for path movement.
211
212
212
213
.. note::
213
214
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