-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When a client sends a moving ship to a new location the client will see the ship stutter because of the network delay:
- For
RTT/2the ship continues straight on. - The packet arrives at the server. The server changes the ships direction and broadcasts that change.
- Clients: For
RTT/2the ship travels in the old direction. Server: ForRTT/2the ship travels in the new direction. - Packet with new location and direction arrives at the clients. Their location is now up to
RTT * velocityoff from where the ship should be - and the ship jumps.
Possible solutions:
- For the client issueing the command we could improve the stuttering by sending the ship locally to
location + RTT/2*velocity + RTT/2*expected_veloctiy_from_serverso that it'll arrive at the location that the server broadcasts when the broadcast arrives att=RTT. - The server could attach a timestamp of
now + max(client1_RTT, client2_RTT, ...)/2to the command and trigger the move of the ship when that time is reached. The clients do the same. That'll probably lead tolagexperience by the command issueing client as it'll take at leastRTTbefore the ship changes direction. In the current scenario the command is only issued with a delay ofRTT/2.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels