Disable NavigationMesh edge_max_length
property by default
#79786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disables NavigationMesh
edge_max_length
property by default.This
edge_max_length
is an optional ReCast 3D baking property that was set to12.0
in ancient Godot times for arbitrary reasons.The value is so nonsensical low that basically every baking of a larger and flat surface would turn out as an inefficient and ugly navigation mesh that would also be bug-ridden in pathfinding due to the forced high density of long edges only in some areas.
Users could not connect this always unwanted result to this specific bake property so it should be disabled by default.
If
edge_max_length
is set to0.0
that optional feature is disabled in the ReCast baking process.It can still be enabled by user choice in the inspector or script manually.
The idea of this
edge_max_length
property is that for pathfinding algorithms that travel through polygon centers or midpoints of edges it is better to keep the polygons and edges at a reasonable size to have a more accurate pathfinding result. It just does not work with large, flat and open areas.Godot pathfinding does not use such a cheap and bug-prone algorithm. The Godot pathfinding always travels through the calculated closest edge positions so the actual length of the edge or its midpoint does not really matter in this case.