Best practice for representing a collision map in Tiled map?

By collision map I really mean a grid-base {0,1} that represent a walkable surface. It’s intended for a pathfinding library like Jumper.

My question being: should I use a tile layer then add custom property like walkable = 1, or should I use an object layer with shapes? Are there better solutions?

So far I prefer the tile layer way because it makes generating the collision map easier. Using object shapes we have to figure out the tile position.

If you want grid based collisions I would simply create a layer, called for example “collision”, and put some kind of dummy tile on it which marks the tile as collision.

But as soon you are starting to add special collisions like slopes, etc., you are maybe better off with using objects…

So as always, it depends :stuck_out_tongue:

1 Like