Question about Collision Algorithm

Started by
2 comments, last by Kwizatz 15 years, 6 months ago
I'll admit, I'm a complete newbie when it comes to collision detection. The only thing I've done is make a crappy tile-based game. Beyond that, I've had little experience with collision. I'm helping out my artist friends in programming a platform adventure game. Right now it's set to be pixel-based collision detection, as in there is a copy of the map image in all black, and it checks each pixel for a black value. This works fairly well, but it feels pretty inefficient. I thought about doing tile collision, but I'm not sure how this would work with ramps, or look smooth. In simple, what are some approaches for 2D collision? What do some of the games (like Aquaria) do?
Advertisement
I'd use a Quadtree, split the map using a grid and use the squares to populate the Quadtree, that way you still can use pixel based collision detection.
Thanks for the reply. I'll definitely take a look into it. Is it used in some games, or just a really efficient algorithm? I'm also using C# and XNA if that makes any difference. Not sure if pointers are usable in C# (I'm assuming they are tho.)
I cant cite any games but the algorithm is widely used, I think Baldur's Gate used this or a variant of it.

The Octree (the 3D relative) is also very popular in video games.

This topic is closed to new replies.

Advertisement