Problem solved!

This is neither a prediction issue NOR a duplicated animation issue. I was
right about it being a problem with the new HL2MP PlayerAnimState crap. Here
is the breakdown:

The introduction of the PlayerAnimState brings great changes to controlling
the animations on the player. The problem is it was thrown into an already
messy animation code that involves literally hundreds of calls to functions
in various levels of virtualization...

Regardless, at the end of the CHL2MPPlayerAnimState::DoAnimationEvent(...)
function there is a little present from Valve. That is to do the View Model
animation that corresponds to the third person anim! However, the problem
lies in the way Valve detects network variable changes, those pesky "Parity"
variables you might see around, specifically m_nResetEventsParity.

Let's backtrack a little, all weapons call their own viewmodel animations
with a function called SendWeaponAnim(...) which does exactly that and also
increments the m_nResetEventsParity.

Now the animation doesn't play twice because most weapon calls are in the
same frame and it doesn't send the m_nNewSequenceParity since the sequence
doesn't change. However, m_nResetEventsParity does get changed and it
royally messes everything up. Since the PlayerAnimState stuff is only
invoked client side it changes the event parity (sometimes) before the
server update changes it, which is why this is an intermittent problem.

THE SOLUTION:
The easiest fix, and by far the best, is to comment out the crap at the end
of DoAnimationEvent(...) because it is totally unneeded, the weapons take
care of their own view model animation!

COMMENT THIS OUT:
hl2mp_playeranimstate.cpp, in CHL2MPPlayerAnimState::DoAnimationEvent(...)

#ifdef CLIENT_DLL
    // Make the weapon play the animation as well
    if ( iGestureActivity != ACT_INVALID )
    {
        CBaseCombatWeapon *pWeapon = GetHL2MPPlayer()->GetActiveWeapon();
        if ( pWeapon )
        {
            pWeapon->EnsureCorrectRenderingModel();
            pWeapon->SendWeaponAnim( iGestureActivity );
            // Force animation events!
            pWeapon->ResetEventsParity();        // reset event parity so
the animation events will occur on the weapon.
            pWeapon->DoAnimationEvents( pWeapon->GetModelPtr() );
        }
    }
#endif

This is on the VDC Wiki as well under my new section SDK FIXES ;-)

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

Reply via email to