New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer groups / hierarchy #1038

Closed
nobody-special666 opened this Issue Jul 21, 2015 · 15 comments

Comments

Projects
None yet
6 participants
@nobody-special666

nobody-special666 commented Jul 21, 2015

I would like to propose that Tiled add support for layer groups, similar to Photoshop.
Layers in the same layer group are merged together first (e.g: rendered to a LayerItem) and then the aggregate image is drawn in its order within the layer stack (per usual).
Nested group layers would also be nice but could be implemented in a later phase.
This is probably more useful for tile layers than object layers.
This includes the ability to turn on/off visibility for individual layers within the layer group or the entire group itself by manipulating the parent node.

This would change the layer dock to be a tree view, and would have to enable drag-and-drop
to add/remove layers to/from the group.

This makes it possible to have an arbitrary number of tiles occupying the same cell (from a visual perspective) while allowing you to organize them onto as many layers as you desire.

Could this be implemented in the current TMX file format and maintain backwards compatibility?

@nobody-special666 nobody-special666 changed the title from Proposal: Layer groups for tiled to Proposal: Layer groups for Tiled Jul 21, 2015

@bjorn bjorn added the feature label Jul 21, 2015

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jul 21, 2015

Owner

Right, this is something I'd like to support so thanks for opening an issue about it.

But, I do not understand your suggestion with the merging together or the thing about an arbitrary number of tiles occupying the same cell. Personally I would say the rendering behavior can stay largely the same. How do you think it would be different from the way you can currently have an arbitrary number of tiles occupying the same cell?

As for compatibility, it would be possible to support this in a backwards-compatible way, for example by doing the grouping with a separation character in the layer name (like writing name="Over/Clouds" for a layer called "Clouds" nested in a layer group called "Over"). But I'm not sure if I want to do this. We'll have to consider how this works together with the rest of the format.

On my donation page I had written some plans for the future, which included the following for Tiled 2:

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.

Of course that goes a little bit further than just layer grouping, but I'd like to keep that goal in mind when adding this feature.

Owner

bjorn commented Jul 21, 2015

Right, this is something I'd like to support so thanks for opening an issue about it.

But, I do not understand your suggestion with the merging together or the thing about an arbitrary number of tiles occupying the same cell. Personally I would say the rendering behavior can stay largely the same. How do you think it would be different from the way you can currently have an arbitrary number of tiles occupying the same cell?

As for compatibility, it would be possible to support this in a backwards-compatible way, for example by doing the grouping with a separation character in the layer name (like writing name="Over/Clouds" for a layer called "Clouds" nested in a layer group called "Over"). But I'm not sure if I want to do this. We'll have to consider how this works together with the rest of the format.

On my donation page I had written some plans for the future, which included the following for Tiled 2:

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.

Of course that goes a little bit further than just layer grouping, but I'd like to keep that goal in mind when adding this feature.

@bjorn bjorn changed the title from Proposal: Layer groups for Tiled to Layer groups / hierarchy Jul 21, 2015

@tpetry

This comment has been minimized.

Show comment
Hide comment
@tpetry

tpetry Aug 5, 2015

Wouldn't layer grouping merely be a small ui feature? Isn't it just "folders" for layers? If you hide the folder all layers of the folder will be hidden and vice versa.

As this is an purely logical implementation it could be added to the tmx/json files at the end (for backwards-compatibility) stating that folder0 contains layer0 and folder1. And folder1 conaints layer1.

tpetry commented Aug 5, 2015

Wouldn't layer grouping merely be a small ui feature? Isn't it just "folders" for layers? If you hide the folder all layers of the folder will be hidden and vice versa.

As this is an purely logical implementation it could be added to the tmx/json files at the end (for backwards-compatibility) stating that folder0 contains layer0 and folder1. And folder1 conaints layer1.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Aug 6, 2015

Owner

@tpetry Well, as I noted at the end of my previous comment, I'd really like to have this kind of grouping supported throughout the format, not just for layers. So adding some tags just to do layer grouping is not really an approach I want to take.

Owner

bjorn commented Aug 6, 2015

@tpetry Well, as I noted at the end of my previous comment, I'd really like to have this kind of grouping supported throughout the format, not just for layers. So adding some tags just to do layer grouping is not really an approach I want to take.

@mscharhag

This comment has been minimized.

Show comment
Hide comment
@mscharhag

mscharhag Mar 26, 2016

+1 I think a grouping option would be very useful.

mscharhag commented Mar 26, 2016

+1 I think a grouping option would be very useful.

@adsilcott

This comment has been minimized.

Show comment
Hide comment
@adsilcott

adsilcott Jul 23, 2016

I came here to open a issue for "Nested Layers", which sounds like what this issue is requesting. Right now I have Background, Background_Transparent, Background_Objects, etc, which I often have to enable or disable together, so it would be great to have them grouped together under "Background".

+1 to the separation character in the name idea, that would work perfectly for my needs. (Even better if @Seanba could work work that into the prefab hierarchy in Tiled2Unity, but that's a separate issue!)

Btw, thank you for Tiled @bjorn it's an awesome tool. I've been using it for a while now and just decided to back you on Patreon.

adsilcott commented Jul 23, 2016

I came here to open a issue for "Nested Layers", which sounds like what this issue is requesting. Right now I have Background, Background_Transparent, Background_Objects, etc, which I often have to enable or disable together, so it would be great to have them grouped together under "Background".

+1 to the separation character in the name idea, that would work perfectly for my needs. (Even better if @Seanba could work work that into the prefab hierarchy in Tiled2Unity, but that's a separate issue!)

Btw, thank you for Tiled @bjorn it's an awesome tool. I've been using it for a while now and just decided to back you on Patreon.

@Seanba

This comment has been minimized.

Show comment
Hide comment
@Seanba

Seanba Jul 25, 2016

Contributor

(Even better if @Seanba could work work that into the prefab hierarchy in Tiled2Unity, but that's a separate issue!)

I'll keep an eye on progress and make sure to follow Bjorn's lead on this for Tiled2Unity. In the meantime, if the grouping is important to you I suggest you put that into a Custom Importer.

Contributor

Seanba commented Jul 25, 2016

(Even better if @Seanba could work work that into the prefab hierarchy in Tiled2Unity, but that's a separate issue!)

I'll keep an eye on progress and make sure to follow Bjorn's lead on this for Tiled2Unity. In the meantime, if the grouping is important to you I suggest you put that into a Custom Importer.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jul 25, 2016

Owner

Btw, thank you for Tiled @bjorn it's an awesome tool. I've been using it for a while now and just decided to back you on Patreon.

Hey @adsilcott, thanks a lot for supporting me!

Right now I'm focusing on getting Tiled 0.17 out with the many improvements already made since 0.16 on the master branch, as well as solving issues related to working with external tilesets. I'll try to get to this afterwards. I've added it to the Roadmap for Tiled 1.1, along with layer locking.

Owner

bjorn commented Jul 25, 2016

Btw, thank you for Tiled @bjorn it's an awesome tool. I've been using it for a while now and just decided to back you on Patreon.

Hey @adsilcott, thanks a lot for supporting me!

Right now I'm focusing on getting Tiled 0.17 out with the many improvements already made since 0.16 on the master branch, as well as solving issues related to working with external tilesets. I'll try to get to this afterwards. I've added it to the Roadmap for Tiled 1.1, along with layer locking.

@adsilcott

This comment has been minimized.

Show comment
Hide comment
@adsilcott

adsilcott Jul 25, 2016

Thanks @bjorn ! I'm looking forward to .17!

And thanks for the reply @Seanba ! I've been using Tiled2Unity's Custom Importer extensively in my project, and I wrote one to do just that!

adsilcott commented Jul 25, 2016

Thanks @bjorn ! I'm looking forward to .17!

And thanks for the reply @Seanba ! I've been using Tiled2Unity's Custom Importer extensively in my project, and I wrote one to do just that!

@bjorn bjorn self-assigned this Jan 10, 2017

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jan 15, 2017

Owner

Short update: I'm currently working on this feature and my plan is to make it a simple layer grouping feature, similar to how it works in Photoshop, like originally requested. Making bigger changes to the map format will have to wait.

The feature gained priority mostly because a major patron is asking for it to be implemented.

This work is done on the wip/group-layer branch.

Owner

bjorn commented Jan 15, 2017

Short update: I'm currently working on this feature and my plan is to make it a simple layer grouping feature, similar to how it works in Photoshop, like originally requested. Making bigger changes to the map format will have to wait.

The feature gained priority mostly because a major patron is asking for it to be implemented.

This work is done on the wip/group-layer branch.

@bjorn bjorn added this to the Tiled 1.0 milestone Jan 21, 2017

@bjorn bjorn referenced this issue Jan 27, 2017

Closed

Text Object #1429

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Feb 7, 2017

Owner

I have merged the wip/group-layer branch into master and updated the snapshot branch, so you can soon try out this feature. The issue remains open for now because I still need to look into supporting drag-n-drop of layers into and out of groups.

At 2,774 additions and 1,014 deletions affecting 86 files, this was one huge change.

Owner

bjorn commented Feb 7, 2017

I have merged the wip/group-layer branch into master and updated the snapshot branch, so you can soon try out this feature. The issue remains open for now because I still need to look into supporting drag-n-drop of layers into and out of groups.

At 2,774 additions and 1,014 deletions affecting 86 files, this was one huge change.

@Seanba

This comment has been minimized.

Show comment
Hide comment
@Seanba

Seanba Feb 12, 2017

Contributor

Bjorn, are there still daily builds of Tiled available somewhere? I might want to take a peek at what you're doing here, especially to see how this grouping is expressed in the TMX format.

Contributor

Seanba commented Feb 12, 2017

Bjorn, are there still daily builds of Tiled available somewhere? I might want to take a peek at what you're doing here, especially to see how this grouping is expressed in the TMX format.

@bjorn bjorn added this to In Progress in Roadmap Feb 13, 2017

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Feb 13, 2017

Owner

@Seanba Yes, the daily builds are still available (and linked from the itch.io downloads page). You can find them at https://update.mapeditor.org/ in the snapshots-win and snapshots-osx folders.

In the TMX format, you can now find group layers as follows:

<layer ...></layer>
<objectgroup ...></objectgroup>
<group ...>
    <layer ...></layer>
    <objectgroup ...></objectgroup>
</group>

While I think this'll do fine, feedback is welcome.

Owner

bjorn commented Feb 13, 2017

@Seanba Yes, the daily builds are still available (and linked from the itch.io downloads page). You can find them at https://update.mapeditor.org/ in the snapshots-win and snapshots-osx folders.

In the TMX format, you can now find group layers as follows:

<layer ...></layer>
<objectgroup ...></objectgroup>
<group ...>
    <layer ...></layer>
    <objectgroup ...></objectgroup>
</group>

While I think this'll do fine, feedback is welcome.

@Seanba

This comment has been minimized.

Show comment
Hide comment
@Seanba

Seanba Feb 19, 2017

Contributor

Bjorn, I grabbed version 0.18.1545 and for the life of me I can't find the Collision Editor. I'm guessing it has been moved?

Contributor

Seanba commented Feb 19, 2017

Bjorn, I grabbed version 0.18.1545 and for the life of me I can't find the Collision Editor. I'm guessing it has been moved?

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Feb 19, 2017

Owner

@Seanba I moved it to the Tileset menu, which is only visible if you're editing a tileset. You're not the first one being confused...

Owner

bjorn commented Feb 19, 2017

@Seanba I moved it to the Tileset menu, which is only visible if you're editing a tileset. You're not the first one being confused...

@Seanba

This comment has been minimized.

Show comment
Hide comment
@Seanba

Seanba Mar 9, 2017

Contributor

For those interested, Tiled2Unity version 1.0.10.1 was just uploaded and it supports Group Layers.

Contributor

Seanba commented Mar 9, 2017

For those interested, Tiled2Unity version 1.0.10.1 was just uploaded and it supports Group Layers.

@bjorn bjorn closed this in b6d16de Apr 18, 2017

@bjorn bjorn moved this from In Progress to Recently Completed in Roadmap Apr 18, 2017

@bjorn bjorn removed this from Recently Completed in Roadmap Jun 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment