Change output ID's

Tiled can give multiple formats for output.
But what catches my attention is that the tile ID’s dont match with the given tilesets.

For example: I have two tile sets, one for layer 1, and the other for layer 2. The tile ID’s go from 0 to the maximum number of tiles on that set.

But when I look at the output format (e.g. I open .tmx with visual studio code to retrieve some data), I see that different numbers then the tile ID’s are used. So when I draw tiles with ID 0, it outputs 1. And in layer 2 it goes more weird: when I draw a tile with ID 0, it does output 0. But then, when I draw a tile with ID 1, it places 52. Why?

And the main question is, how can I change this, so that it just outputs the tile ID’s?

With kind regards

This page in the documentation explains it in detail: Global Tile IDs — Tiled 1.10.1 documentation

You cannot output the tile IDs directly, because that would make it impossible to distinguish tiles from multiple tilesets, to encode empty tiles, and to include flipping information.

The tile IDs should be consistent from layer to layer as long as it’s literally the same tile. The only way to get 0 in a TMX layer is to have an empty tile, no non-empty tile will ever be output as 0.

1 Like