Skip to content

Conversation

@smix8
Copy link
Contributor

@smix8 smix8 commented Jan 3, 2024

Improves navigation mesh code examples.

Users had trouble adapting the example code snippets to their projects, struggling with how to make things reusable or with other specifics.

The improved examples are now longer but show nearly the entire flow from start to finish how to create and update navigation meshes in scripts and mention some common problems with e.g. TileMap shenanigans or SceneTree processing.

Improves navigation mesh code examples.
@smix8 smix8 force-pushed the navmesh_examples branch from 216775f to df8b911 Compare January 5, 2024 10:10
Copy link
Contributor

@skyace65 skyace65 left a comment

Choose a reason for hiding this comment

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

Everything looks good to me!

@skyace65 skyace65 added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.2 labels Jan 6, 2024
@mhilbrunner
Copy link
Member

The TileMap thing seems like a code smell on our side, but I guess its better to document it for now instead of omitting it. Looks good to me too! If nothing else comes up, I'll merge this tomorrow. :) Good work, and thanks for keeping the navigation docs up to date with real-life solutions.

@smix8
Copy link
Contributor Author

smix8 commented Jan 8, 2024

The TileMap thing seems like a code smell on our side,

What parts are you referring to?

Tilemap issues are common and TileMap does not really inform its users in that regard. The "Where is this all documented?" question is raised a lot by users when I explain TileMap specific quirks to them. I was think of adding even a section just for the TileMap because it has so many specific problems that users commonly fall into.

Comment on lines +321 to +324
# Some mega-nodes like GridMap are often not ready on the first frame.
# Also the parsing needs to happen on the main-thread.
# So do a deferred call to avoid common parsing issues.
parse_source_geometry.call_deferred()
Copy link
Member

Choose a reason for hiding this comment

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

This, specifically. Again, better to document this than not, but maybe something we should file somewhere to see if we can improve UX here.

@mhilbrunner mhilbrunner merged commit e7058b5 into godotengine:master Jan 8, 2024
@mhilbrunner
Copy link
Member

Thanks!

@smix8 smix8 deleted the navmesh_examples branch January 8, 2024 06:58
mhilbrunner added a commit that referenced this pull request Jan 25, 2024
Improve navigation mesh code examples
@mhilbrunner
Copy link
Member

Cherry-picked to 4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants