Also along the way of ideologick technical question regarding the transfer of movement of the ball? If I move your ball, pass to other players? the new coordinates of the ball? position + direction? what to do if you want to make the balls each player had a different speed? etc.
From the client to the server to transmit the direction of movement and speed.
From the server to the clients sending new coordinates, the direction of movement of all (!) moving objects and their speed.
\r
While from the server it will not come updated data about the positions on the playing field, the client tries to calculate them independently on the previously transmitted from the server data speeds and directions.
On the arrival of data on the new positions calculated by the client coordinates are corrected in case of discrepancies.
\r
It is worth considering that in some cases this can lead to sharp "spikes" moving objects on the map
because the network transmission possible delays.
\r
The advantages of this approach:
\r
\r- the complication of life of unscrupulous players trying to change a situation to bypass the rules. For example, to be transferred in the opposite corner of the playing field by sending the server a specially formed team. Quite common, by the way.
\r- the fight against desync display the playing field among different players.
\r
Cons:
\r
\r- network latency can lead to beautiful visuals
\r- the algorithm calculate the movement will have to implement on both the client and the server. And they should return identical results for identical input data.
\r