Jason 'Ikkyo' Gripp wrote:

Client-side weapon prediction jumps around in time to re-predict
miss-predictions when the client receives more accurate information from the
server.  Hence, an attack function can be called multiple times for the same
attack.  However, the animations and sounds still aren't played multiple
times.

To achieve for this, there is a variable called g_runfuncs. g_runfuncs is
only true the first time an attack is predicted.  The client looks at
g_runfuncs before it decides to actually play an event.  If false, then no
effects.  The weapon data will still be updated when g_runfuncs is false,
but there should be no visible effects played.  HUD_TxferPredictionData is
the glue that hold the data persistence together, it transfers the data from
one predicted frame to the next.  The engine stores multiple frame in memory
just incase if figures out something is wrong and has to go back a couple
frame to correct a mistake.  During these corrections, g_runfuncs is set to
false so weapons don't re-fire, etc.
Indeed this is a better way to detect another additional prediction
frame. Just check for g_runfuncs. And i saw the checks for g_runfuncs in
a few functions now, thats the reason there's no more than one event in
one prediction frame.

I've tried to make sense, if something is still confusing feel free to ask
more questions.
You made a few things clear to me, but there's one remaining question:
Theses subsequent calls of PrimaryAttack() cause multiple bullets to be
fired. You won't see them, cos the "real" bullet with the decal etc. is
fired within the event function (which is called once), but
m_pPlayer->FireBulletsPlayer() is called multiple times for one server
side shot, and that leads to differing seed random numbers, or am i
wrong? So server and client side randoms won't fit the next time?
Doesn't that lead to ghost bullets?

Rockefeller


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



Reply via email to