Sign in to follow this  
RealmRPGer

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this