I'm trying to get my head around the synchronization of curtime between
and server.  First, a few comments, from globalvars_base.h:

// Current time
//
// On the client, this (along with tickcount) takes a different meaning
// based on what piece of code you're in:
//
//   - While receiving network packets (like in PreDataUpdate/
//     PostDataUpdate and proxies), this is set to the SERVER TICKCOUNT
//     for that packet. There is no interval between the server ticks.
//     [server_current_Tick * tick_interval]
//
//   - While rendering, this is the exact client clock
//     [(client_current_tick + interpolation_amount) * tick_interval]
//
//   - During prediction, this is based on the client's current tick:
//     [client_current_tick * tick_interval]

So, as I understand it client-side, in PreDataUpdate/PostDataUpdate (and
perhaps OnDataChanged as well?) gpGlobals->curtime is set to what
gpGlobals->curtime was on the server when this particular data update
was stuffed into the pipeline.

When rendering, though, what is the curtime?  As I see it, there are two
possibilities:

        The client's current tick tries to sync with what it thinks the
        server's current tick is.  Thus, in a perfect situation, if the
        server is at tick 12, the client's tick is at 12, even if the
        last packet received was stamped with a tickcount of 9.

        The client's current tick is only barely ahead of its last
        received tick.  If the server is at tick 12, but the client's
        last received packet is at tick 9, then the client will be
        rendering at somewhere between tick 9 and 10 (subject to
        interpolation_amount above).

Which one of these is true?  And which one of the three "different
meanings of curtime" is used during entity thinking and IGameSystem
updating?  (I suspect the render one, but I can't be sure.)

-John Sheu

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to