Tiled map shows wrong tiles after the tileset changed
You widened or rearranged a tileset image, reopened the map, and now grass is water and walls are doors. Here is why it happens and how to repair it.
Why it happens
A Tiled map does not store pictures. It stores a number for each cell, and the numbers count along the rows of the tileset image. Tiled works out the number of columns from the image; the Columns value of an image tileset is read-only.
- You made the image taller and kept its width: nothing moves. The old tiles keep their numbers and the new rows get new ones.
- You changed the width, or moved tiles around: every tile after the first row gets a new number, and the map now points at whatever sits in the old position.
Sources: Tiled manual, tileset properties and Tiled issue 2863, where the maintainers describe the renumbering.
Fix 1, free: undo the width change
If you only added columns, put the image back to its old width and add the new tiles as rows at the bottom. The map is correct again with no other work. From now on, start with a wide sheet and grow it downward.
Fix 2, free: remap with the Mass Replace Tiles script
If the tiles really have moved, use eishiya's MassReplaceTiles.js. Its header says it replaces tiles "based on another map that provides the old tile -> new tile mappings".
- Put the script in Tiled's extensions folder. The scripting page of the manual says where that is. The script needs Tiled 1.8 or later.
- Make a small remapping map that pairs each old tile with its new one.
- Run the action from the Map menu on the current map, on all open maps or, from Tiled 1.10.1, on the whole project.
It works on tile layers and tile objects, and on TMX and JSON alike. For most projects this is the right answer. The work is in step 2: with a few dozen moved tiles it is quick, with a few hundred it is slow and easy to get wrong.
Fix 3, paid: let a tool match the tiles by their pixels
I make Tile Rebind ($12, with a free demo that repairs a sample map). You give it the old sheet, the new sheet and the map. It matches tiles by their exact pixels, asks you to settle duplicates and repainted tiles, and exports a remapped map with a change report. Flip flags are kept.
It only handles one plain embedded PNG tileset, in a finite orthogonal map saved as JSON with array layers. It does not handle TMX files, external tilesets, compressed layers, terrain or animations. If your project is any of those, use Fix 2.
Which one to use
- Only added columns, and can undo it: Fix 1.
- TMX maps, external tilesets, or a handful of moved tiles: Fix 2.
- JSON maps with an embedded sheet and many moved tiles: Fix 3 saves the mapping work.