Is there a way to add a second sprite sheet to an existing tileset? I noticed that after adding one, the area underneath them is filled with hundreds of empty slots.
Do I have to stitch them together to make one giant image?
Alternatively, is it better to chop them up and use the ‘collection of images’ version of the tileset file instead? Is there a way to export from spritesheet tilesets to collection of images tilesets?
What do you mean by
I noticed that after adding one, the area underneath them is filled with hundreds of empty slots.
This should only happen if your tileset image contains a bunch of empty space, or if you shrink the tileset image (Tiled will temporarily display placeholders to allow the tileset to retain things like terrains and custom properties, but these will be removed when the tileset is loaded again if there’s nothing there.)
You cannot use multiple images with a “Based on Tileset Image” tileset, but you can merge those images into one in an image editor, and use that combined image. Note, however, that if the width of the tileset image changes, the tiles will be renumbered and any existing maps might end up with the wrong tiles. If you haven’t made any maps yet, this isn’t a problem, but if you have, I recommend making a new tileset for your combined tileset. Or better yet, use multiple tilesets, one for each tileset image.
If you already have tilesheets, it’s generally best to use them as such. Image Collections are generally best for tiles that start off being separate, and may have a negative impact on game performance (unless your engine puts everything into an atlas at build time).
If you have a bunch of empty space in your tileset image, you could put other tiles in that space, and if the tileset’s width doesn’t change, it won’t even affect any of your existing map. Tileset image height can grow without affecting existing maps.
This should only happen if your tileset image contains a bunch of empty space, or if you shrink the tileset image
Oh, I see what I did. I imported the sheet with a tiny tile dimension, then changed the tile dimensions to match the much larger actual tiles. All the previous tiles still exist, but any that now overflow off the image display blank
I already have the tilesheet, yes. I just expect to have more images to go into the same set as the project goes on. So to cleanly add to it, I should make sure any further additions extend the spritesheet vertically?
Correct, as long as you expand the tileset only vertically, your existing maps should be fine. So, I recommend making the tileset some reasonably wide size so that you don’t need to widen it.
If you do decide to widen the tileset, you can do it, but you need to make sure all of your maps are open in Tiled before you do it, and then Tiled will prompt if you want to update the tile references, to which you should say yes.
Another workflow, which also works if you want to rearrange the tiles in the tileset, is to create a new tileset with a new image (with the wider or otherwise altered arrangement), and to use the Mass Replace Tiles script to replace all of the tiles from your old tiles with the matching tiles from the new tileset. Of course, it’s best to avoid needing to do this in the first place, such as by only growing the tileset downward, or by using multiple tilesets.
What are the reasons behind a wider or thinner sprite sheet?
Is it just usability for me, or are there computation costs that come with having a 1x100 vs a 10x10 or 100x1?
Mostly convenience. GPUs tend to prefer textures with power-of-2 dimensions and squares, not so much in computation costs, but in that it makes for the most efficient use of memory.
Personally, I’m resizing my tilesets and using multiple tilesets as is convenient, and then at the end when I know I won’t be adding any more tiles, if I feel like it, I’ll use the method above to merge/rearrange the tilesets and replace all the tiles with the new tiles.
Due to how the script I linked works (with a TileMap with “old” and “new” layers to tell the script which old tiles to replace with which new tiles), it’s actually easiest to use that way, as I can rearrange/merge the tilesets by arranging all those tiles in a TileMap on a layer called “old”, export that TileMap as an image, create a new tileset with that image, and then paste the tiles from the new tileset on a “new” layer, and immediately use that TileMap to fix all my maps, with no extra work needed to manually create the old-new tile pairs.