Jump to content
  • Advertisement
Sign in to follow this  
Lucky808

collision detection with isometric tilemap

This topic is 2251 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

 

I'm currently working on an isometric tile based game and got stuck on collision detection with impassable tiles.

The map is built with Tiled editor by using a collision layer marking all the impassable tiles (i.e. wall, tree...), and at the beginning of each level the map is processed and the collision tiles get parsed into a 2D array holding the X,Y tile coordinate from the map.

My player character is free to roam around the map, his movement is pixel based not tile based.

In my other orthogonal tilemap games, I've been using a bounding box on my player to check for collision against collideable tiles by converting the 4 corners of his bounding box to X,Y tile coordinates and check them against the 2D collision array. This has been working great in orthogonal maps but not at all in isometric maps.

I dont want to have to check player's bounding box against each collideable tile's bounding box due to the complexity of the map. I rather leave that method to player vs moving objects type of collision detection.

Is there any way to tweak the code or coordinates system and still be able to use my existing method (it doesn't need to be pixel perfect)? Is there a better way to do this?

 

Thanks for any advise!

 

 

 

Share this post


Link to post
Share on other sites
Advertisement
The game logic including collision should be - literally - the exact same whether you draw your graphics top-down or isometrically.
You should only be transforming coordinates to screen space for drawing the stuff.
Bounding box on bounding box collision tests are really, really cheap. Chances are you can just do all the tests.
If it turns out you actually need to optimize, there are many techniques for that. Bounding volume hierarchies, quadtrees, etc.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!