ldtk
ldtk copied to clipboard
[Feature Request] Autolayer: Mark tiles as "used", preventing matching in later patterns.
Hello! This request follows a brief discussion on the discord.
I think it would be useful and intuitive if all the cells painted by autolayer rules were optionally marked as having been "used". By "used", I mean that the tile will not match subsequent rule patterns. This is different from the ✋ "Stop on Match" option.
Here's the use-case, from the discord discussion.
I have rules set up to nicely auto-tile with an alternating brick 1x2 pattern. A final rule uses 1x1 tiles fill in the remaining gaps.
Now, I would like to add a smattering of 2x2 bricks, around which the 1x2 tiles will fill in the rest. As before, the remaining gaps get filled by 1x1s. (See hand-authored version.)
If I add a rule to randomly add some 2x2 blocks, it works, but the tiles don't mark their cells as having been used, and subsequent rules will still match them. Here, the rule for blue 2x1 tiles is being matched, even though some of the tiles they're matching have already been covered by the orange 2x2s.
The "Stop on Match" option means that if a rule is tested on a cell and matches, that cell is not checked against rules lower on the list. This new feature would extend this functionality as follows: When a rule matches, all tiles painted by this rule are considered unmatchable for the purposes of pattern matches for rules lower on the list.
Why would this be useful?
This feature would allow rules that nicely cover/tessellate an intfield with various rectangular elements, with no overlap. With the "Stop on Match" feature, only the tested cell is marked as "used", meaning subsequent rules can still match that cell in their patterns. This can result in ugly overlaps.
Questions:
- What would the UI for this option look like? Maybe hold shift while clicking the ✋ icon? Are "Stop on Match" and this new feature actually mutually exclusive?
- What does "unmatchable" really mean? Does it mean the int is considered 0? Does it match "Any Value/No Value" cells ("?" cells)?
Thanks for reading! Please reach out I should clarify further. I know this is a non-trivial feature, but I really think it would be a useful addition to ldTK.
I am running into this same issue and causes 1 single tile to overlap with two tiles on LDtk whereas my game engine only supports 1 tiles at a time per layer. There are workarounds but ideally adding this feature would avoid additional work.
I originally thought this is what Stop on Match would do actually.
Would love to know if anyone else has made some workarounds within LDtk?