Edited to be nicer The following applies to multiplayer games only obviously. All "decision making" _MUST_ be done on the server, no matter what. You _CANNOT_ trust a client to perform any sensitive decision (since clients can be easily hacked no matter what crypto/security you use). Also, synch issues will cause clients to have slightly different copies of world data, thus leading to different outcomes from physics simulation. Imagine the scenario: player A and player B both try to pick up an item. Both think they succeed, since they model physics locally. Which is correct? This is why you must have a centralised authority. Think back to Diablo with it's peer to peer multiplayer, players could become invulnerable just by hacking their client to ignore "take damage" messages. It is true though that players will experience "local lag" when they try to move though. To get around this we implement some simple "client side prediction". I.e when the player presses "move forward", on the client we just move them forward straight away, without waiting for a confirmation from the server. This gives the player the illusion of lagfree movement. Then we can apply some interpolation between the "real" position the server sends, and the clients "lookahead" position. Maybe the client will have some rudimentary collision code to stop them moving through walls etc, but really very little physics is needed on the client. Indeed it simplifies the project a lot to completely move all simulation to the server, and focus on rendering and input for client. From the article linked above on Source network model: "Usually a server is a dedicated host that runs the game and is authoritative about world simulation, game rules, and player input processing." (my emphasis) (责任编辑:) |