Thoughts on Client-side prediction

The client-side prediction in our game is pretty good at the moment, previously I didn’t have any smoothing for correcting the rotation but merely snapped it to the value. This did lead to a pretty annoying jitter for the clients, with smoothing it is much less of a problem. Another thing I’ve started looking into is what the clients can simulate to improve their predictions. Since we make use of “Hollywood physics” where the resulting energy of a collision is somewhat bigger than it should be ( for player-on-player collisions we double the energy ), previously only the server did this and as a result the clients prediction could fall off. In hindsight there really was no good reason to keep this server side only, so now the clients run it as well. I’m will do a check to see if there is any similar stuff elsewhere in the code.

One thing I have been thinking about is the necessity to store and replay the input, what the input does is mainly alter the rotation or velocity in some manner. One could simply save these changes instead, but I guess an update from the server about your state some time back could alter what the input would do. For example maybe you can’t jump because of some debuff.

And then there is the latency, so far it has mainly been used in a LAN environment. We did make a small test with Unity’s network emulation set to dial-up which means a bunch of added latency and dropped packets, and things worked but the test wasn’t very scientific to say the least. More thorough testing will be required before releasing the game into the wild.

Til next time

Be Sociable, Share!