Collision Erasure


Context: My map is split up into different elevations. Each elevation has 2 tile layers: the ground and the objects. A tree would be in the object tile layer and grass would be on the ground tile layer.

In the image above you can see that there is a bridge and ladder. The cliff wall and cliff grass have collision boxes to prevent the player from walking through or off the cliff. However, I want to ‘erase’ those collision boxes when the player is on a bridge or ladder but my current solution does not generalize well (i.e. for the bridge I make the player only detect collisions on the object layer, and for the ladder I make the player non-collidable and only allow vertical movement). Does anyone know of a better approach?

I personally handle this sort of thing by having two or more layers of collision, and toggling between them when the player enters/exits certain trigger zones. In my case, I define collision separately from my cosmetic tiles so breaking it up into layers like that is trivial, but if you’re careful and willing to repeat some tiles across layers, it can be done with collision derived from cosmetic tiles as well.

No matter how you define the collision, the logic for switching between which set(s) of collision you use has to be in your game/engine. So, it doesn’t much matter how you do it in Tiled, pick a way you find convenient to use.