Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

Animations with sv_fps #86

Closed Raptor007 closed 4 years ago

Raptor007 commented 4 years ago

Anything that changes ent->s.frame should also update ent->client->anim_framesync to ensure animations don't advance too quickly to their second frame at higher server framerates.

This could probably be solved with a new function replacing all raw animation changes:

void SetAnimation( edict_t *ent, int frame, int anim_end, int anim_priority )
{
    ent->s.frame = frame;
    ent->client->anim_end = anim_end;
    ent->client->anim_priority = anim_priority;
    ent->client->anim_framesync = level.framenum % game.framediv;
}
Raptor007 commented 4 years ago

Might also be useful to change anim_framesync to anim_started and use it to prevent people from switching back and forth from crouch to stand faster than 10 times per second.

Raptor007 commented 4 years ago

I think this should do the trick: https://github.com/Raptor007/aq2-tng/commit/e5a7bb7f62c127907ef1cadfd6b4bafa9a0b1d11

m4son commented 4 years ago

I tried spamming spacebar (jump) while holding crouch and animation played back nicely at low 10 frame rate with a sv_fps 60