Grouping layers

How about the possibility of grouping layers?

Like this:

Which would export to something like this:

 <group name="Layout 1" x="0" y="0" otherProperty="blue" flipX="1">
	 <imagelayer name="Chest" x="174" y="127">
	  <image source="chest.png"/>
	 </imagelayer>
	 <imagelayer name="Crate" x="257" y="168">
	  <image source="crate1.png"/>
	 </imagelayer>
	 <imagelayer name="Barrel" x="466" y="122">
	  <image source="barrel.png"/>
	 </imagelayer>
 </group>
 <group name="Layout 2" x="0" y="0" collapsed="1" hidden="1">
	 <imagelayer name="Chest" x="274" y="137">
	  <image source="chest.png"/>
	 </imagelayer>
	 <imagelayer name="Crate" x="227" y="161">
	  <image source="crate1.png"/>
	 </imagelayer>
	 <imagelayer name="Barrel" x="416" y="102">
	  <image source="barrel.png"/>
	 </imagelayer>
 </group>
 <group name="Layout 3" x="0" y="0" customeProperty="true">
	 <imagelayer name="Chest" x="174" y="127">
	  <image source="chest.png"/>
	 </imagelayer>
	 <imagelayer name="Crate" x="257" y="168" hidden="1">
	  <image source="crate1.png"/>
	 </imagelayer>
	 <imagelayer name="Barrel" x="466" y="122">
	  <image source="barrel.png"/>
	 </imagelayer>
 </group>

It would allow:

  1. Better editing (like groups in photoshop, etc.)
  2. Level designers to create different patterns so they can be loaded randomly just choosing one of the groups based on their custom properties, etc. (there are a lot of possibilities besides this random thing)
  3. Apply transformations (translation, rotation, flipping…) to a group of elements at the same time

etc.

And the 3rd point will cover also the contents of this suggestion too:

Because the “Add Image Layer” is just a single image, while the Tile Layer is actually a grid of tiles, and the Object layer is also a set of objects, so why not make the Image Layer a set of Images. And not only that, allow grouping things freely :smile: for a better world!

PS
By the way, the example only shows image grouping, but technically it should be possible (xml-wise) to group any kind of entities (layer of tiles, layer of objects, images…)

It would also make it clearer if one layer depends on or affects another. For instance an object layer as child of a tile layer that defines the game objects created at runtime for that layer.

I totally agree and in fact already described plans to change the map format into a general hierarchical structure 2.5 years ago on the Donate page (which could of course use an update by now):

  • Make the map format more flexible by changing it to an object hierarchy. This would allow using tile layers as objects or to group things like buildings together.

For 2 years after I wrote that I did not actually receive sufficient donations to be able to spend more time on Tiled. But since I launched my Patreon page half a year ago, the situation is much better and I can now spend one full day/week on Tiled. I’m currently focusing on finishing Tiled 1.0, which still has many open issues, and after that there will be room for making further improvements like the one you’ve suggested.

This feature is also covered by the following issue on GitHub:

Now about this:

The image layer is not often useful as it is. It was contributed as a pull request but its author has not developed it further. Plans for improving it include making it repeat its image and adding support for parallax scrolling (which would be a feature for all layers in general).

The use-case of having a layer to add multiple images to is already covered by the object layer, where you can insert and freely position tile objects.

Btw, the suggestion you quoted there is about resizing groups of objects on an object layer together, rather than one by one, which is a feature that was added in Tiled 0.12.

So I guess we’ll see nothing of this soon, right? :-/
omg if I could get $600/month I’d make it in just one month! lol

omg if I could get $600/month I’d make it in just one month! lol

But if you would do that you would loose time to fix / implement the remaining issues for the 1.0. Grouping of layers is a nice to have of course, but if you see the list of 1.0 issues you will see that there are many many more important issues to fix…

If you want to speed things up you can think about implementing it yourself and open a pullrequest on github.

Regards,
Ablu

I’m not sure what you mean with doing it in one month. At this level of support, I can afford to spend 4 days/month on Tiled. So assuming you meant doing it in 4 days, I consider that very optimistic given the amount of affected code and problems that will come up if this is to be done with a generic hierarchy approach. Of course, things are a little easier when it is purely a grouping feature for the existing layer types.

But like Ablu said, you’re placing your feature on the top of the priority list. I’m trying to use my best judgment in choosing my priorities and I do take people’s feedback into account, including yours. But given 4 days/month, things can only go so fast so I would currently estimate when I’ll get around to layer grouping to be “early 2016”.

Take a look at all the improvements made in Tiled 0.12, 0.13 and 0.14, all released this year. That’s the kind of progress I can make with 4 days/month. If you want to help me make faster progress, you can either start coding or consider supporting me as a patron.

2 Likes