O'Reilly logo

Multiplayer Game Development with HTML5 by Rodrigo Silveira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

The focus of this chapter was to reduce the perceived latency between the authoritative server and the clients that it runs. We saw how client prediction can be used to give the player immediate feedback while the server determines the validity of a player's requested move and intent. We then looked at how to incorporate the lockstep method on the server so that all the clients are updated together, and every client can also deterministically reproduce the same world state that is calculated by the game server.

Finally, we looked at the two ways to correct a bad client prediction. The methods we implemented are teleportation and linear interpolation. Using these two error-correction methods allows us to show the player a close approximation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required