04-11-2007, 07:33 PM
Rezeyu Wrote:Couldn't you just control movement server side?
Optimally, you'd control it both. General rule of thumb is the physics / math of the server and client are as identical as possible, so they can both simulate together. When the user moves, the client first checks if it is okay, then when the server gets it, it verifies it is okay. Skipping the server check allows hacking but reduces server load, and skipping the client check results in the server receiving an excessive amount of movement requests.
Resolution, in this context, is just how accurate the timer is. For example, a millisecond resolution would look like:
1, 2, 3, 4, 5, 6...
While a 30-millisecond resolution would look like:
1, 1, 1, 4, 4, 4, 7, 7, 7, 10...
The reason I suggest again a lower-resolution timer is like I said above - the server and client should be replicating the physics as closely as possible. Lets say, for example, we have a platformer game with a nice physics engine. In the game, the user kicks a box, which falls off the cliff. If we had a lower resolution timer, we could end up skipping a few milliseconds worth of calculations since the timing would be rounded, and because the server and client are different computers, they will be rounded differently. The box could end up in two different positions or have two slightly different paths of flight. The server may end up seeing it smashing an ant, while the client sees it landing in front of the ant. But since the server saw it smash the ant, the client is told the ant is smashed, and the user is sitting there thinking, "wtf m8?".
I know Mirage has nothing as extensive as that, but its just to give an example of how badly it can mess things up. Another is movement. Client rounds up, sees its okay to move, sever sees it not being okay, rejects the packet, client moves anyways, the client is now offset by one tile. Of course, that can and should be fixed with a server-side check, but then the server still has to waste time and bandwidth on that extra packet that is just dropped.