Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable NavigationMesh edge_max_length property by default #79786

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jul 22, 2023

Disables NavigationMesh edge_max_length property by default.

This edge_max_length is an optional ReCast 3D baking property that was set to 12.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 to 0.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.

edgelen

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.

Disables NavigationMesh edge_max_length property by default.
@smix8 smix8 requested a review from a team as a code owner July 22, 2023 12:09
@YuriSizov YuriSizov merged commit ee1be95 into godotengine:master Jul 25, 2023
13 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@smix8 smix8 deleted the navmesh_max_edge_len_4.x branch July 26, 2023 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants