Skip to content

Commit 8b2952a

Browse files
committed
Merge pull request godotengine#101504 from AThousandShips/nav_split_new
[Navigation] Create a dedicated 2D navigation server
2 parents ba34829 + 5cc0539 commit 8b2952a

File tree

90 files changed

+8079
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+8079
-906
lines changed

.github/CODEOWNERS

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
/modules/gridmap/ @godotengine/3d-nodes
168168
/modules/gridmap/doc_classes/ @godotengine/3d-nodes @godotengine/documentation
169169
/modules/gridmap/icons/ @godotengine/3d-nodes @godotengine/usability
170-
/modules/navigation/ @godotengine/navigation
170+
/modules/navigation_2d/ @godotengine/navigation
171+
/modules/navigation_3d/ @godotengine/navigation
171172
/modules/noise/ @godotengine/core
172173
/modules/noise/doc_classes/ @godotengine/core @godotengine/documentation
173174
/modules/noise/icons/ @godotengine/core @godotengine/usability

core/config/project_settings.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,17 @@ ProjectSettings::ProjectSettings() {
16311631
GLOBAL_DEF_INTERNAL("internationalization/locale/translations_pot_files", PackedStringArray());
16321632
GLOBAL_DEF_INTERNAL("internationalization/locale/translation_add_builtin_strings_to_pot", false);
16331633

1634+
GLOBAL_DEF("navigation/world/map_use_async_iterations", true);
1635+
1636+
GLOBAL_DEF("navigation/avoidance/thread_model/avoidance_use_multiple_threads", true);
1637+
GLOBAL_DEF("navigation/avoidance/thread_model/avoidance_use_high_priority_threads", true);
1638+
1639+
GLOBAL_DEF("navigation/pathfinding/max_threads", 4);
1640+
1641+
GLOBAL_DEF("navigation/baking/use_crash_prevention_checks", true);
1642+
GLOBAL_DEF("navigation/baking/thread_model/baking_use_multiple_threads", true);
1643+
GLOBAL_DEF("navigation/baking/thread_model/baking_use_high_priority_threads", true);
1644+
16341645
ProjectSettings::get_singleton()->add_hidden_prefix("input/");
16351646
}
16361647

doc/classes/NavigationServer2D.xml

+51
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@
303303
Returns all created navigation map [RID]s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them.
304304
</description>
305305
</method>
306+
<method name="get_process_info" qualifiers="const">
307+
<return type="int" />
308+
<param index="0" name="process_info" type="int" enum="NavigationServer2D.ProcessInfo" />
309+
<description>
310+
Returns information about the current state of the NavigationServer. See [enum ProcessInfo] for a list of available states.
311+
</description>
312+
</method>
306313
<method name="is_baking_navigation_polygon" qualifiers="const">
307314
<return type="bool" />
308315
<param index="0" name="navigation_polygon" type="NavigationPolygon" />
@@ -971,6 +978,13 @@
971978
If [param enabled] is [code]true[/code], the navigation [param region] will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin.
972979
</description>
973980
</method>
981+
<method name="set_active">
982+
<return type="void" />
983+
<param index="0" name="active" type="bool" />
984+
<description>
985+
Control activation of this server.
986+
</description>
987+
</method>
974988
<method name="set_debug_enabled">
975989
<return type="void" />
976990
<param index="0" name="enabled" type="bool" />
@@ -1006,6 +1020,11 @@
10061020
</method>
10071021
</methods>
10081022
<signals>
1023+
<signal name="avoidance_debug_changed">
1024+
<description>
1025+
Emitted when avoidance debug settings are changed. Only available in debug builds.
1026+
</description>
1027+
</signal>
10091028
<signal name="map_changed">
10101029
<param index="0" name="map" type="RID" />
10111030
<description>
@@ -1018,4 +1037,36 @@
10181037
</description>
10191038
</signal>
10201039
</signals>
1040+
<constants>
1041+
<constant name="INFO_ACTIVE_MAPS" value="0" enum="ProcessInfo">
1042+
Constant to get the number of active navigation maps.
1043+
</constant>
1044+
<constant name="INFO_REGION_COUNT" value="1" enum="ProcessInfo">
1045+
Constant to get the number of active navigation regions.
1046+
</constant>
1047+
<constant name="INFO_AGENT_COUNT" value="2" enum="ProcessInfo">
1048+
Constant to get the number of active navigation agents processing avoidance.
1049+
</constant>
1050+
<constant name="INFO_LINK_COUNT" value="3" enum="ProcessInfo">
1051+
Constant to get the number of active navigation links.
1052+
</constant>
1053+
<constant name="INFO_POLYGON_COUNT" value="4" enum="ProcessInfo">
1054+
Constant to get the number of navigation mesh polygons.
1055+
</constant>
1056+
<constant name="INFO_EDGE_COUNT" value="5" enum="ProcessInfo">
1057+
Constant to get the number of navigation mesh polygon edges.
1058+
</constant>
1059+
<constant name="INFO_EDGE_MERGE_COUNT" value="6" enum="ProcessInfo">
1060+
Constant to get the number of navigation mesh polygon edges that were merged due to edge key overlap.
1061+
</constant>
1062+
<constant name="INFO_EDGE_CONNECTION_COUNT" value="7" enum="ProcessInfo">
1063+
Constant to get the number of navigation mesh polygon edges that are considered connected by edge proximity.
1064+
</constant>
1065+
<constant name="INFO_EDGE_FREE_COUNT" value="8" enum="ProcessInfo">
1066+
Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links.
1067+
</constant>
1068+
<constant name="INFO_OBSTACLE_COUNT" value="9" enum="ProcessInfo">
1069+
Constant to get the number of active navigation obstacles.
1070+
</constant>
1071+
</constants>
10211072
</class>

doc/classes/Performance.xml

+71-11
Original file line numberDiff line numberDiff line change
@@ -195,34 +195,34 @@
195195
Output latency of the [AudioServer]. Equivalent to calling [method AudioServer.get_output_latency], it is not recommended to call this every frame.
196196
</constant>
197197
<constant name="NAVIGATION_ACTIVE_MAPS" value="24" enum="Monitor">
198-
Number of active navigation maps in the [NavigationServer3D]. This also includes the two empty default navigation maps created by World2D and World3D.
198+
Number of active navigation maps in [NavigationServer2D] and [NavigationServer3D]. This also includes the two empty default navigation maps created by World2D and World3D.
199199
</constant>
200200
<constant name="NAVIGATION_REGION_COUNT" value="25" enum="Monitor">
201-
Number of active navigation regions in the [NavigationServer3D].
201+
Number of active navigation regions in [NavigationServer2D] and [NavigationServer3D].
202202
</constant>
203203
<constant name="NAVIGATION_AGENT_COUNT" value="26" enum="Monitor">
204-
Number of active navigation agents processing avoidance in the [NavigationServer3D].
204+
Number of active navigation agents processing avoidance in [NavigationServer2D] and [NavigationServer3D].
205205
</constant>
206206
<constant name="NAVIGATION_LINK_COUNT" value="27" enum="Monitor">
207-
Number of active navigation links in the [NavigationServer3D].
207+
Number of active navigation links in [NavigationServer2D] and [NavigationServer3D].
208208
</constant>
209209
<constant name="NAVIGATION_POLYGON_COUNT" value="28" enum="Monitor">
210-
Number of navigation mesh polygons in the [NavigationServer3D].
210+
Number of navigation mesh polygons in [NavigationServer2D] and [NavigationServer3D].
211211
</constant>
212212
<constant name="NAVIGATION_EDGE_COUNT" value="29" enum="Monitor">
213-
Number of navigation mesh polygon edges in the [NavigationServer3D].
213+
Number of navigation mesh polygon edges in [NavigationServer2D] and [NavigationServer3D].
214214
</constant>
215215
<constant name="NAVIGATION_EDGE_MERGE_COUNT" value="30" enum="Monitor">
216-
Number of navigation mesh polygon edges that were merged due to edge key overlap in the [NavigationServer3D].
216+
Number of navigation mesh polygon edges that were merged due to edge key overlap in [NavigationServer2D] and [NavigationServer3D].
217217
</constant>
218218
<constant name="NAVIGATION_EDGE_CONNECTION_COUNT" value="31" enum="Monitor">
219-
Number of polygon edges that are considered connected by edge proximity [NavigationServer3D].
219+
Number of polygon edges that are considered connected by edge proximity [NavigationServer2D] and [NavigationServer3D].
220220
</constant>
221221
<constant name="NAVIGATION_EDGE_FREE_COUNT" value="32" enum="Monitor">
222-
Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. The edges still may be connected by edge proximity or with links.
222+
Number of navigation mesh polygon edges that could not be merged in [NavigationServer2D] and [NavigationServer3D]. The edges still may be connected by edge proximity or with links.
223223
</constant>
224224
<constant name="NAVIGATION_OBSTACLE_COUNT" value="33" enum="Monitor">
225-
Number of active navigation obstacles in the [NavigationServer3D].
225+
Number of active navigation obstacles in the [NavigationServer2D] and [NavigationServer3D].
226226
</constant>
227227
<constant name="PIPELINE_COMPILATIONS_CANVAS" value="34" enum="Monitor">
228228
Number of pipeline compilations that were triggered by the 2D canvas renderer.
@@ -239,7 +239,67 @@
239239
<constant name="PIPELINE_COMPILATIONS_SPECIALIZATION" value="38" enum="Monitor">
240240
Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.
241241
</constant>
242-
<constant name="MONITOR_MAX" value="39" enum="Monitor">
242+
<constant name="NAVIGATION_2D_ACTIVE_MAPS" value="39" enum="Monitor">
243+
Number of active navigation maps in the [NavigationServer2D]. This also includes the two empty default navigation maps created by World2D.
244+
</constant>
245+
<constant name="NAVIGATION_2D_REGION_COUNT" value="40" enum="Monitor">
246+
Number of active navigation regions in the [NavigationServer2D].
247+
</constant>
248+
<constant name="NAVIGATION_2D_AGENT_COUNT" value="41" enum="Monitor">
249+
Number of active navigation agents processing avoidance in the [NavigationServer2D].
250+
</constant>
251+
<constant name="NAVIGATION_2D_LINK_COUNT" value="42" enum="Monitor">
252+
Number of active navigation links in the [NavigationServer2D].
253+
</constant>
254+
<constant name="NAVIGATION_2D_POLYGON_COUNT" value="43" enum="Monitor">
255+
Number of navigation mesh polygons in the [NavigationServer2D].
256+
</constant>
257+
<constant name="NAVIGATION_2D_EDGE_COUNT" value="44" enum="Monitor">
258+
Number of navigation mesh polygon edges in the [NavigationServer2D].
259+
</constant>
260+
<constant name="NAVIGATION_2D_EDGE_MERGE_COUNT" value="45" enum="Monitor">
261+
Number of navigation mesh polygon edges that were merged due to edge key overlap in the [NavigationServer2D].
262+
</constant>
263+
<constant name="NAVIGATION_2D_EDGE_CONNECTION_COUNT" value="46" enum="Monitor">
264+
Number of polygon edges that are considered connected by edge proximity [NavigationServer2D].
265+
</constant>
266+
<constant name="NAVIGATION_2D_EDGE_FREE_COUNT" value="47" enum="Monitor">
267+
Number of navigation mesh polygon edges that could not be merged in the [NavigationServer2D]. The edges still may be connected by edge proximity or with links.
268+
</constant>
269+
<constant name="NAVIGATION_2D_OBSTACLE_COUNT" value="48" enum="Monitor">
270+
Number of active navigation obstacles in the [NavigationServer2D].
271+
</constant>
272+
<constant name="NAVIGATION_3D_ACTIVE_MAPS" value="49" enum="Monitor">
273+
Number of active navigation maps in the [NavigationServer3D]. This also includes the two empty default navigation maps created by World3D.
274+
</constant>
275+
<constant name="NAVIGATION_3D_REGION_COUNT" value="50" enum="Monitor">
276+
Number of active navigation regions in the [NavigationServer3D].
277+
</constant>
278+
<constant name="NAVIGATION_3D_AGENT_COUNT" value="51" enum="Monitor">
279+
Number of active navigation agents processing avoidance in the [NavigationServer3D].
280+
</constant>
281+
<constant name="NAVIGATION_3D_LINK_COUNT" value="52" enum="Monitor">
282+
Number of active navigation links in the [NavigationServer3D].
283+
</constant>
284+
<constant name="NAVIGATION_3D_POLYGON_COUNT" value="53" enum="Monitor">
285+
Number of navigation mesh polygons in the [NavigationServer3D].
286+
</constant>
287+
<constant name="NAVIGATION_3D_EDGE_COUNT" value="54" enum="Monitor">
288+
Number of navigation mesh polygon edges in the [NavigationServer3D].
289+
</constant>
290+
<constant name="NAVIGATION_3D_EDGE_MERGE_COUNT" value="55" enum="Monitor">
291+
Number of navigation mesh polygon edges that were merged due to edge key overlap in the [NavigationServer3D].
292+
</constant>
293+
<constant name="NAVIGATION_3D_EDGE_CONNECTION_COUNT" value="56" enum="Monitor">
294+
Number of polygon edges that are considered connected by edge proximity [NavigationServer3D].
295+
</constant>
296+
<constant name="NAVIGATION_3D_EDGE_FREE_COUNT" value="57" enum="Monitor">
297+
Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. The edges still may be connected by edge proximity or with links.
298+
</constant>
299+
<constant name="NAVIGATION_3D_OBSTACLE_COUNT" value="58" enum="Monitor">
300+
Number of active navigation obstacles in the [NavigationServer3D].
301+
</constant>
302+
<constant name="MONITOR_MAX" value="59" enum="Monitor">
243303
Represents the size of the [enum Monitor] enum.
244304
</constant>
245305
</constants>

0 commit comments

Comments
 (0)