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

[3.5] Update NavigationServer backport #61996

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jun 13, 2022

Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.

Fixes #59182
Fixes #28235

To my suprise I encountered fixes and additions made to the 3.5 branch only that were never added to master (like sometimes even announced but never done). I tried my best to add/keep them and will add those that still make sense to 4.0 in a dedicated pr later.

In particular this backports adds features and fixes from:

#47133 Make 2D navigation consider scale
#47024 Allow Navigation to be more flexible. This pr helps a ton with pathfinding and edge merging issues in 3.5 but also makes some 3.5 fixes invalid or at least they require a second look and if they still have purpose maybe reimplementation.
#46786 Implements the Navigation layers but does not remove the Navigation/Navigation2D nodes
#61800 Fix GridMap Navigation transform changes and debug
#61739 Add NavigationRegion costs for 2D and 3D pathfinding
#61589 Fix NavigationAgent reparent issues

Compatibility

NavigationPolygonInstance, NavigationMeshInstance and all NavigationAgents
(not obstacles as they require more fixes in 4.0 as well and will get their own pr)

Compatibility for the old Navigation/Navigation2D nodes is available. e.g. if such nodes are present child navigation related nodes connect to the navigation map of navigation node (which is the old behavior) else they connect to the default navigation map of the world/world2d. This also means that all navigation related nodes can now be used without a Navigation/Navigation2D node parent as they will use the default map.

TileMap and GridMap

The TileMap and GridMap have a new bake_navigation property that must be set to use build-in navigation with the default navigation map. Previously this was toggled automatically when a Navigation/Navigation2D node was available but this is no longer always the case with the addition of the default navigation map of the world resource so a user toggle was required (and the 4.0 GridMap had this toggle anyway). For compatibility this toggle is automatically enabled when a Navigation/Navigation2D node is found.

NavigationLayers
This will largely affect 4.0 and is not an issue for 3.5 as the navigation layer feature was not available before. The multiple navigation layer function versions were streamlined to "set_navigation_layers" and "get_navigation_layers" (similar to collision physics) across the board as epecially "set_layers" will become a confusing hazard function when other layer types are added.

Test Project

Here is a quick test project for 3.5 for 2D and 3D to test some of the features e.g. GridMap and merging.
GodotNavigationDebugTest3.x.zip

@smix8 smix8 requested review from a team as code owners June 13, 2022 14:34
@akien-mga akien-mga added this to the 3.5 milestone Jun 13, 2022
@smix8 smix8 force-pushed the navigation_bp_update_3.x branch from d67e2c6 to 83ac9ca Compare June 13, 2022 14:44
@akien-mga
Copy link
Member

CC @AndreaCatania @Scony - the aim is to merge this ASAP to include in 3.5 RC 4 so we can have navigation mostly on par with 4.0 in 3.5.

@smix8 smix8 force-pushed the navigation_bp_update_3.x branch 2 times, most recently from 80781d5 to 8ae6534 Compare June 13, 2022 15:13
@Scony
Copy link
Contributor

Scony commented Jun 13, 2022

@smix8 let me know once this is ready for testing

@smix8 smix8 force-pushed the navigation_bp_update_3.x branch 6 times, most recently from 6571b64 to 197c02d Compare June 14, 2022 03:41
Backports features and bugfixes from current Godot 4.0 to 3.5 and brings functions and codebase of both version largely in sync to make tutorials more compatible and future backports easier.
@smix8 smix8 force-pushed the navigation_bp_update_3.x branch from 197c02d to 8bd7c61 Compare June 14, 2022 03:55
@smix8
Copy link
Contributor Author

smix8 commented Jun 14, 2022

@Scony I guess this is good for testing now. You might want to look especially at the parts that you added to 3.5 that I changed or removed as sometimes I couldn't figure out what to do with it cause the code was so different with 4.0. Maybe some of it could and should be reimplemented.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Let's give this a spin in the next RC and hopefully everything sails smoothly :)

@akien-mga akien-mga merged commit 4e7363c into godotengine:3.x Jun 15, 2022
@akien-mga
Copy link
Member

Thanks!

@nklbdev
Copy link
Contributor

nklbdev commented Jun 16, 2022

It is amazing!

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.

4 participants