0
\$\begingroup\$

I need some broad phase algorithm for my 2d game (shmup, bullet hell). Does one or another solution have any major advantages?

\$\endgroup\$
  • \$\begingroup\$ I think you should start with just using uniform grid spatial partitioning if the amount of vertices in your game is in the order of hundreds simulated per frame. If this is too slow after profiling, then tryout quad tree. Don't optimize prematurely... \$\endgroup\$ – XiaoChuan Yu Dec 10 '12 at 0:33
1
\$\begingroup\$

The two algorithms you have named are designed for arbitrarily large 3d worlds. While they can be adapted to a 2d shooter, there are simpler methods for the simpler environment.

For a 2d shooter I would use some variation of the blockmap concept used in DOOM - a grid of lists of objects that intersect each cell in the grid. Update the grid on each frame, and you only need to to collision detection on each set of objects in each cell.

\$\endgroup\$

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.