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.

  • 11
    \$\begingroup\$ You are seriously underestimating the power of the hardware. Ask again if you are talking about 500 enemies and 20000 bullets. \$\endgroup\$ – API-Beast Aug 29 '12 at 11:53
  • 2
    \$\begingroup\$ 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. \$\endgroup\$ – William Mariager Aug 29 '12 at 12:34

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)

| improve this answer | |
  • 4
    \$\begingroup\$ It's called Quadtree. \$\endgroup\$ – API-Beast Aug 29 '12 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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