Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

The game I'm creating is a bullet hell game, so there can be quite a few objects on the screen at any given time. It probably maxes out at about 40 enemies and 200 or so bullets. That being said, I'm splitting up the playing field into a grid for my collision checking. Right now, it's only 8 cells. How many would be optimal? I'm worried that if I use too many, I'll be wasting CPU power. My main concern is processing power, to make the game run smoothly. RAM is not a big concern for me.

share|improve this question
11  
You are seriously underestimating the power of the hardware. Ask again if you are talking about 500 enemies and 20000 bullets. –  API-Beast Aug 29 '12 at 11:53
2  
Extending on what Mr. Beast says, unless you have a problem, you're currently wasting your time. For collision between 240 objects, you don't need any kinda of partitioning on average computers. –  William 'MindWorX' Mariager Aug 29 '12 at 12:34

1 Answer 1

up vote 2 down vote accepted

you could use an algorithm to determine the number of cells based upon the number of items contained within a given cell. dynamically increasing or decreasing the number of cells dependant on the content start for example with 4 areas if one of the 4 become congested, split this up into 4 new areas. (cant for the life of me remember the name)

share|improve this answer
3  
It's called Quadtree. –  API-Beast Aug 29 '12 at 13:41
    
thats the one Thanks :) –  Yakyb Aug 29 '12 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.