Hi, I'm working on a realtime multiplayer game.
I want to do movement prediction to compensate for network latency.
In order to do that, I need to know how much latency there is between players.
For instance, player 1 sends a message to player 2. How much time did it take for the message to be transmitted?
Player 2 could send back a response to player 1, and player 1 could know an approximation of the latency by
taking the total time and dividing by 2. That could be a good approximation or maybe not. If it takes more time
in one direction compared to the other, then that approximation is not good enough.
Are there other more accurate ways to estimate latency between players?
Thank you.
edit:
The game I'm working on is peer-to-peer, and some movement predictions will be accurate because some movements will follow a predefined sequence.
My game is a fighting game. Example of "easy-to-predict" movements: parabolic jump, throwing fireballs, special moves. That's why movement prediction will work well in some cases.