I am creating a networked game and having issues with keeping positions synced between multiple clients.
Essentially what I have happening is one client's movement to replaying on another routed through as server. Every 10 steps taken on one client is then sent to the second to be replayed.
The issue is, the actual process of moving from beginning to end starts to fall behind on the second client. Initially I believed it to be a network issue, but on further inspection the packets are coming in fast enough. The player walking is also never delayed. I do have a fixed timestep set at 50 FPS. If I am moving from points A, B, C, D the distances are the same, the velocity is the same. The movement falls behind more and more the further time progresses.
Here is an example:
The red squares are the movement positions received from network, to be used by the client to replay the movement and interpolate. The player is currently in the progress of playing all of the positions received (right to left). This is an example taken about 30 seconds from start of movement. At the start the player keeps up, generally about 1 update behind. It never stops or stutters, velocity never changes, but yet it falls behind, very significantly. The issue continues until the player stops and it reaches the stopped position.
My question would be, why would this be happening? And is there a possible solution?
I've had an idea of artificially increasing the velocity of the entity to catch up, but it seems more of a copout and perhaps unrealistic for one client to see random accelerations.