tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Automapping: Allow ignoring flip flags

Open eishiya opened this issue 11 months ago • 0 comments

Problem

In some Automapping applications, one may need to react to the presence of tiles and their various orientations. For example, a rule looking for RPG grass may need to look for any of 4 grass tiles, plus their horizontal flips, and maybe even also their vertical flips. A rule looking at floors made up of ceramic tiles might need to accept all possible orientations - that's 8 versions of each tile! Currently, rules need input layers for each of these orientations, which is rather tedious (even with scripts to help!), and makes the rules rather unwieldy. Here's an example rule that needs to look at 12 different tiles which are allowed to be rotated vertically and horizontally, requiring 48 layers in total: image I have another pair of rule maps with 80 input layers looking for 20 tiles and allowing for horizontal and vertical flipping, I loathe looking at them, as they predate Automapping supporting groups and are thus chaos :]

Proposal

Properties on input layers that tell Tiled to ignore the flip flags of tiles on that layer would greatly reduce the number of layers (and work!) needed to enumerate tiles for rules like this. Ideally, it should be possible to specify allowing horizontal flips, vertical flips, and rotations separately, e.g. with three boolean properties: ignoreHorizontalFlip, ignoreVerticalFlip, ignoreRotation.

If only some tiles need to ignore some flags, they would need to be placed on separate input layers from those that don't need to ignore flags or ignore different flags. I think even in these cases, the total number of layers will likely be reduced compared to enumerating the allowed orientations manually.

When implementing ignoring rotation, don't forget to include the hex 120 rotation flag, so that this feature can work fully when Automapping is finally fixed for staggered maps xP

eishiya avatar Aug 07 '23 13:08 eishiya