I found that the code used to determine if it was within range of the attack was using the distance to all targets directly, rather than using the physics of collision detection. Is this common practice, or is the performance better than using collision detection directly?
Physics collision checking is often quite slow.
In a real game, you would probably have a custom geometric tree structure to do queries efficiently.
The RTS demo uses a simple quadratic loop. It does not scale well to lots of units.