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

Support baking gridmap navmesh. #31454

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

lliberadzki
Copy link

@lliberadzki lliberadzki commented Aug 18, 2019

Normally it's necessary to add navigation meshes under every tile nodes. One example is described in #17118. Its hard to do this inside the editor for more complex 3d shapes as there is not 3d navmesh editor included.
With this commit it would be possible to omit generating navmeshes for each tile and generate navmesh for gridmap as a whole. This would also make it possible to place obstacles or props with gridmap itself. Look at the following gif for example:
baking-gridmap

I don't know if this will be useful but i added it for personal project and thought i would share. Along with #22767 it would allow navigating procedurally generated gridmaps. What do you guys think?

Bugsquad edit: Fixes #18837.

@lliberadzki lliberadzki force-pushed the gridmap-navmesh-baking branch from 04b87ff to 82acd43 Compare August 18, 2019 11:25
@lliberadzki
Copy link
Author

Fixed failing travis check.

@Xenoamor
Copy link
Contributor

Xenoamor commented Aug 18, 2019

Very excited for this. Should also resolve the duplicate #18837

Am going to test this functionality now Looks like it's working for me

test12

@Zylann
Copy link
Contributor

Zylann commented Aug 19, 2019

Just wondering, wouldnt it be cleaner if navigation could query collision meshes from PhysicsServer rather than querying nodes? Or design an API so that we can customize the parsing?
Because otherwise we'll keep needing every node generating collision shapes using servers to intrusively be added to the recast module, while non-official modules AND GDScript plugins doing that are unable to be included. This is a problem I had for a while but it is impossible to solve cleanly at the moment.

@Xenoamor
Copy link
Contributor

There's talk of overhauling how Navigation works such as in #15110, however Reduz is likely busy with the Vulkan backend work. It might be worth making a new issue to discuss what changes/additions should be made to it for 3.2 or maybe 4.0. Currently I am unaware of a single place to discuss this sort of stuff

@lliberadzki
Copy link
Author

Querying PhysicsServer would be probably better, but you would still need to differentiate meshes you want for navigations and one you don't. So somewhat like #15110. Which is somewhat similar (at least in concept) to how Unity deals with it.
But that would probably be bigger overhaul for navigation.

@Zylann
Copy link
Contributor

Zylann commented Aug 19, 2019

@lliberadzki yeah that's why I suggested there could be an API for that as well

@akien-mga
Copy link
Member

Some comments about Navigation from @reduz on IRC:

15:23 <reduz> jfons: for 4.0 I want to move Navigation to a server, so we can add better optimizations as well as better thread support (and not depend on the Navigation node)
15:23 <reduz> jfons: this would  also allow do make the PhysicsServer directly generate and update navmeshes in real-time to the Navigation server, making it hugely more optimal
15:24 <jfons> reduz: that would be great, also adding dynamic obstacles i quite a requested feature
15:24 <reduz> yeah

In the meantime, this PR seems good, it's not a lot of code and implements a useful feature.

@akien-mga akien-mga merged commit 4aed4b4 into godotengine:master Aug 28, 2019
@akien-mga
Copy link
Member

Thanks!

@lliberadzki
Copy link
Author

Thanks a lot

@realkotob
Copy link
Contributor

realkotob commented Aug 29, 2019

How do you set which tiles to navigate and which ones are obstacles? And which floor is the reference?

@lliberadzki
Copy link
Author

This just passes all tiles geometry to recastnavigation baking process. This means that whatever is not reachable by agent (as for example in climbing distance, or not wide enough for agent radius) is an obstacle.

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.

Can't bake navmesh on Gridmap
6 participants