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

Deleting all tile collision shapes leaves behind empty objectgroup #1230

Closed
IoriBranford opened this Issue Mar 21, 2016 · 9 comments

Comments

3 participants
@IoriBranford

IoriBranford commented Mar 21, 2016

  1. Open map in Tiled 0.15.2
  2. Open Tile Collision editor
  3. Add shapes to a tile, delete them again
  4. Save map or export tileset
  5. Open map or tileset in text editor

The empty tile objectgroup remains in the tile. This can confuse Tiled implementations which handle tiles with objectgroups differently from tiles without. e.g. https://github.com/karai17/Simple-Tiled-Implementation/blob/master/plugins/box2d.lua#L172

The empty tile objectgroups persist even after closing, reopening, resaving and reexporting.

@bjorn bjorn added the bug label Mar 21, 2016

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Mar 21, 2016

Owner

Let's consider that a bug, since it's also just messy to leave that behind.

However, apart from checking whether the object group is empty before removing it, it should probably also make sure no custom properties are set on it.

Owner

bjorn commented Mar 21, 2016

Let's consider that a bug, since it's also just messy to leave that behind.

However, apart from checking whether the object group is empty before removing it, it should probably also make sure no custom properties are set on it.

@bjorn bjorn added this to Tiled 1.1 in Roadmap Sep 28, 2017

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn
Owner

bjorn commented Sep 30, 2017

@bjorn bjorn moved this from Tiled 1.1 to Up Next in Roadmap Nov 29, 2017

@bjorn bjorn moved this from Up Next to Tiled 1.1 in Roadmap Dec 14, 2017

@bjorn bjorn moved this from Tiled 1.2 to Tiled 1.1 (bugfixes) in Roadmap Jan 16, 2018

@P1llus

This comment has been minimized.

Show comment
Hide comment
@P1llus

P1llus Mar 2, 2018

Is there any news on this? i normally handle my collision otherwise but decided to go with this for a small project. Ended up creating collision for a bunch of tiles i did wrong, and now i will have to reimport all the tiles again, and create those parts of the map all over :(
Would it be possible to for example right click a tile, and choose remove collision?

P1llus commented Mar 2, 2018

Is there any news on this? i normally handle my collision otherwise but decided to go with this for a small project. Ended up creating collision for a bunch of tiles i did wrong, and now i will have to reimport all the tiles again, and create those parts of the map all over :(
Would it be possible to for example right click a tile, and choose remove collision?

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Mar 7, 2018

Owner

@P1llus I'm not sure if I understand your problem. This bug is about an empty "objectgroup" staying behind in the file format when removing all collision shapes from a tile. Apart from making the file and possibly your deserialized data size slightly bigger, how is this causing a problem for you?

Are you using STI? I think adjusting STI to not be confused by empty "objectgroup" properties should be rather trivial.

Would it be possible to for example right click a tile, and choose remove collision?

Of course, there is not much to say against adding such an action. However, this bug is really about removing the empty "objectgroup" automatically, once the user removes all collision shapes from a tile.

Owner

bjorn commented Mar 7, 2018

@P1llus I'm not sure if I understand your problem. This bug is about an empty "objectgroup" staying behind in the file format when removing all collision shapes from a tile. Apart from making the file and possibly your deserialized data size slightly bigger, how is this causing a problem for you?

Are you using STI? I think adjusting STI to not be confused by empty "objectgroup" properties should be rather trivial.

Would it be possible to for example right click a tile, and choose remove collision?

Of course, there is not much to say against adding such an action. However, this bug is really about removing the empty "objectgroup" automatically, once the user removes all collision shapes from a tile.

@P1llus

This comment has been minimized.

Show comment
Hide comment
@P1llus

P1llus Mar 7, 2018

@bjorn Actually this was a really big misunderstanding. I was a bit quick around the corner when adding a comment to this issue.

The reason is that i found no way of deleting collisions made in the collision editor, and after searching around, i thought i found a request to add this functionality in.
I do not know if this feature is in (at least not from what i could find), and i find it weird that i would put it in this request, so please disregard my comment related to this issue, since it is false.

EDIT: I found out why i posted it here, it was because of this post: http://discourse.mapeditor.org/t/how-to-remove-collision-effect-of-an-object/2729 that you answered to

P1llus commented Mar 7, 2018

@bjorn Actually this was a really big misunderstanding. I was a bit quick around the corner when adding a comment to this issue.

The reason is that i found no way of deleting collisions made in the collision editor, and after searching around, i thought i found a request to add this functionality in.
I do not know if this feature is in (at least not from what i could find), and i find it weird that i would put it in this request, so please disregard my comment related to this issue, since it is false.

EDIT: I found out why i posted it here, it was because of this post: http://discourse.mapeditor.org/t/how-to-remove-collision-effect-of-an-object/2729 that you answered to

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Mar 7, 2018

Owner

The reason is that i found no way of deleting collisions made in the collision editor, and after searching around, i thought i found a request to add this functionality in.

Hmm, but did you find it in the meantime? You should be able to delete collisions by just selecting those objects and pressing the Delete key.

Owner

bjorn commented Mar 7, 2018

The reason is that i found no way of deleting collisions made in the collision editor, and after searching around, i thought i found a request to add this functionality in.

Hmm, but did you find it in the meantime? You should be able to delete collisions by just selecting those objects and pressing the Delete key.

@P1llus

This comment has been minimized.

Show comment
Hide comment
@P1llus

P1llus Mar 7, 2018

@bjorn I found the reason to why i posted here. It was because of this post: http://discourse.mapeditor.org/t/how-to-remove-collision-effect-of-an-object/2729

But if i have a spritesheet or tilesheet that i have imported, and add a collision to one tile. I am unable to remove that collision afterwards? There is no remove button, and when i try to select the current collision i made, it just creates a new collision square instead..

P1llus commented Mar 7, 2018

@bjorn I found the reason to why i posted here. It was because of this post: http://discourse.mapeditor.org/t/how-to-remove-collision-effect-of-an-object/2729

But if i have a spritesheet or tilesheet that i have imported, and add a collision to one tile. I am unable to remove that collision afterwards? There is no remove button, and when i try to select the current collision i made, it just creates a new collision square instead..

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Mar 7, 2018

Owner

@P1llus To remove a collision object you first need to select it, and for selecting objects you need to select the "Select Objects" tool. Once you have the object selected just press Delete.

Actually you can also right-click the object and choose "Remove Object", regardless of which tool you have selected.

Owner

bjorn commented Mar 7, 2018

@P1llus To remove a collision object you first need to select it, and for selecting objects you need to select the "Select Objects" tool. Once you have the object selected just press Delete.

Actually you can also right-click the object and choose "Remove Object", regardless of which tool you have selected.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Apr 17, 2018

Owner

However, apart from checking whether the object group is empty before removing it, it should probably also make sure no custom properties are set on it.

This earlier comment I made is no longer applicable since Tiled 1.1.4 due to change 528e6d4.

I've just submitted a change that will properly clean up this object group, to be included in Tiled 1.1.5.

Owner

bjorn commented Apr 17, 2018

However, apart from checking whether the object group is empty before removing it, it should probably also make sure no custom properties are set on it.

This earlier comment I made is no longer applicable since Tiled 1.1.4 due to change 528e6d4.

I've just submitted a change that will properly clean up this object group, to be included in Tiled 1.1.5.

@bjorn bjorn closed this in 4fc9d93 Apr 18, 2018

Roadmap automation moved this from Tiled 1.1 (bugfixes) to Recently Completed Apr 18, 2018

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