# Efficient physics and collision detection for RTS

I'm thinking about writing my own RTS game and while I'm more or less clear about how the game engine should work, I need some directions as to how to implement physics and collision detection.

Now, I am an experienced programmer but I have never ever done game dev before, so please excuse me my poor/incorrect terminology.

There will be a large 3D (i.e. planes, hills, valley, etc) world with lots of units, moving and/or fighting simultaneously and lots of projectiles flying around. So the most important thing is, physics and collision computation must be very fast.

Could you please point me in the right direction? Idea I'm elaborating on is some kind of 3D tiles, with every unit's position being x,y index of tile + elevation (e.g unit staning on the hill or on the fortress wall). the smallest unit will occupy for examle one tile horizonally and 5 vertically. With every tile having 3x3x1 aspect ratio (e.g. 15x15 horizontally and 5 pixels height).

How realistic is this? How would you approach this? Are there any 3d physics/collision engines which are fast enough for such application?

• Is this game targeted at mobile consumers? Practically, the Bullet Physics Engine is good enough if you use it efficiently (no complicated physics meshes). Commented Jul 20, 2012 at 16:42
• No, it's for desktop computers (Windows, MacOS X, Linux). I read about Bullet, but it seems a bit of overkill? How efficient it will be with say 10000 units and yet more projectiles? Commented Jul 20, 2012 at 16:43
• @aleguna: In general, projectiles don't need collisions. A projectile, once fired, is going to hit its target. It's simply a matter of when it gets close enough. Commented Jul 20, 2012 at 17:13
• @NicolBolas That's up to him though, isn't it? If something else moves in front of the projectile, personally I would prefer the projectile to hit that instead of just passing through. aleguna: nvidia's physx SDK (binary, no source) is free for use on windows, linux, mac and ps3. It runs just fine on the CPU, some of the nvidia demos have ~40.000 debris particles colliding with a non-trivial ground and bouncing. So simple projectile collisions, if you use built-in optimized primitive collision shapes(say capsules for projectiles, boxes for units), should work fine on the CPU.
– user13213
Commented Jul 20, 2012 at 17:34