Wednesday, October 7, 2015

networking - How does client-side prediction work?


I've read Valve + Gafferon and hundreds of pages from Google, but for whatever reason I can't get my head around client prediction.


To my understanding, the basic problem is:



  • Client A sends input at T0

  • Server receives input at T1

  • All clients receive the change at T2


At T2 however, using client prediction, Client A is now at a position appropriate to T4.



How do you ensure that the Client A, when predicting that the server will accept the movement request, won't be ahead of the server? Obviously all the time they are ahead, this results in snapping back to where the server last saw them. With all corrections I've tried, this is still noticeable when you stop, because the server stops behind you



Answer



I wrote a series of articles on this. It is based on the same ideas you've read elsewhere, but explained in a very detailed and (I hope) accessible way.


In particular, the article about the client-side prediction is this one.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...