Tiled: Render tile collision shapes to the main map

Created on 15 Oct 2014  路  13Comments  路  Source: mapeditor/tiled

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.

feature priority request

Most helpful comment

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.

All 13 comments

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 :)

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!

@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.

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.

@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.

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.

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

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.

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.

@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.

@bjorn any updates on this ? :)

@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?

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.

Was this page helpful?
0 / 5 - 0 ratings