Converting tilesets into objects?

Howdy Y’all.

I’ve been using Tiled to create a remote office for Gather Town, and have run into a bit of a challenge.

Gather recently implemented an object limit per map, which conflicts with our initial vision of being able to put lots of decoration for a personal touch.

So to address that I’ve been looking into ways to convert more of the “static” decor such as furniture into objects to “bake” into the Tiled map directly. But I can’t seem to figure out how to use this tool in spite of watching several YT videos and trying to understand the Tiled help files.

It seems like the tileset object item only supports a one tile object? Which is an issue, since most objects from Gather’s tilesets are multiples of 32x32 pixel tiles (like a 96x96 tree)

Is there an easy way to convert a grid of tiles into an object inside of Tiled somehow, or would I have to cut up every individual item into a transparent .png image file by itself to be able to place these “off-grid” inside of a project map?

1 Like

Each Tile Object must be one Tile, yes. Placing a bunch of objects together as one is generally not advised, since it causes performance issues and doesn’t z-sort well, on top of being annoying to deal with in Tiled.

You may be able to load your existing tileset images with a larger tile size to get such objects, if they’re on a grid (e.g. if your 96x96 trees also happen to follow a 96x96 grid within the tileset, despite being actually 32x32 tiles).

If the larger objects aren’t arranged in a grid, you may still be able to use those tilesets by making an Image Collection tileset, and using different subrectangles of the source tileset for each tree, etc. A while back I made this “create tile atlas” script to help automate the creation of such single-image Image Collections, instead of manually specifying the subrect for each tile, it lets you draw the rectangles with the Insert Rectangle tool, and then creates a new Tileset with those rectangles as the tiles.
CreateTileAtlas.js (4.8 KB)

Not all engines/loaders support subrects in Image Collections though, so I recommend testing Gather with such a tileset before you spend a lot of time building maps.

Another option is not to slice them up into individual images, but to put them in a separate tileset where they are on a larger grid and can be loaded as such. If your multi-tile objects are all roughly the same size, you could even have just one such tileset/image.

The more old-skool way to have a lot of wholly static artwork with more placement control is to use a smaller tile grid. You can either combine this with smaller tiles (the usual approach; you can slice each existing tile up into more tiles), or you can place larger tiles on the grid (provided the grid multiplies into the larger tile size) and leave space between them. Both of these can make using Terrains difficult or impossible, though. For example, the SNES used 8x8 tiles, and many games on it used 16x16 metatiles, but still occasionally had objects break the 16x16 grid to follow the 8x8 grid instead, creating more placement variety.

1 Like

That is… unfortunate. Guess I’ll have to convert the tilesets into separate images for each object then, because I need to bake in objects into the final image export done in Tiled, in order to circumvent Gather’s inherent limit on objects placed in their engine on top of the background and foreground images.

1 Like

If you’re baking the objects into an image anyway, then why does it matter how many tiles each object takes, why not place each as a bunch of objects? Putting each object into a separate tile is only necessary if you want to reduce the number of actual Objects in the map, but if you’re exporting the map as images, then it doesn’t matter how many Objects each prop is because none of those Objects end up in Gather.

1 Like

Lack of familiarity with Tiled? Seeing how much work it would be to turn a 3x3 tile into objects (including scaling and aligning everything together.

But it sounds like manually converting each grid of tiles of an object into a separate image file is the most efficient method, as slow as it is.

1 Like

If you’re exporting the maps as images and thus don’t need Gather to support the latest Tiled features, you could make an Image Collection without cutting the tiles out into separate images, using the script I shared earlier in this thread. It should be a lot less tedious.

1 Like

So, this is something I only grasped recently: In TileD, your map is of a certain size, let’s say 48x48, but you can place tiles of many different sizes onto the map. For instance, you can bring in a 48x144 tile- a tile that’s taller than all the other tiles, and paint with it or convert it into an object. It doesn’t shrink, warp, resize, or distort. It’s just an unusually large tile.

You’ve stumbled upon one way to add super tall tiles, which is Image collections. But you can just as easily sort all your 2-tile-tall objects and 3-tile-tall objects into two separate PNG files, and import them at 48 x 96 and 48 x 144 and either paint with them or use them as objects. It’s not necessary to give each and every last remaining asset its own file with this technique.

1 Like