I\'m working on a 2D game that has a huge amount of dynamic entities. For fun\'s sake, let\'s call them soldiers, and let\'s say there are 50000 of them (which I just randomly t
For broad-phase collision detection, a spatial index like a quad-tree (since it's 2D) or a grid will do. I've linked to Metanet Software's tutorial before; it outlines a grid-based scheme. Of course, your game doesn't even need to use grids so extensively. Just store each actor in a hidden grid and collide it with objects in the same and neighboring cells.