Suppose I am making a co-operative multiplayer music-based rhythm game -- two players, side by side, move their cursor/avatar left and right with their mouse and attempt to hit or dodge obstacles that are coming towards them.
The problem here is that if there is latency in the connection, say 200ms from player B, then by the time player A receives the movement from player B, it will have been too late -- the players' position on the track will be ahead of where it was when it was sent.
There is also a problem with running them in a sort of lockstep where the two players wait for each other to acknowledge their respective inputs -- the music must continue playing without delay on both players' clients, otherwise it will sound very choppy and the player actions might not line up well with the rhythm, which isn't what we want.
How can we deal with this latency?