# Cant get autoMapping to work

**URL:** <https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651>\
**Category:** Questions\
**Created:** [March 19, 2024, 3:57pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651 "2024-03-19T15:57:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 3:57pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/1 "2024-03-19T15:57:43Z")

</div>

I created a simple level to test out automapping , all of it with 1 type of block ( ID 0)  
Went over and created another tilemap called “TempMap Rule” and a rules.txt in the same folder as the test level referring to that “TempMap” Rule folder  
created a input\_prototype layer, output\_prototype layer  
with the input\_prototype containing only ID 0 tiles (same ones from the level map)  
and in the output\_prototype 2 random blocks to check  
i tried with 2 simple ones like in the photo, saved and went to try on the level map  
the \* icon appears on the name of the Level when i press CTRL+M , so i know something is happening, but nothing is showing  
Here with the ID 0 tiles with opacity on the output set to 0 so we could see the ID 0 tiles

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/1/17ca38c9cc71d5b4a30af25d3792f14849ebbdaf.png)  
Here with opacity back on so we could see the tiles it should transform to through outptu  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/0/01d280e025a8a07584c62ba6585a6121a5989269.png)  
and here it is after pressing CTRL+M on the level map  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/9/930080847f999c3ce9cb8989c2682323c52f63ce.png)

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 3:59pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/2 "2024-03-19T15:59:23Z")

</div>

Your rules are looking for a layer called “prototype”, but your working map only has a layer called “Tile Layer 1”.

(Also, your smaller rule will supersede the larger rule. If the brighter blue tile is meant to be output when the prototype tile is isolated, you’ll want to check for Empty around it.)

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 4:21pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/3 "2024-03-19T16:21:49Z")

</div>

The prototype renaming solved it , thanks!  
What do you mean though by “check for empty”?

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 4:22pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/4 "2024-03-19T16:22:50Z")

</div>

I mean check that the tiles around it are empty (have no tile). You can do this with the MatchType “Empty” special tile. The easiest way to access this special tile is to add the Automapping Rules Tileset to your rules map (Map \> Add Automapping Rules Tileset), it has all the special tiles in it.

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 4:37pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/5 "2024-03-19T16:37:13Z")

</div>

Thats amzaing, one more question  
After i automap it updates in Unity( Since the save files area based in the asset folder in unity ) With the default input tile it works fine, but when i automap and save it dissapears

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/f/f38a04b204b728094cc29b7200c43dceed72927f.png)  
even though its based in the same structure as the other tile  
(Seperated into folders)

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 4:41pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/6 "2024-03-19T16:41:05Z")

</div>

From the error in your screenshot, it sounds like Unity can’t find the tileset that contains the output tiles. Make sure that Tileset file is where Unity is looking for it.

Edit: Or is it the prototype tileset it can’t find? In that case, that’s extra weird xP But the solution is probably the same: Make sure the tilesets and .meta files are all where Unity expects them.

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 4:47pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/7 "2024-03-19T16:47:19Z")

</div>

I tried using a different TileSet which was created the same way as the template ones and it doesnt show the error anymore, but tileset is still invisible for some reason

bfore applying Automap and saving

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/5/57e2e9d03e5cc7c438dabf697bc08a87a7a5154c.png)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/3/31e32b4c610a63c5c9f122942347d346a7435f5a.png)  
and after applying Automap and saving  
very strange

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 4:53pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/8 "2024-03-19T16:53:46Z")

</div>

I’m afraid I can’t help with this, as I don’t use Unity, sorry. Maybe someone else can.

Is the image for the output tileset imported properly in Unity?

When you close and reopen the map in Tiled, are the tiles there? They should be, but I have seen some reports of weirdness with saving Automapping results.

Does it work if you put your output and input tiles all in one tileset?

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 4:57pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/9 "2024-03-19T16:57:56Z")

</div>

I appear to have solved this, Not sure if this is a bug or my doing but for some reason What i noticed is sometimes Tiled stop receiving input from the Keyboard  
so ctrl+s didnt register so it didnt actually save after Automapping

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 5:05pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/10 "2024-03-19T17:05:11Z")

</div>

Ah. The tab shows whether the map has been saved (unsaved maps have a \*), so when debugging this sort of thing, you should keep an eye on that.

The map not saving doesn’t explain why saw a difference in Unity before and after Automapping, however. The map should’ve just stayed looking like the prototype in Unity, shouldn’t it?

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 5:11pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/11 "2024-03-19T17:11:54Z")

</div>

If i click on Automap but dont actually save the Tilemap it cofuses Unity… i think?  
So it shows blank even though there is no error.

Also one more question, I automapped all of my tiles to tile ID X  
But now i want to change all of these tiles to tile ID Y ,  
But changing it in the rules map doesnt seem to overwrite it, only by adding new Tiles in the tile map it does update  
Is there a way to overwrite previous automapping?

What i mean is the Snowtiles are the old ones after Automapping with that tile, but now i want to change all of the tiles to the new black one, but it only works if i re-add tiles

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/f/fc6216be1e78efde7b7b4a136587362cc1eea2c2.png)

---

<div class="post-metadata">

**Author:** ![eishiya](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/eishiya/32/2534_2.png) [@eishiya](https://discourse.mapeditor.org/u/eishiya)\
**Post date:** [March 19, 2024, 5:19pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/12 "2024-03-19T17:19:48Z")

</div>

There are two main approaches you can take:

- Add your output tiles as inputs to your rules, or use the NonEmpty special tile instead of a specific prototype tile, so the rules will accept any tile.
- Output to a separate layer, so your prototype layer remains unchanged. If you do this, you may want to add a rule to erase tiles from the output layer(s) where the prototype is empty, so subsequent Automapping can respond to the current shape of the prototype.

Also, just in case: if this is meant to be a one-off change from snow to black, you can use the Select Same Tile tool to select all the snow tiles, and then shift+Bucket Fill to fill that selection with the black tile.

---

<div class="post-metadata">

**Author:** ![Emanue\_Turko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/emanue_turko/32/4505_2.png) [@Emanue\_Turko](https://discourse.mapeditor.org/u/Emanue_Turko)\
**Post date:** [March 19, 2024, 5:29pm UTC](https://discourse.mapeditor.org/t/cant-get-automapping-to-work/6651/13 "2024-03-19T17:29:55Z")

</div>

I see,I’ll try, thanks alot.
