Automapping rules never apply

Hello,

I am attempting to update an old automapping rule from pre-1.4. I could not get anything to happen upon hitting AutoMap both before and after following the migration guide (the rule did work previously), so I decided to start from scratch:

All in the same folder, I have:
FoliageRules.tmx (the rules file)
Test.tmx (the file I’m trying to automap in)
rules.txt

rules.txt contains only the text FoliageRules.tmx, as everything is in the same directory.

FoliageRules.tmx has only the layers “input_AlwaysFront” and “output_AlwaysFront”.
Test.tmx has multiple layers, one of which is “AlwaysFront”.

As a simple test, I put an arbitrary red tile on input_AlwaysFront and an arbitrary green tile in the same place on output_AlwaysFront. I saved everything, popped the red tile on AlwaysFront in test.tmx, and… nothing. No errors, just a silent failure and a persistently red tile. Toggling Automap While Drawing/hitting CTRL+M does nothing. I’ve redone this from scratch three times, scrapped it and made the exact example from the docs to the letter, and then redone it again. No attempt has ever done anything.

The docs say to either add the rules via Project > Project Properties or have rules.txt in the same directory as the map. rules.txt is in the same directory as the map.

I have tried:

  • Making my input a different layer than output
  • Deleting every layer on test.tmx except for AlwaysFront
  • Toggling every single automapping map property on and off
  • Moving FoliageRules.tmx to a subfolder (and updating rules.txt with its new directory)
  • Giving the rules.txt the full directory (eg C:.…) of FoliageRules.tmx
  • Renaming my input/output layers to input1_AlwaysFront/output1_AlwaysFront
  • Deleting everything and starting completely from scratch
  • Fully uninstalling and reinstalling Tiled

Can the rules file not actually just be in the same folder as the map? Is having a map be a part of a Project mandatory for automapping now? I am completely and utterly stuck, and with the failure completely silent there is nothing for me to go on to troubleshoot. I’m running Tiled 1.11.2 on Windows 10 (64bit), and I have reinstalled it fresh in the last hour.

It’s fine for the rules to be in the same folder as the map.

No, it should work fine without a project as well.

Based on the information given, I’m not sure what the problem could be. The only thing you said nothing about seems to be the tileset you’re using.

Are you using an external or an embedded tileset? If embedded, it’s more difficult for Automapping to determine whether the tilesets in different maps should be considered the same. If the tileset is embedded in one map but external in another, they’re never seen as the same tileset. In general, it’s recommended to always use an external tileset, since it’s easier to make sure multiple maps use the same one.

Since you’re setting up a test folder anyway, consider also sharing this folder (maybe you can attach an archive to your post) so others can check what’s going on.

1 Like

You were right that it was an issue with the embedded tilesets, although I’m unable to recreate the issue now.

Test.tmx and FoliageRules.tmx both had spring_outdoorsTileSheet.png embedded (in the same folder as the maps), with the tileset named outdoors on both of them. Renaming it to spring_outdoorsTileSheet on both made the rules start working.

I attempted to rename one back to outdoors to recreate the issue, but the rule kept working no matter what the tileset name was on either map (I didn’t reselect the image when I did this, just changed the name). I re-did the setup from last night, and now it works right off the bat.

I’m incredibly confused, and I’ll come back with a detailed setup & affected files if I can ever get this to happen again. In the meantime for anyone with the same issue: try renaming the tileset in both files to the same thing, even if the names already matched.

Thank you for pointing me in the right direction!

1 Like

Hai, just a little note that tileset path names in .tmx files are case sensitive - I’ve had my share of frustration on that one with automapping