How to Fix “The number of tile columns in the tileset ‘TilesetName’ appears to have changed…”

FlatRedBall integrates closely with the fantastic tilemap program Tiled. If you’ve ever resized a PNG file, then you may have received a message notifying you that the number of columns in the tileset have changed.

Tiled is notifying you that the tileset was originally created with a PNG which had a different size compared to its size now. Unfortunately, clicking Yes may result in unexpected (and broken) results.

Fortunately a solution exists to this problem. If you have clicked Yes you will need to undo your changes by closing Tiled without saving your file. If you have saved your file, you will need to revert it in Git (or whatever version control program you are using). Unfortunately if you do not have a way to undo your changes, your file may be permanently corrupted.

To solve the problem:

  1. Click No on the popup

  2. Select whichever tileset references the resized PNG

  3. Click the Edit button to edit the tileset

  4. Make a change to the tileset. The change doesn’t matter, as it will be undone- a change is needed so that Tiled will let you re-save the tileset (TSX) file. For example, change the Type of one of the tiles.

  5. Save the tileset (TSX) file

  6. Undo the change to the Type (or whatever change you made earlier to save the file)

  7. Save the tileset (TSX) file again

After performing these steps, your map will still look like it did before, but Tiled will no longer ask you about the number of columns changing. Also if you look at the TSX file in a diff program, you will some of the values in the TSX have changed.

Once this change has been made, the map should render correctly in FlatRedBall as well.