Skip to content
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

Render tile collision shapes to the main map #799

Closed
parasyte opened this issue Oct 15, 2014 · 13 comments
Closed

Render tile collision shapes to the main map #799

parasyte opened this issue Oct 15, 2014 · 13 comments
Labels
feature It's a feature, not a bug. priority request Has been requested by a major supporter.
Milestone

Comments

@parasyte
Copy link

Shapes created with the Tile Collision Editor are only visible within the Tile Collision Editor itself. For this ticket, I would like to see these shapes rendered to the primary map display, and toggled on/off.

@bjorn bjorn added the feature It's a feature, not a bug. label Oct 15, 2014
@Chaoseiro
Copy link

Maybe this library could help: http://www.angusj.com/delphi/clipper.php

I already use it to join the tile collisions for my Unity plugin :)

@T1mL3arn
Copy link

I just searched something about this feature and issue already is. Will be nice to have option to enable/disable render the collision shapes to map and also set specific color for that shapes.

Is the need to view real tiles shape, because collision shape can be smaller or bigger than images tile. Precision of placing images as bodies for physics simulation becomes great!

@bjorn
Copy link
Member

bjorn commented Feb 28, 2015

@T1mL3arn Yes, I fully agree this would be a useful feature. All I need is time to get around to it!

@Chaoseiro This answer comes a bit late, but I consider this issue just about visualizing the collision shapes on the map. For this there is no need to join them together. Still, such functionality would be nice as an export feature, which already exists in for example Tiled2Unity.

@sawt00th
Copy link

i same with @Chaoseiro
Showing collision certainly necessary, because in the process you can not see where the collision. Also, I think it is necessary to revise the strategy of collision detection for individual titles, and the selected area.

  1. The collision are set for individual titles, and are inherited at the reuse on the map. At the same time it is not possible to use the same title without collision with other parts. It is very uncomfortable.
  2. It is not possible to use the selection for collision detection on the map - but it's so convenient!

I use, like many others, in Tiled2Unity, and it is very convenient when a layer belongs to the collision object that you want to render. I am uncomfortable to render each object to write the object collisions, and later connecting it with the object render in Unity.

@bjorn
Copy link
Member

bjorn commented Oct 13, 2015

@sawt00th I find it very hard to understand what you mean. Are you sure you're with @Chaoseiro, who brought up the usage of Clipper to merge collision shapes, or are you just in favor of the general feature of displaying the collision shapes in the map view?

  1. The collision are set for individual titles, and are inherited at the reuse on the map. At the same time it is not possible to use the same title without collision with other parts. It is very uncomfortable.

Why is this not possible? Is it a limitation of Tiled2Unity? Maybe you could just have a custom property at the tile layer saying whether collision shapes should be used for the tiles on that layer? Then you can use a separate layer to place non-colliding tiles.

  1. It is not possible to use the selection for collision detection on the map - but it's so convenient!

I'm afraid I do not understand what you're saying here. Can you try to be more verbose or reconsider your choice of words?

I am uncomfortable to render each object to write the object collisions, and later connecting it with the object render in Unity.

Here also I do not understand what you mean.

@parasyte
Copy link
Author

FWIW, we use standard object layers in melonJS to define collision shapes. It makes visualization super simple. The tile collision shapes haven't been much use for us.

@parasyte
Copy link
Author

screen shot 2015-10-13 at 1 04 42 pm

@bjorn
Copy link
Member

bjorn commented Oct 13, 2015

That's a fine approach as well, but I think for those using Tiled2Unity, the tile collision shapes are generally quite useful. The tool automatically merges it all together into a single optimized collision mesh.

@parasyte
Copy link
Author

I believe we would love to make better use of it. The UX on the tool doesn't feel as good as object layer shapes. Anyway, the rendering of those tile shapes within the map view will be a nice step toward that goal.

@vortexofdoom
Copy link

@bjorn I think @Chaoseiro's idea about using the Clipper Library could be a very cool in-editor feature (although if it exported that way it would still ultimately just be a QoL feature) because you could see the shapes that would ultimately result from it, nice outlines and all, and in fact, if the editor did it dynamically it could be included that way on export with no further trouble, I'd imagine.

@cliedelt
Copy link

@bjorn any updates on this ? :)

@bjorn
Copy link
Member

bjorn commented Sep 11, 2018

@orgertot No, it remains to be implemented. There's just so much stuff that could be improved, I can't get around to everything. Maybe you'd like to help?

@bjorn bjorn added the priority request Has been requested by a major supporter. label Apr 5, 2019
bjorn added a commit that referenced this issue Apr 18, 2019
Currently only works for tile objects. Not yet implemented for tiles on
tile layers.

It does however deal with flipping, scaling, rotating and tileset
drawing offset. It also works on both isometric and orthogonal maps.

Issue #799
@bjorn bjorn closed this as completed in 84fb00e Apr 18, 2019
@bjorn
Copy link
Member

bjorn commented Apr 18, 2019

This became a priority request from a major patron, and has now been implemented. A new snapshot build should be available soon, which adds this feature as an on/off toggle. Collision shapes are rendered both for tile layers as well as tile objects, and support is included for flipped, scaled or rotated tiles/objects as well as for both orthogonal and isometric maps.

Ruin0x11 pushed a commit to Ruin0x11/tiled that referenced this issue May 15, 2019
Currently only works for tile objects. Not yet implemented for tiles on
tile layers.

It does however deal with flipping, scaling, rotating and tileset
drawing offset. It also works on both isometric and orthogonal maps.

Issue mapeditor#799
Ruin0x11 pushed a commit to Ruin0x11/tiled that referenced this issue May 15, 2019
Rendering code for collision shapes now moved to the CellRenderer, which
handles it for both tile layer tiles and tile objects.

Closes mapeditor#799
@bjorn bjorn added this to the Tiled 1.3 milestone Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug. priority request Has been requested by a major supporter.
Projects
None yet
Development

No branches or pull requests

7 participants