[Navigation] Create a dedicated 2D navigation server#101504
Conversation
There was a problem hiding this comment.
We need to consider if we really want to stick with the same naming and enums. There have been multiple PRs that added new properties and debug info that at least I did withdraw because the timing for compatibility breaking was a problem. Before we now repeat all that old again for 2D and cement it further we might want to reconsider that.
There was a problem hiding this comment.
Agreed, open for any suggestions, would suggest keeping the old data in Performance as is
There was a problem hiding this comment.
As mentioned in the server enum we might want to reconsider the debug monitors if we are changing things now.
|
Note (to self), the NavigationServer documentation needs more or less a full rewrite with this and other recent changes. |
|
Will go over the navigation docs and the optimizing for size docs when this is done |
543a245 to
3de09f7
Compare
|
Updated the agent and obstacle related code, will look at the signal code and other details as well |
2bdade5 to
736f6a0
Compare
736f6a0 to
0d0b7a3
Compare
0d0b7a3 to
d35a55f
Compare
d35a55f to
0d48e46
Compare
|
Will try to rebase this in the next few days |
0d48e46 to
aba6a0f
Compare
|
Successfuly rebased, going to go through some of the code to ensure it was transferred correctly but should be good to go now 🎉 |
aba6a0f to
e273e49
Compare
37320ef to
c25ef7b
Compare
af64fb7 to
408e31f
Compare
smix8
left a comment
There was a problem hiding this comment.
We discussed this before and I am in favor of doing this split, I just have no time to spend on reviewing and testing such a big PR in all detail atm. I did a quick test and so far nothing noticeable did break. Imo it should be merged now because we will not get a less painful window to merge such a big change anytime soon again. This PR affects way too many development branches and will be a constant rebase pita and bug source if delayed. There are a few things that I might want to change but it is not important to do now, it can be done before 4.5 release.
* Add a dedicated 2D server * Create dedicated tests * Split performance metrics between 2D and 3D * Rename the 3D only server module
408e31f to
5cc0539
Compare
Repiteo
left a comment
There was a problem hiding this comment.
This separation makes complete sense to me. Any reservations I have with the current implementation would amount to bikeshedding, and this shouldn't be held up any longer than it already has. Great work!
|
Thanks! |
|
Thank you! Great to have this done and dusted! Will follow up with potential performance improvements and keep things under supervision |
|
Will update the building documentation to match this the coming week |
| PNAME("navigation_2d/edges_connected"), | ||
| PNAME("navigation_2d/edges_free"), | ||
| PNAME("navigation_2d/obstacles"), | ||
| PNAME("navigation_2d/active_maps"), |
There was a problem hiding this comment.
Typo, duplicate navigation_2d/active_maps and missing navigation_3d/active_maps
There was a problem hiding this comment.
Thank you for spotting, will fix today
|
I rebased PR #89409 on top of this PR, but instead of just moving the navigation servers into the navigation folder, I split the navigation folder into navigation_2d and navigation_3d. Now that the 2D and 3D navigation servers are independent, we can separate them into folders and allow compiling without them. |
Was testing it and I have found that |
|
It is used strictly for debugging, which can be enabled in non-3D exports, please open a bug report for the issues this might cause
|
I have allowed the editor to be built with 3D disabled, and the build failed because Also I have spotted this in #ifndef PHYSICS_2D_DISABLED
CollisionShape3D *collision_shape = Object::cast_to<CollisionShape3D>(node_3d);
if (collision_shape) {
Ref<Shape3D> shape = collision_shape->get_shape();
if (shape.is_valid()) {
bounds = shape->get_debug_mesh()->get_aabb();
}
}
#endif // PHYSICS_2D_DISABLEDI really appreciate The work you are doing since i have been waiting so long for this, thanks. |
|
That doesn't sound like it comes from this PR but from: But enabling building the editor without 3D should include fixing such things, so it's not really related to this PR if it fails with custom code, but if things fail while building the engine itself (not a modified version) please open an issue for it, but custom changes causing issues isn't really something that's related to my work |
| ERR_FAIL_NULL(parser); | ||
|
|
||
| generator_parsers.erase(parser); | ||
| #ifndef CLIPPER2_ENABLED |
There was a problem hiding this comment.
There seems to be a typo here. It seems like it should be #ifdef instead of #ifndef.
There was a problem hiding this comment.
If it is it's a typo in the original code, bur worth investing
This is ready for extensive review but still a work in progress, keeping commits separate to handle transitioning changes and deciding on some more steps in this, but it should be feature complete
What it especially needs is:
up, and removing some cases that are distinctly 3D) but I suspect there might be some areas that still can be simplified now that it is 2D, but would need some further insight and testingHeapshould instead be put inservers/navigationTODOs there, and if any specific tests needs to be added or modifiedSome additions I didn't make but that could be added, either in this or a follow-up:
Triangle2class to be fully featured and move to coreOtherwise this is ready for testing, I will start using this in my own projects when I get around to working on them as well
For context, currently the 2D navigation system just runs as a frontend for the 3D navigation server, this is not only inefficient and involves a lot of magic to convert it also means that all navigation is unavailable when building without 3D support
Todo: