Is there a way to apply automapping to each group of layers?

Hi,

I’m working on a isometric game where I wanted to use groups of layers as insides of building, caves etc.
I made a big set of rules to help me model the map, however it only works on top layers of the map.

Is there a way to make automapping work within a group?

Automapping completely ignores groups, so as long as the layer names match unambiguously, Automapping will work on layers within groups as well.

If you have ambiguous layer names (e.g. a top-level “Floor” layer and a “Floor” inside a group), then you’ll need to rename the layers to all have unique names.

Edit: The above is true in recent versions of Tiled. If you’re using a version older than 1.8.0, you’ll need to upgrade, as older versions indeed did not detect layers in groups at all.

1 Like

Unfortunately making layers unique does not solve my problem.

For the purpose of my project I need for the automapping rules to treat each group like separate map, still giving me an opportunity to match them on a single canvas.

I looked for a way to compensate for that. Even tried to add this to the code myself, but I takes way more time than I anticipated.

I might be missing something. Is it possible to achieve something like that with current functionality?

Making the layer names unique is the only way to make automapping work consistently, sorry. If there are multiple layers with the same name, it will pick one of those layers, and any “fix” for this would be quite complex. There are a couple of open feature requests on GitHub about making it easier to Automap in such scenarios, but we’re not likely to see them implemented any time soon.

Consider using Worlds as an alternative to putting multiple maps’ worth of data into a single map. With Worlds, each area would be a separate map, but you would be able to view them all on the same screen and navigate between them easily. When using Worlds to navigate across maps, Tiled also tries to make sure the same layers are selected across the maps, which makes edits across maps more convenient.

Another possibility, if you’re applying Automapping manually and not While Drawing, is to write a Tiled script that temporarily renames each groups’ layers to something invalid one by one, and applies Automapping multiple times, ensuring that each group gets Automapped, before finally setting the layer names to their original form.