Jump to content

  • Log In with Google      Sign In   
  • Create Account

collision detection with isometric tilemap


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Lucky808   Members   -  Reputation: 139

Like
0Likes
Like

Posted 18 March 2013 - 11:27 AM

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!

 

 

 



Sponsor:

#2 Yrjö P.   Crossbones+   -  Reputation: 1094

Like
0Likes
Like

Posted 20 March 2013 - 03:05 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS