Closed Raptor007 closed 7 years ago
Probably around here somewhere: https://github.com/Raptor007/aq2-tng/blob/eed99469fb23a2756d9eaca4436bdad9061c423c/source/p_view.c#L1003
Actually I think this is the main reason this happens randomly, although it probably only matters with sv_fps because anim_framesync
isn't quite working as intended:
https://github.com/Raptor007/aq2-tng/blob/eed99469fb23a2756d9eaca4436bdad9061c423c/source/p_weapon.c#L2357
https://github.com/Raptor007/aq2-tng/blob/eed99469fb23a2756d9eaca4436bdad9061c423c/source/p_weapon.c#L2514
Skuller's openffa has no problems with animation at all, you might wanna peek at his openffa repository @ http://git.skuller.net/openffa/
I just checked it out, and the reason they don't have any animation issues is that their animations and Weapon_Think
are still restricted to 10fps via FRAMESYNC
: http://git.skuller.net/openffa/tree/p_client.c#n1900
So sv_fps
doesn't reduce the shot lag in OpenFFA like it does in TNG: https://github.com/Raptor007/aq2-tng/commit/3d81db187fbe9c0da418d6fc4d3565cb98e9d82c
To reduce lag with sv_fps
(#47 #48) I allowed animations and shooting to begin on any frame instead of the original FRAMESYNC
10fps, but I didn't synchronize them. I'm pretty sure this is what caused the player shooting animation to move too quickly.
When a weapon fires, it sets the animation frame to 1 before the first actual firing frame: https://github.com/Raptor007/aq2-tng/blob/12e0a2d09b406133804aadc9c942be16e74db2d7/source/p_weapon.c#L1746
This is because it expects G_SetClientFrame
to increment the animation during this frame:
https://github.com/Raptor007/aq2-tng/blob/12e0a2d09b406133804aadc9c942be16e74db2d7/source/p_view.c#L1025
But if it's not lined up with anim_framesync
that won't happen until a later frame:
https://github.com/Raptor007/aq2-tng/blob/12e0a2d09b406133804aadc9c942be16e74db2d7/source/p_view.c#L1011
This is most noticeable with full-auto. For example, with sv_fps 20
the weapon could be firing on odd frames but with animations being updated on even frames.
This should fix it: https://github.com/Raptor007/aq2-tng/commit/12e0a2d09b406133804aadc9c942be16e74db2d7
Please reopen this issue if I'm wrong and you see this bug again.
Seemingly randomly on sv_fps servers, it looks like the weapon is jiggling really fast when you view someone 3rd person who is firing full-auto MP5 or M4. My guess it that the animation state is being allowed to change too quickly when going to firing, possibly if they started shooting on a non-framesync frame.