ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.7k stars 1.99k forks source link

Predicted sequences problem. #447

Closed Mine228 closed 6 years ago

Mine228 commented 6 years ago

So I've been trying to make the hl2mp player animations nicely in sync with both client and the server by predicting them. After 'implementing' the SetAnimation code from CHL2MP_Player without errors into the client side of the class the system fires up but the client always has its m_nSequence set to 0 and I cant seem to find the reason for why its happening. The server seems to have normal sequence numbers but the client always outputs zeros when tested. The player model appears to be in the T-Pose most of the time but seems like its trying to correct itself towards some kind of animation, perhaps from the server value.

If anyone has any experience with this or perhaps some helpful info it would be appreciated.

azuisleet commented 6 years ago

The HL2MP implementation should actually be based on CMultiPlayerAnimState instead. The SetAnimation function is a red herring, as CMultiPlayerAnimState will reset the sequence anyway.

There's a quick overview on the wiki: https://developer.valvesoftware.com/wiki/M_PlayerAnimState

You can also diagnose issues with anim_showstate 1

Mine228 commented 6 years ago

Well I tried "implementing" CMultiPlayerAnimState but its giving me some errors: imgur.com/a/z3iF2 CBasePlayer for example seems to be declared inside this header file but it doesnt seem to want to recognise it along with some others. If you tried implementing this animstate did you run into the same problems?

Mine228 commented 6 years ago

Got it fixed based on code from Tony Sergi's hub page.

Closing