Jump to content
  • Advertisement
Sign in to follow this  
RealmRPGer

Should I be checking all possible tiles for tile-based collision?

This topic is 4418 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

My current implementation for tile-based collision tests against all tiles that an object overlaps between its position last frame and the current frame(of course breaking from the loop once it finds a tile it collided with). Is this the best way to go about it? Also, what's considered the "best" way to do broad collision detection between objects? I've thought about seperating the world into sub-tiles of decreasing size, and checking against these tiles until it either reaches a tile that they're not both overlapping, or perform narrow collision detection when they're both on the "smallest" tile.

Share this post


Link to post
Share on other sites
Advertisement
I think you may want to look into spatial partitioning systems. If you're using tiles, Then you probably don't have to worry about all 3 dimensions when checking collisions. If this is the case, look into implementing quad-trees. This greatly simplifies the amount of work necessary to perform collision checks of this sort.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!