-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[Navigation] Restore 2D only navigation #88681
base: master
Are you sure you want to change the base?
Conversation
As mentioned there is no real 2D navigation server. The 2D server forwards and backwards all queries to the 3D server so you can not have a build with a disabled 3D server. If you try and it works it does because guards were added against crashes from missing e.g. 3D thirdparty libs but it will not be a true 3D disabled build because the 3D server needs to be included. |
True, but I'd say that's worth it to have a non "true" build, unless we want to accept the regression |
dc156bd
to
dc8046c
Compare
Following some discussion I'm going to look more into the specifics of this and test |
dc8046c
to
524900e
Compare
524900e
to
2f87612
Compare
Temporarily including these fixes to build template builds, the first commit isn't part of this commit: |
This is now ready for review, need testing to help with anything I've missed but it works correctly and tests fine, so should work perfectly assuming I haven't missed anything, removed some 3D only parts to reduce the size on 2D only builds Windows, debug build:
Windows, release build:
So this doesn't really come with any significant cost compared to default When comparing a 3D enabled build the difference in saving is about 13.7%/14.5% with this, and 14.2%/15.2% with the normal build, so the savings are still very significant (the savings drop by about 3.9%/4.3%), for release and debug respectively |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these updates. Just a few questions.
I really would prefer to split the navobjects into 2d and 3d versions instead of having many new ifdef landmines in the code. That would require to give the NavigationServer2D some actual backbone. |
I can look at working on that, either in this or as a follow-up |
ad71dea
to
7ba06b1
Compare
b3d1ea1
to
c1ffb24
Compare
77865b6
to
59d5026
Compare
59d5026
to
c7a46ce
Compare
c7a46ce
to
4d6267b
Compare
4d6267b
to
7eed541
Compare
What is the state of this PR. Is the goal to just allow to compile the more optional 3D parts out to save a few bytes or is the intention to "restore" an actual 2D navigation. |
It restores 2D navigation, but doesn't separate out any 2D only code separate from the 3D elements, haven't gotten around to testing any such solution yet (though it reduces some of the unused code being compiled) But it works as advertised, 2D navigation will work in 3D-disabled builds (I've tested it in my own projects) |
7eed541
to
c4d2580
Compare
I tend to share that concern, it seems like this will make working on these files somewhat painful if one needs to always take into account To me this seems to reduce the maintainability of this file and I'm not sure if the gains are worth it. But if @smix8 is OK with it for now, I suppose we can merge, and have a hope to refactor later so it's easier to maintain. |
I'll follow up with some additional cleaning to this and try to separate the 2D and 3D navigation code entirely if feasible, been trying to dig through and research how it works and hopefully I can find the time to do that properly and solve that part Would aim to first do a basic split to remove the localized |
I already tried to do this 2D/3D NavigationServer split in a none-public branch. The main issue with the 2D version is that many parts in the 3D code that use helper classes or 3D specific functions have no straight forward equivalent in 2D (e.g. Geometry3D, Face3, ...) requiring ugly custom code and workarounds. Also the main pathfinding function is so convoluted at the moment that trying to refactor it as a pure 2D version is a disaster. |
Yeah that was what deterred me, but will look at cleaning up some of the code that is cluttered with disabled paths and see how that might be improved, and what might be improved with respect to helper code But would be interesting to see what can be done nonetheless |
Well I approved this PR in case this is actually something in real demand by the 2D or web crowd (which I dont know) and I dont want to block it in that case. I am not that bothered too much with those ifdef to block it although the diff chaos would create a lot of annoyance when rebasing open branches and PRs. So if this is just something nice to have it might be better to hold for an actual NavigationServer2D backend instead of this intermediate solution. |
I've done some testing and splitting the server isn't too difficult, will do some more testing and open a PR, or alternatively update this PR with that It will take some additional testing and ensuring it all works correctly as opposed to this which doesn't change any critical code But will do some more work on it and it should be pretty straightforward, no 3D specific code needed based on my testing due to some specific conditions |
c4d2580
to
4852cf3
Compare
Starting in 4.2 navigation was restricted to 3D enabled builds only, in my testing this isn't an actual limitation, and my testing shows navigation works
(haven't tested baking in 2D, but pathfinding works fine, and unit tests work correctly)Edit: Tested and runtime baking works fine too