I don’t understand the automapping function!
https://doc.mapeditor.org/en/stable/manual/automapping/
The documentation is to short for me.
English isn’t my favorite language.
My head is smoking because of trying to understand this automapping…
I has a “colored” (final) tileset with 16px x 16px and now i want to use a one colored “prototype” tileset (which i will create) each with 16px x 16px to design a level.
Don’t know which folders, files and layers i need.
You helped me in the past to understand how to use terrains. Now i hope you can help me to understand how to use automapping too.
Thanks!
1 Like
If the English-language documentation didn’t help you, I’m not sure that explaining the same things again in the same language would help. Maybe it’s a better idea if you say which language you prefer, and maybe someone can explain in that language?
Your rules.txt
file goes in the same directory as the maps for your levels, the maps you want to do the automapping on. rules.txt
is a list of the maps that contain your automapping rules.
Your automapping rule maps contain input
and output
layers, and these layers also include the names of the layers that the rules look at. For example, if your prototype tiles will be on a layer called “Prototype”, then your input layers will be named something like input_Prototype
. Then, if you want your final tiles to be placed on a layer called “Tiles”, your output layer would be called output_Tiles
.
German is my prefer language.
Hmm… do you have screenshots of all (files, folders etc.)?.
A Screenshot i think will helping me a little bit more to understand.
I can’t speak German, but maybe someone else can help :]
You can just put everything into one directory if you want. It doesn’t matter how you set it up as long as the paths in rules.txt
are correct.
This is perfectly valid:
myMap.tmx
rules.txt
rules1.tmx
rules2.tmx
In this case, rules.txt
would contain the following:
rules1.tmx
rules2.tmx
It’s common to put the automapping rules in a subfolder so that they don’t clutter up your main folder, e.g.
/automap
rules1.tmx
rules2.tmx
myMap.tmx
rules.txt
In this case, rules.txt
would contain
automap/rules1.tmx
automap/rules2.tmx
You can also put rules.txt
in different folder from where your working map is, but then you’ll need to set the “Automapping rules file” in your Project to point to that rules.txt
.
/automap
rules.txt
rules1.tmx
rules2.tmx
myMap.tmx
In this case, rules.txt
would contain
rules1.tmx
rules2.tmx
since it’s in the same place as these rule maps. Because rules.txt
in this case is not in the same folder as your working map, Tiled will not be able to find it automatically, but you can tell Tiled where it is by setting it in the Project Properties. This will require that you use a Project.
1 Like
An how does all this *.tmx files look like?
Which of this .tmx files has which layer names?
That’s why a screenshot is needed.
Think tomorrow i’ve to try again.
That’s very flexible! The layer names in your working map can be anything, and the layer names in your rule map will depend on your working maps’ layers.
Here’s an extremely basic example. These are my layers in one rule map. And the working map just has a layer called “labels” - automapping creates the layer called “near”.
1 Like
Ok, i did first solution - all files in the main folder.
Now i need to know which layers i need in
-MyMap.tmx
-rules1.tmx
-rules2.tmx
And where to set which (prototype and final) tileset?
I saw following video too but this makes me confused because of not showing top of tiled map editor.
I know he has another structure of his files and folders!
I want it exactly like he is showing!
He use green prototype tileset and a purple rule tileset which will then adds his final tileset to each of this.
Wow, i did it!
But i don’t understand it right now.
I watched the video again and again and again and now the first time i get a result.
Awesome!
Now it’s time to understand how this really works.
Because this was a fluke (i know).
Then - if i know how it works - i need to change the prototype tileset with the final one.
Again, no one can tell you what your layers should be because the layers in your working map can be anything, and the layers in your automapping rules map will depend on the layers in your working map.
In your case, you probably want layers something like this:
myMap.tmx:
Prototype
rules.tmx:
input_Prototype
output_Tiles
input_Prototype means "look for these patterns of tiles on a layer called “Prototype”
output_Tiles means "output these tiles to a layer called “Tiles”
Please make sure you also (re)read the docs, the tutorial you linked is out of date and has some bad advice mixed in with the good ):
1 Like
I think i understand the map’s (.tmx) and layers now , but i don’t understand the rules of a prototype tile and a final tile.
I know i did a misstake there…
But how to fix that?
The documentation is minimalistic for me and doesn’t help me!
It’s like i would say install into a virtual machine a linux distribution and then start a mysql docker container!
No one who isn’t familiar with this knows the exact steps!
You’ve set things up correctly, what’s wrong is your actual rule logic. This isn’t something the documentation can walk you through, since the logic for your rules depends on your exact tiles and needs! The documentation can only explain the theory and provide some specific examples, it can’t foresee the exact rules you need.
What you’re missing is a check for the Empty tile above your cliff - right now, your rules don’t care about what goes right above the area you’re checking, so the rules run both when there’s empty space above (correct) and when there’s not empty space above (incorrect). Add the Automapping Rules Tileset to your map (Map > Add Automapping Rules Tileset
), and use the red dotted lines tile, that one represents empty tiles, put it right above your current rules - this’ll make your rules check for a group of prototype tiles that have an empty tile directly above them.
Also, you do not need the regions
layer. This has not been necessary for a long time, and can actually mess up your rules in some cases. Delete it.
Now that I’ve gotten it to work (with my mistake above)… it is complicated to understand the new use.
Ok, i did delete the regions layer.
I used the automapping rule (Map > Add Automapping Rules Tileset
) and tried to define a rule on the input_prototype layer and output_terrain layer… i knew i don’t underdstand how to use this.
Time flies…
Yes, Automapping is complicated, because it doesn’t enforce a lot of limitations on you. This makes it complicated to explain. Once you figure it out though, it should get easier.
I can’t demonstrate your exact rules with my tiles, but here’s an example input:
This one would match all of these areas of the working map, notice how the “Empty” tile (red dotted outline) matches the empty tiles in the working map.
(I have a different Tiled theme, the dark background in these screenshots is empty space, not dark tiles.)
1 Like
Thanks for trying to helping me.
I really appreciate it.
I tryied it, but this doesn’t helped me too.
I’m to stupid for this.
It dowsn’t work on my layers
Tried it first on input_prototype → black result, then on output_terrain → black result too.
Shame on me.
Don’t feel bad. Automapping is complicated, it’s almost like regular expressions but for tiles and in two dimensions instead of one xP It’s natural that it’ll be more challenging for some people to wrap their head around it.
I think I just realised the problem though: The green in your map, those are tiles, right? Erase them. “Air” tiles like that was another piece of bad advice from that video. You don’t need “air” tiles, because you can match empty tiles directly.
1 Like
Can you please upload your test file?
Thanks… That slays me again, with all the layers.
Aye, those examples were made to explain features of Automapping you don’t really need ):
Here’s one that’s closer to what you’re doing.
automapExample.zip (4.2 KB)
1 Like