What's new

Welcome to HvH Forum!

SignUp Now! Download Free HvH CS:GO Cheats, CFG, LUA/JS Scripts, And More!


SignUp Now!

Source Code Onetap v2 animation layer resolver (spoonfeed / paste ready)

Moderator
User ID
1097
Messages
77
Reactions
357
Level
58
I've seen this resolver posted all over yougame with users claiming it to be selfcode, it being from gamesense or just completely butchered code.
As far as I know onetap v3 does not have this animlayer resolver mode for moving players, the reason for this is unknown but it might be due to sharklaser joining the devteam (he has called animlayers useless for resolving on UC)

The following is code reconstructed from the onetap v2 pseudocode. Although you need a couple prerequesites for this to work properly:
- Backtrack / lagcomp system to get last tick
- Reanimated animlayers for the m_flFootYaw +60 and -60 (read more: )
- store side since updates to these are very scare in current ver

C++:
        //Inside of your animation fix (framestagenotify hook)
        if ( record->m_pEntity->m_vecVelocity ( ).length_2d ( ) <= 0.1 /* You could figure this out by using animation weight instead of using client side interpolated data from sourcengine but onetap be onetap xd */ ) {
            //player is standing, do your standing resolver routine, OTV2's routine:
            float difference = AngleDiff ( eyeYaw, record->animstate->m_flFootYaw );
            desyncSide = 2 * difference <= 0.0f ? 1 : -1;
        }
        else
        {
            //player is moving
            //check if we have a previous record stored we can compare to, if we are currently running animations related to body lean and check if the movement speed (movement layer playback rate) of both records match
            if ( previousrecord && !( ( int ) record->animationLayers [ ANIMATION_LAYER_LEAN ].weight * 1000.f ) && ( ( int ) record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].weight * 1000.f ) == ( ( int ) previousrecord->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].weight * 1000.f ) ) {

                //We can get data from the animation layers, continue.

                auto processedAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->processedLayer [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer
                auto positiveAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->lerpedLayerPositive [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer w/ m_flFootYaw lerped with positive delta
                auto negativeAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->lerpedLayerNegative [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer w/ m_flFootYaw lerped with negative delta


                if ( processedAnimationSpeed < positiveAnimationSpeed || negativeAnimationSpeed <= positiveAnimationSpeed || ( signed int ) ( float ) ( positiveAnimationSpeed * 1000.0 ) )
                {
                    if ( processedAnimationSpeed >= negativeAnimationSpeed && positiveAnimationSpeed > negativeAnimationSpeed && !( signed int ) ( float ) ( negativeAnimationSpeed * 1000.0 ) )
                    {
                        // Success, record is desyncing towards positive yaw
                        desyncSide = 1;
                    }
                }
                else
                {
                    // record is desyncing towards negative yaw
                    desyncSide = -1;
                }
            }
        }
 
Last edited:
New member
User ID
5861
Messages
2
Reactions
0
Level
0
can you spoonfeed this into lw v3 im too retarded lmao, ty
 
quantumware
Moderator
User ID
4
Messages
29
Reactions
318
Level
44
I've seen this resolver posted all over yougame with users claiming it to be selfcode, it being from gamesense or just completely butchered code.
As far as I know onetap v3 does not have this animlayer resolver mode for moving players, the reason for this is unknown but it might be due to sharklaser joining the devteam (he has called animlayers useless for resolving on UC)

The following is code reconstructed from the onetap v2 pseudocode. Although you need a couple prerequesites for this to work properly:
- Backtrack / lagcomp system to get last tick
- Reanimated animlayers for the m_flFootYaw +60 and -60 (read more: )
- store side since updates to these are very scare in current ver

C++:
        //Inside of your animation fix (framestagenotify hook)
        if ( record->m_pEntity->m_vecVelocity ( ).length_2d ( ) <= 0.1 /* You could figure this out by using animation weight instead of using client side interpolated data from sourcengine but onetap be onetap xd */ ) {
            //player is standing, do your standing resolver routine, OTV2's routine:
            float difference = AngleDiff ( eyeYaw, record->animstate->m_flFootYaw );
            desyncSide = 2 * difference <= 0.0f ? 1 : -1;
        }
        else
        {
            //player is moving
            //check if we have a previous record stored we can compare to, if we are currently running animations related to body lean and check if the movement speed (movement layer playback rate) of both records match
            if ( previousrecord && !( ( int ) record->animationLayers [ ANIMATION_LAYER_LEAN ].weight * 1000.f ) && ( ( int ) record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].weight * 1000.f ) == ( ( int ) previousrecord->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].weight * 1000.f ) ) {

                //We can get data from the animation layers, continue.

                auto processedAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->processedLayer [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer
                auto positiveAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->lerpedLayerPositive [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer w/ m_flFootYaw lerped with positive delta
                auto negativeAnimationSpeed = abs ( record->animationLayers [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate - record->lerpedLayerNegative [ ANIMATION_LAYER_MOVEMENT_MOVE ].fPlaybackRate ); // <-- compare networked layer to processed layer w/ m_flFootYaw lerped with negative delta


                if ( processedAnimationSpeed < positiveAnimationSpeed || negativeAnimationSpeed <= positiveAnimationSpeed || ( signed int ) ( float ) ( positiveAnimationSpeed * 1000.0 ) )
                {
                    if ( processedAnimationSpeed >= negativeAnimationSpeed && positiveAnimationSpeed > negativeAnimationSpeed && !( signed int ) ( float ) ( negativeAnimationSpeed * 1000.0 ) )
                    {
                        // Success, record is desyncing towards positive yaw
                        desyncSide = 1;
                    }
                }
                else
                {
                    // record is desyncing towards negative yaw
                    desyncSide = -1;
                }
            }
        }
definition for processedLayer, lerpedLayerPositive, lerpedLayerNegative?
 
Moderator
User ID
1097
Messages
77
Reactions
357
Level
58
definition for processedLayer, lerpedLayerPositive, lerpedLayerNegative?
How to generate the desired layers is an exercise left to the reader. All information required is here.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Top