Summary
In this chapter, we learned about the issues caused by lag, latency, and packet loss. Then, we saw how to fix them by implementing lag compensation techniques. We explored the concepts of interpolation, prediction, synchronization, and extrapolation to ensure smooth and responsive gameplay, even in the face of network delays.
First, we delved into interpolation, which is the core technique regarding lag compensation. Interpolation helps to fix some drawbacks of latency and sparse data updates by animating between two known values, while actual updates don’t arrive. This ensures that the Spaceship
node won’t idling, waiting for new updates from the network. It will smoothly move toward new data, instead of abruptly teleporting to it.
Then, we discussed prediction, which involves making informed guesses about an object’s future position, based on its past behavior. By using Newtonian physics calculations, we were able to calculate the spaceship’...