Original Post
Assume latency of 50ms. 1. Player presses key and begins to move. Keys are sent to server. Server moves the player, 50ms too late. Server is 50ms behind. Server sends other players the position and velocity of moving player. This takes another 50 ms. Other players see moving player 100ms in the past. Moving player stops. Sends stop to server. Server gets message 50ms later and stops player. Player on server stops at the right place (in theory at least). Server sends stop message to other players. They receive the message 50ms later, which is 100ms after the moving player stopped. This also works out. Player stops at correct position on other players screen (in theory). 2. player moves. Keys are sent to server. Server know that latency is 50ms and moves the player for 50ms worth of movement(prediction) and sends position and velocity to other players. Other players know that latency is 50 ms and predicts how far player would have moved in that time frame. So Everywhere moving player is at the right position. This is great..BUT. Now player stops. Keys are sent to server. Server knows that latency is 50ms so he must move player back a little. Calculated position and velocity is sent to other players. Other players know that latency to server is 50ms, and they also know that for the message to go from moving player to server first is another 50ms. So 100ms in all. Moving player(now stopped) is moved back ALOT. So which method is more widely used today? I believe Delta Force Landwarrior used method 1. I talked to an experienced DFLW player and he had to aim taking the latency into account. So other players must have been in the "past" on his screen. I have tried to implement method two which is what I assumed new games use. Problem is, when I turn the spaceship and suddenly stop, then it must be counter rotated a little on the other clients because it takes a while for the stop message to reach them and this look really bad. The problem with method one is of course that you have to aim in front of moving targets (more than the time for bullet to arrive at target). But at least the movement looks good.