-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add Bounds checking to Navigation Regions when creating connections between them. #9381
Comments
I'm not super practiced at C++, but I'd be willing to try and code this myself if people want me to? Someone more experienced should probably check my version over after I finish it, if I do end up coding it, but I'd be willing to do the first draft at least. |
I'd suggest gauging the interest in this before doing any work, unless you're willing to have worked unnecessary |
Yeah that's why I asked here. Is there a better place to go to gauge interest? |
This is the way to gauge interest, what I mean is to give it some time to see what people think, you're free to work if you like but be aware that it might be rejected if it's not a feature that's demanded |
Ah, yeah I figured! XD |
Also, a link to my code that's causing lag: https://gitlab.com/AngularAngel/omnicraft-infinite-war/-/blob/master/Scenes/Game/NavigationGenerator.gd?ref_type=heads You need to compile Godot engine with Voxel-Tools if you want to actually run it. Also, I'm pretty sure it's the code for finding connections between meshes that lags, because if I generate my meshes and then simply discard them instead of adding them to the tree, it runs perfectly. |
I could go and code a proper demo project, without the voxel-tools dependency? It'd be a bit of work, but I'm willing to do so if people express interest and it'll actually be used to test improvements to the engine. :/ |
Also, while we're here, anybody know of any good examples of Godot using bounding boxes for comparison culling or the like? It's got to have come up for rendering or collision detection at some point. |
The AABB class is probably what you'll want to work with. See AABB. |
Sounds good, I'll see if I can find one! |
Okay, scene/3d/visual_instance_3d.h has a bounding box. wasn't able to find the code where it's actually used, and not entire sure we should just staple an AABB onto nav_mesh or nav_region or whatever. I was able to solve my performance, at least temporarily, by disabling 'use_edge_connections', and I think I can make my game work without it. Will leave this proposal open for further discussion, though. |
Here are my thoughts on this, in the context of navmesh management on dynamic chunked terrain:
|
Describe the project you are working on
A first person voxel RTS.
Describe the problem or limitation you are having in your project
The game lags when I try and add a NavigationRegion for every chunk, with the lag scaling based on how many NavigationRegions are already present.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Adding bounds checking when adding a new navigation region, so it only compares vertices with regions it actually touches.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Navigation regions will have bounding boxes, and when trying to form connections between themselves, they will check their bounding boxes first to see if they actually touch each other.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not to my knowledge. This is an optimization for a major part of the engine - the only direct work around would be to roll my own navigation module, or use an altered version of the engine to implement the feature myself.
Is there a reason why this should be core and not an add-on in the asset library?
Again, an optimization for a core part of the engine. Not practical as an add-on.
Tasks
The text was updated successfully, but these errors were encountered: