I have a table hockey game for iphone and now i’m doing the multiplayer part of it. I decided that the iphone that starts the match is the server.
The physics are running on the server and on the client, so the client look keeps smooth e not ‘jumpy’, since its a really fast game.
The server sends constant messages to the client, so the client can adjust its position and velocity. The problem is that sometimes the client jumps back on position because of the delay.
I’ve done clock sync on the client and the server, so i can compensate the X and Y position, through the clock difference and the velocity the server sended. The problem is that its looks kind of jumpy. How can i synchronize this thing? I’ve been trying all sort of stuff but it doesn’t seen to work.
Thank you.
You’re describing a well-known problem with client/server game state synchronization. Quoting this article:
Have a look at that article, particularly the section titled “Client side prediction”.