I'm approaching you with a question, you might have ideas on what is wrong here or maybe you have seen this one before.
I recently picked up the SDK of one of my mods that I haven't touched from 2019 and recompiled the dlls and started the game. There are no errors or warnings during compile; however when I go in the game there is something bothering me.
When a player is killed the body does not align to the ground 100% of the times... In like 2 out of 3 times it does not actually.
Having in mind that I haven't touched any of the animation code... and having in mind that it worked before correctly (way back in 2019...) I think there's something wrong with the HL build provided on Steam. (Build 8684 from 2020).
I tested on another build I use for dedicated server Build 4554 from 2009 and the issue is not present...
Any thoughts on how to mitigate that would be really appreciated...
Try to increase death's animations' fps by 15-25%. AFAIR, that worked for me, when I was working on my abandoned multiplayer mod.
Добавлено 26-05-2021 в 22:26:
Also, you may reduce game fps with fps_max and fps_override cvars, and check animations at lower framerates.
Добавлено 26-05-2021 в 22:31:
Napoleon321 are you using models/player.mdl and models/player/modelname/modelname.mdl with identical animations? I mean animation's length in frames, fps and order in animations list.
Napoleon321 писал: you mean to modify the models/animations or to do a change in the code?
Try both ways. First and easier is pev->framerate for CBasePlayer. But I doubt it will help. Look for m_iRespawnFrames in player.cpp, also. It should be relevant to your problem.
if (pev->modelindex && (!m_fSequenceFinished) && (pev->deadflag == DEAD_DYING))
2
{
3
StudioFrameAdvance( );
4
5
m_iRespawnFrames++; // Note, these aren't necessarily real "frames", so behavior is dependent on # of client movement commands
6
if ( m_iRespawnFrames < 120 ) // Animations should be no longer than this
7
return;
8
}
In this case m_iRespawnFrames is fps-dependent value. You may multiple it by gpGlobals->frametime. Something like this:
C++ Source Code:
m_iRespawnFrames += 10 * gpGlobals->frametime;
Добавлено 26-05-2021 в 22:54:
Цитата:
Napoleon321 писал: why is Valve limiting us that way?
It's not a limit, it's a too often calling of PlayerDeathThink at high framerates. At fps 60 m_iRespawnFrames reaches the value 120 in two seconds. At fps 100 it reaches same value in 1.2 seconds. And et cetera.
Добавлено 26-05-2021 в 23:05:
Same code from ReGameDLL. There is no m_iRespawnFrames variable:
C++ Source Code:
if (pev->modelindex && !m_fSequenceFinished && pev->deadflag == DEAD_DYING)
{
StudioFrameAdvance();
return;
}
The switch is m_fSequenceFinished, not m_iRespawnFrames. As it should be, by the way.
Your snipped indeed fixed the issue; Still I'm wondering should I use it.. Normally any FPs above 125 or 144 was disallowed during AG tournaments; since it was allowing faster shooting, player spawn, gauss charge etc...