2008年08月21日
Casualty+Dead Reckoning
Recently I came upon a paper called Influences of Network Latency and Packet Loss on Consistency in Networked Racing Game which analyzed a combination of both dead reckoning DR and something called delta casualty.
For those who haven’t heard about these concepts I will give you a brief overview of each.
Delta casualty means handling packets which are invalid or too late. One form of delta casualty is the bucket synchronization algorithm which I wrote about in a previous article.
Dead Reckoning is a state extrapolation algorithm. It’s basically taking the last few received packets and calculating a delta state (velocity, rotation, etc..) with which we can extrapolate a new state (position). The clients usually share one algorithm to keep consistency. Bandwidth is saved because the player only sends packets to the other clients when the extrapolated state differs by a certain threshold from the actual state. You can also read more about it here.
So why combine these too methods?
One problem with bucket synchronization is that packets which arrive over the delay limit are discarded. This causes a problem because the client has to wait for the next packet to arrive to update the positions of the proxies. Using DR we can alleviate this problem by extrapolating packets when we have to throw away a packet. Also dead reckoning helps us reduce the amount of data that we have to send to the other clients since we only send new packets when the extrapolated results differ from the actual results.
Also combining the two is to give you more consistent extrapolation results. Influences of Network Latency and Packet Loss on Consistency in Networked Racing Game describes a situation where two vehicles controlled by people of equal skill race each other. When racing head to head sometimes lag and latency cause the positioning of the cars to be incorrect. This is especially apparent when crossing the finish line. It’s possible that both clients may see themselves in first place when crossing the line but in actuality the proxy cars are using incorrect extrapolated positions. Incorrect positions occur because we are processing position data from different times and using that to extrapolate data. If we use bucket synchronization to process packets with timestamps that are close together we can reduce the problem and give DR more accurate input.
The sample program below combines the dead reckoning code which I imported from Takushima’s sample DR processing program and a modified version of my bucket synchronization program. Both the light red and green dots represent local clients on two compters which are moving at the same velocity. The darker red and green dots represent the proxies of those clients. The red graph displays the difference in X positions of the proxies. The more ups and downs in a graph mean more inconsistent results because their true positions should be equal. Sliding the network quality bar induces random latency and increases inconsistency.
If you want to see DR without casualty you can toggle it on and off by using the check box.
The time that the received packets are processed = delay synchronization + time the packet is created. Any packet that has a delay synchronization + time the packet is created > current time will be thrown away.
As always the source can be downloaded here.
Further reading
Here are some useful papers you can read up on
Influences of Network Latency and Packet Loss on Consistency in Networked Racing Game
Takahiro Yasui, Yutaka Ishibashi, Tomohito Ikedo
Department of Computer
Science and Engineering
Graduate School of
Engineering
Nagoya Institute of Technology
Mentioned in the Bucket Synchronization Article
Design and Evaluation of MiMaze, a Multi-player Game on the Internet
Laurent GAUTIER and Christophe DIOT
INRIA Sophia Antipolis (http://www.inria.fr/rodeo/)
Mentioned in the Dead Reckoning Article

Leave a Comment
Trackbacked