BIT Nurse - Networked Gameplay Programming Consultant

Movement Network Sync

Authoritative Server

The player presses forward, clients sends the direction it want to move in to the server, the server then moves the Server Player in that direction and then sends the new position to the client and proxy of the player that then move to that position.

Description of the Schematic Above
Movement Sync Including Client-Side Prediction

The player presses forward which makes iDir = Forward.

The client translates iDir into mDir and instantly moves forward while simultaneously sending iDir and its cPos to the server.

The server calculates the direction between the sPos and cPos to get cDir.

The server takes the middle point between iDir and cDir to get mDir to make the server strive to stay as close to the clients position as possible.

The server calculates the movement speed it ends up with and checks for illegal movement, clipping and collisions and then moves the player.

The server then sends the new sPos to the proxy and the client.

The proxy uses interpolation and extrapolation to make a smooth client-side prediction movement between sPos positions.

The client checks the distance between sPos and cPos, if it's too far the client will teleport to sPos.


Information about Client-Side Prediction, Interpolation and Extrapolation can be found via the link below.


Non-Authoritative Server

The player presses forward, the client stats to move forward and sends its new position to the server that both relays that information to the proxy and moves the server player to the specified position.

This leaves the game completely open for cheating and hacking by players, but in a non-competitive game or a coop game this does not matter as much as in a competitive PvP game where an authoritative design is to be prefered.