What is an efficient way to update tilesets?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By godotnoobperson

Let’s say I have a scene with some sprites and I converted it to a tileset. Somewhere along the line, I decided to add more sprites. So, I re-convert it to a tileset.

Now, my tileset shows multiple textures coming from the same scene. If I keep doing this, I’m going to have a lot of textures instead of just one.

Is it possible to “merge” these textures? Is there any performance penalty If I have, maybe, a hundred textures from the same scene in a single tileset?

example

:bust_in_silhouette: Reply From: Bean_of_all_Beans

This sounds like you may want to use an tile atlas. To do this:

  1. Go into the TileSet editor and select the bigger image you want to use – in this case a large image with all your tiles textures together, like a sprite sheet.

  2. Select the regions you wish to add – click and drag over all the tiles you want to have in your TileSet.

  3. Add the collision, occlusion, navigation, etc. you want each tile to have, then choose an icon. (This is done under the “Icon” tab near the right-hand). You don’t have to select an icon, but it could help you keep track of which atlas is which if you choose to add more individual tiles or complete tile atlases.

  4. When placing the tiles into the editor, where you can choose the tiles is also a section for choosing “sub-tiles” that are a part of the tile atlas.

There may be other ways of doing this, though I’m unsure of what they are, if any. Also, I do not know how exactly to choose different “sub-tiles” from an atlas by code; someone else may have something here or in the forums, so if that is a path you’re going down, I suggest looking it up or asking here again.

Hopefully this helps.

Hi. Thanks for replying. My tilemap is starting to get bigger, so this actually helps give me ideas on how to proceed. What are the advantages of using a tile atlas over a tile map?

godotnoobperson | 2020-08-26 01:43

From what testing I’ve done, it allows for you to use a single image file (like a PNG) and create multiple “tiles” from it. The only downside I’ve seen is that all tiles created from an atlas seem to share the same ID, so testing for specific tiles is probably more difficult.

Also, in case I was unclear or misleading, a Tile Atlas is a part of a Tile Set, much like those individual tiles you make. The only difference is it holds multiple variations or “Sub-tiles”. An example of what it could be used for is if you have various textures for, say, dirt, this allows for that to be done more easily.

I will also add that in my limited testing, I had no performance issues with TileMaps having lots of different tiles, each pulling from their own textures (tiles of the same type only pull the texture file once, drawing the texture over the proper place on-screen) – though I have a rig built for gaming.

Bean_of_all_Beans | 2020-08-26 03:45