HLFX.Ru Forum
Показать все 9 сообщений этой темы на одной странице

HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Wrong death animations? (https://hlfx.ru/forum/showthread.php?threadid=5663)


Отправлено Napoleon321 26-05-2021 в 14:09:

Question Wrong death animations?

Hello Team,

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...

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Отправлено Ku2zoff 26-05-2021 в 15:31:

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 26-05-2021 в 15:33:

Hello Ku2zoff! I was hoping that you'll reply to this one.

When you say to increase the death animation's fps by 15-25% you mean to modify the models/animations or to do a change in the code?

Edit: Okay.. That's really stupid.. why are they limiting us to 60 FPS?

I mean I just put cap on the fps to 60 with the override command as well and this was resolved... but... really Valve?

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Отправлено Ku2zoff 26-05-2021 в 15:39:

Цитата:
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.


Отправлено Napoleon321 26-05-2021 в 15:41:

The fps set to 60 fixed the issue.. but.. why is Valve limiting us that way?

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Отправлено Ku2zoff 26-05-2021 в 16:05:

I think, I found code that causes the problem:

C++ Source Code:
1
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.


Отправлено Napoleon321 26-05-2021 в 16:06:

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...

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Отправлено Ku2zoff 26-05-2021 в 16:07:

Цитата:
Napoleon321 писал:
I'm wondering should I use it..

Modify your code like in ReGameDLL, see my previous post.


Отправлено Napoleon321 26-05-2021 в 17:06:

Many thanks for this.

__________________
FlatLine Arena | Tutorials

If you don't like something, MOD it!


Временная зона GMT. Текущее время 08:03.
Показать все 9 сообщений этой темы на одной странице

На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024