Jump to content
  • Advertisement
Sign in to follow this  
Arbel

Question about Collision Algorithm

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

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!