Multi-tile sprites in object layer?

Is it planned or possible to make an object based on multiple tiles? For example could you select a 3x3 grid of tiles and add them as a single object? This could be used to make proper sprites instead of breaking them into pieces and having to rebuild them in the game engine.

Hello,

usually we are using object layer and placing normal full-sized objects there (instead of tiles).
Tile layers are useful and comfortable to create common static landscapes, but since one tile has no any properties to edit, it could not be freely rotated, resized etc, it is very good to use objects instead.

Here you can see main landscape was done using tile layers, in opposite to, some specific objects (barrels, lights, zones, markers etc) was put to object layers.

1 Like

To answer this question specifically, such a feature is not planned as described. However, if you can save this 3x3 part of your tileset as a separate image and use an Image Collection tileset, which then allows placing it as a single object.

It would be nice to support such things without requiring things to be saved as separate images, but that would be a feature at the tileset level (so allowing the region of each tile to be defined, rather than having to place them on a fixed grid). This is definitely something I’d like to support.

1 Like

Thanks. Yes I finally discovered “collection of images” and how to use these. They fixed my sprite problem but don’t mesh well with how Tiled renders everything in layers because layers that I use for height in the engine overlap images that are larger than 1x1 tile. I mentioned this same limitation in another reply I just made. Tiled basically needs more options for 3D isometric maps that extends beyond the layers approach currently used and hacks that are required.

@genericptr, could you maybe illustrate the problem with a screenshot? I know what you’re talking about but it could still help to better understand possible solutions.

Here’s an example of the isometric problem. Notice Main 2 has some custom properties to tell the engine to merge into “main” at level 1 (level 0 is level main) because z+1 means x-1,y-1 in isometric. You can see the 1x3 sized tree placed on level 0 (Main) is clipped by the tiles in “Main 2”

As discussed there’s no way to fix this using the layer approach when drawing. You need to have all tiles in one layer so you can sort them as a batch. However, without layers there’s no way to manage with height and tile placement so I suggest Tiled needs a specific feature for isometric height maps like this.

Yes, you get the problem about “tileset regions”. I’ve broken down the image but that means more tile sets and textures (which is bad) even though I could derive that image from the existing tileset. I could make some custom properties on the tile in the tileset which told the engine to do this and place just the base of the sprite but that would look bad in tiled (or even worse I should say give the other problem of height and overlaps).

@bjorn I figured I’d ask since it’s been a few years - have you revisited this since the last reply? Is it possible (or will it be possible) to reference a 3x3 grid of tiles and add them as a single object?

1 Like

I have the same issue. Would be awesome to be able to create objects from multiple tiles.

1 Like

To those interested in this feature: how would you expect these objects to work/be represented in the game engines that you use? Single-tile objects are very simple in this regard, multi-tile objects are much less so, and may be treading on territory better handled by other tools, at least as I imagine them. Either way, knowing how they would be used in engines would be helpful in figuring out how the feature should be designed, if anyone decides to implement it.

It could be saved as rect in image space. So for example it could be {0,0,3,3} which is a 3x3 tile starting at tile 0,0 (top-left)

So, it wouldn’t be arbitrary tiles that can be used to make objects, it would still have to be a single subrect of your tileset image? That just sounds like you need a more flexible way to define tiles, rather than the ability to make Objects out of multiple tiles.

The planned Spritesheet-style tileset feature will probably do the job in your case - that will let you define tiles from arbitrary subrects of your tileset image, so you’d be able to just make your 3x3 rectangle as its own tile (and you could still make tiles out of the individual subtiles if you need them).

That would work also but it’s very common to have objects that span multiple tiles but still be aligned to the tile grid and you already have a tile editor that can select multiple tiles at once.

Tiled does indeed already provide tools for working with multiple tiles, but that’s why I asked about the engine side. How would these multi-tile objects work in your engine? How would it deal with the fact that each of these component Tiles may have their own properties?

In that case of subrect-style objects, they’d almost certainly use a single sprite and probably ignore Tile properties, and it’s better to represent that in Tiled directly, so that what you see in Tiled is what you get in-game. There’s nothing fundamentally multi-tile about this approach, and turning the subrect into a Tile is a much simpler solution both Tiled-side and engine-side.

In addition, this subrect approach is meaningless in the context of Image Collection tilesets.

The case of arbitrary multi-tile Objects, that is, objects that can consist of an arbitrary arrangement of tiles that do not necessarily form a subrect of the tileset or which may be part of an Image Collection, is much more interesting and flexible, but also far more challenging to deal with more in Tiled and in engines.

Just curious, are you a developer with Tiled?

As for the engine the tiles are already loaded into a single texture so we can simply draw parts of the texture, which is in fact how a single tile is drawn anyways so it’s logical to simply extended the size when drawing. Instead of getting texture coordinates for 1x1 tile we get coordinates for a 3x2 tile.

It sounds like we’re talking about the same thing here but I’m a little confused with the terms in Tiled.

So, it would be a special case for Objects, defining what is essentially a new (but larger) tile from the texture. That’s why I keep saying it’s easier to use a larger tile in Tiled xP

This isn’t a feature yet, but bjorn has expressed interest in creating a new tileset type that will allow it. In this new tileset type, you would be able to have your regular tiles just the same as before if you want, but you’d also be able to define additional larger tiles, which would be perfect for your scenario, I think.

It would completely avoid the need to have a new multi-tile Object Type, and would simplify the work you’d need to do in-engine to hook up properties to these larger objects, since they’d just use the same single-tile system that already exists. The only change engine-side would be support for the new tileset type, which should be easier to add than support for a more complex type of Object.

I’m not a developer on Tiled, no. I just have some familiarity with how it works internally, and with how the development process on new features for it tends to go.

I guess I need to see what you’re talking about, maybe it’s just fine. Here’s an example of an object which references a GID into a tile set.

<object id="2" gid="4257" x="224" y="56" width="16" height="16"/>

What I’m saying is that instead of one GID you select multiple tiles at once and use the GID as the origin and then an additional x/y dimension. In the engine you would draw the tile as before but apply the dimension also. This is very natural to how the texture coords are extracted and draw anyways. For example example a 3x2 object starting at GID 4257.

<object id="2" gid="4257" tileWidth="3" tileHeight="2" x="224" y="56" width="16" height="16"/>

I could really use this feature as well. My use case is, I need bounding boxes associated with each object to sort the order in which sprites are drawn at runtime. So I can’t just go with a seperate collision layer because it doesn’t associate the data with the respective objects. I need to use the tile collision editor for that. So it would be really helpful if I could make several tiles into one object. At the moment I have resorted to using a single image for each object instead of a texture atlas.