Automapping Help - MisterMeme

So this Automapping sequence only works partially. I’ve been trying to have the Automap produce automatic pairings for a mountain range. The weird thing is tha while my rules work, it doesn’t automatically apply on the map until I manually select ‘Automap’ – this is even while I have ‘AutoMap while Drawing’ active. I’ll post some images below.

Initial placement

When I place the corner of the mountain, it’s supposed to spawn the other corner. Then I have separate rules on top of this to automatically add the topping. However, in the end, the corner on the right hand side doesn’t produce a top.

That is, until I click ‘Automap.’

I’ll also post my rules below. It’s in three layers, so there will be three separate images.

Region Layer

Input Layer

Output Layer

Complete Layer

We figured out the issues on the Tiled Discord server, but in case anyone runs into similar problems:

There were two issues here.

One was the order of the rules. In Tiled, rules are applied in the order they appear in the rulefile, left to right, top to bottom, and each rule is only checked once per tile. This means that the rules to add tile tops were being checked before the matching tile bottom was placed, which was causing the matching tile top for the automatically placed tile bottom to not be placed.

The other was the AutomappingRange, which was causing disrepancies between the rules when applied manually via Map > Automap, and when applied during live Automapping. By default, this is 1, which was causing the empty space diagonal from the placed tile bottom to not be checked against any of the rules, even though we wanted a tile top there. By adding the AutomappingRange custom property to the rule map and setting it to 2, a high enough range to look at that diagonal tile, the problem was fixed.

Implementing these two fixes also allowed that big 2x2 rule to be removed, as it was redundant.