[quote name='smasherprog' timestamp='1314370289' post='4854076']
Cool. I actually continued to add more to the post above. I have this bad habit of thinking of things after I make a post then adding to the post. I think I did that like 3 times for this one
I do the same thing, ha Just read the rest of it, I have one follow up question though:
So I get that the client time (that is somewhat in sync in with the server) is used when we receive events from the server, but how is it used? To sort the events in the right order? Or is it just used to make better predictions (possibly correct our earlier predictions) ?
[/quote]
Well, yes to both questions. You need to be able to adjust things based on when they occured. For example, you are running in a world and receive a small lag spike for one second where you lose all information sent to you. Once you start receiving all the missed information, you will get things like, player A shot a gun 1020 ms ago and player B started running 1040 ms ago. So now the question becomes, what do you do with this information? The standard way is to play those events, but at a fast speed to catch up to where they should be now. So, all the animations, players speed -- everything runs at for example 3x speed. So, it will take about 300 ms to get events up to where they should be. Its like fast forward on VCRs ( you might not remember them, but I am old enough to!). So, you can use the timestamp to say, " wow, we are 1 second behind the server. I better play this animation really fast to catch up, otherwise I never will." If you are 50ms behind the server, your guess will be very close to exact ( should be very small, like .1 or .2 units max error) on where players are located so you can make small adjustments to a players position over time to correct their positions without speeding anything up.
But the client is synced so that the client can know what to do about information that is received late. You are always going to receive events that have already occurred. The syncing will help you know what type of measures you need to do in order to keep the client running correctly whether it is small adjustments (not noticeable because it is moving a player .1 units over 300 ms) or if the client is lagging badly, running everything at a faster than normal speed to catch up.