I'm reading this and going "Of course
, a set is an elegant solution to that problem!" Damn the programmer nerd in me. :D
Originally by: DefCon Blade
i don't get it, why cannot missile be simulated in client eviroment only?
Because this would open the game up to potential exploits, I believe.
Suppose I move much of the simulation structure to the client, letting it call the shots on the server to tell when the stuff has occurred. There exists the possibility that I could inject something malicious to cheat around things like the cooldown limits or the ammo count. If the game wants to protect itself against such cheats... it would have to do the required queries it does now anyway.
The other reason the server has to keep track of all missiles and ships together is for some more special situations such as defender missiles firing off, a target moving out of range during the missile's flight time, and a smartbomb or bomb going off (which, I think, can damage/destroy in-flight missiles but my memory's a little hazy on that.) Hence, it all boils down to the server being in control because it has the knowledge of all space objects so that it can calculate reactions correctly in a centralized manner rather than every client computing a reaction in its own way and getting mixed results out of it due to a who-is-right-who-is-wrong scenario (such as the dreaded situation in laggy FPS games where you ceaselessly shoot someone but he doesn't take any damage.) So, all the client does is yell "Missile bays one through four, FIRE
!" from time to time, and the server responds a while later with "It's a miss" or "Patrol boat sunk!"