Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Sectorizing game objects

This topic is 6510 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''ve been toying around with a side scrolling blasting the carp out of everything game, and I''ve been thinking about different methods of collision detections and trying to come up with a method that would be efficient for thousands of objects. Not because I really need thousands of objects, but I''d like it to be as efficient as possible. Currently I have a routine that goes and updates all objects - ie move, and do any thinking or testing for player input. While going through this loop it seems that collision detection would be a pretty OK thing to be doing. My question is, how to manage what objects are relevent to test collisions against. My current plan, is to divide the world/playing area up into different sections, each section represented by a list of objects in it. During the update routine, it''s determined what sector(s) an object should belong to for testing. After all objects are updated the sectors test for collisions within themselves to see what''s up. Another idea I had was some kind of sorting method that would let objects know what ones are close to them. That way they''d test against what''s near them, and be able to stop at some range away from them. Of course, in a 2D world, managing this would be a little weird. So I was curious about what other people do to solve this problem.

Share this post

Link to post
Share on other sites
One thing to consider, is that a method that efficently CT''s 1000''s of objects is not the same method that efficently CT''s 100''s or a dozen objects.

For the 1000''s you''ll have a bunch of overhead deciding whether a group of objects have a chance of colliding. In the dozens, you''ll already be done checking them all. I''m not where the trade off is, and worse, it''s machine dependant

So a good algo needs to know when to JFDI and when to use a BSP or OctTree.

Share this post

Link to post
Share on other sites

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