-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[3.x] Make autotiles fall back to the most similar bitmask #71533
Conversation
9377ab0
to
cc79332
Compare
Updated to latest I'm still not sure whether it's OK to leave helper functions like |
cc79332
to
a4973f1
Compare
They are normally part of a class. |
Thanks. Rebased and made the helper functions static class functions. |
Do you maybe have some example TileSet (texture + resource) to make testing this easier? |
Test project: |
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.
I tested the feature and it does visibly improve autotiling. I'm not familiar with the implemented algorithm, but the code is clean and works™, so the implementation is alright I guess.
As for the concerns about compatibility breakage mentioned in the proposal, this only affects newly drawn tiles in the editor, no? Then I don't think a different default behavior is a problem.
(although maybe it does affect procedurally generated TileMaps; not sure if it's fine 🤔)
Thanks! |
Implements godotengine/godot-proposals#3851 for 3.x. If the desired bitmask doesn't have any hits in the tilemap, it searches the tilemap for tiles with the most similar bitmask and uses that instead.
Not needed for 4.x because the terrains system already behaves similarly.
Test project in this comment: #71533 (comment)
I need feedback:What is the standard way to define helper functions in the Godot codebase, like my_score_bitmask_difference
and_count_bitmask_bits
? Should they belong to a class or are they okay standing in open scope in a cpp file?Should this be behind a toggle? It's a compatibility break to anyone generating maps from code with broken/incomplete autotiles.If I put it behind a toggle, should it be on TileMap or somewhere else?What pieces of documentation do I need to update?