1
\$\begingroup\$

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.

\$\endgroup\$
2
  • 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
    Aug 29 '12 at 12:34
3
\$\begingroup\$

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)

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .