Ok. So there are several methods to implement Collision detection like R-trees, Quadtrees, BSP trees Recursive Dimensional Clustering (RDC). Or maybe more.
My problem is that I have about 6-8 enemies on stage, some of them moving some of them static and also I have the Hero who is shooting with three types of missiles at same time. So I get about 70-100 objects on stage at a time.
My question is, which algorithm to use for this type of problem, and which is the common practice? Also which is the most efficient?
I was thinking of implementing Quad trees but I read that thy can be slow, or I am wrong?
ps: Can I use Octal trees or they are strictly for 3D?
If you only have say, ten enemies and a hundred bullets or so I doubt any complex spatial structure will benefit you all that much. Checking every bullet against every enemy amounts to a thousand checks, and the gains in performance compared to maintaining a more complex structure is in my opinion too small.
Depending on how fast your game is, you could get away with checking for collisions every other frame (or even less often) instead of every frame. That’ll give you a nice 100% performance boost on your collision detection.
I recommend simply doing this: