Expanding tilesets


#1

In the case of multiple tile-sets, expanding the tileset1(480x480), in which the last tile ID is 225, to (tileset1)640x640, the last tile would be 400.
Having multiple tilesets continues the count from where the 1st imported tile set left off even if changed ?

I tested it and it seems to add the new offset, I just want to confirmation and to say thank you for the feature


(Thorbjørn Lindeijer) #2

Yeah, when tiles are added to a tileset that is not the last tileset referenced by the map, Tiled can still load a map because it stores the “first global ID” for each tileset, which makes tile references unambiguous.

In addition, when you increase the width of the tileset image, Tiled detects this and will ask you whether you want to adjust the indexes of the tiles on the map. This needs to be done, because tiles are simply counted instead of being referenced by their row and column.

There is unfortunately a problem when you have multiple maps using the same tileset. In order for all maps to be adjusted in this case, I think you need to have them all open in Tiled when you change the tileset image. Otherwise, it will adjust the first map you open, and then won’t ask you again, because it stores whether it did the adjustment with the tileset. So, I’m glad if this feature has worked fine for you, but there is still reason to be careful since it is tricky to get this right and it’s still somewhat of a corner-case.

Also, I am now reminded, that the tile index adjustment code does not yet deal with tile object templates and Wang tiles…


(Darkhog) #3

The way I’m dealing with this in my game is that I have an unreasonably big tileset (but still sized reasonably enough so the engine I’m using won’t choke on it) so I can add tiles as needed by just filling the blank tiles.


(Thorbjørn Lindeijer) #4

That works, but just know that it is never necessary to make the tileset higher than needed. Expanding a tileset image in height does not affect the tile numbering, so it is always safe. The problems only happen when changing the width.


(Darkhog) #5

Ah, from what you said to the OP, from the OP’s post and from the docs (that’s where I got the idea of purposefully too big tileset from) it was implied that it affects both dimensions, not only width. You may want to clarify that.