Jump to content

Recommended Posts

  • Active Member

Hi everyone,

I’m facing a strange issue in the game:

When two characters are dueling, and one of them is about to die, if that character tries to cast a skill right before dying, the character dies instantly without playing the death animation. Normally, the character should fall down slowly, but in this case, that animation is completely skipped — it looks like the character just drops dead abruptly.

It doesn’t happen every time, but it seems to occur when the character presses a skill key very close to the moment of death.

What I’d Like to Know:

Do you think this issue is caused by the client side or the game/server side?

Could the animation be skipped because the skill casting and the death event happen at the same time?

If anyone has encountered this before or has an idea what might be causing it, I’d appreciate your input. Thanks in advance.

 

VIDEO: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif 

 

Edited by Metin2 Dev International
Core X - External 2 Internal

No advertising in signatures

Link to comment
https://metin2.dev/topic/33876-sudden-death-issue-death-animation-skipped/
Share on other sites

  • Active Member
25 minutes ago, ReFresh said:

GIF link doesn't work.

VIDEO: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

Edited by Metin2 Dev International
Core X - External 2 Internal

No advertising in signatures

  • Active+ Member

Adding a gif from the guy above:

Spoiler

.gif

I would like also know why this is happening. Looks like it's some problem with server and client sync.

Edited by ReFresh
  • Lmao 1

I'll be always helpful!  😉

  • Active+ Member

to figure out what is causing this issue, try adding a stack trace inside the SetPosition function;

void CHARACTER::SetPosition(int32_t pos)
{
    ...
    else if (pos == POS_DEAD)
    {
        sys_err("SetPosition(POS_DEAD) called for: %s", GetName());

        extern void ContinueOnFatalError();
        ContinueOnFatalError();

        SET_BIT(m_bAddChrState, ADD_CHARACTER_STATE_DEAD);
    }
    ...
}

If USE_STACKTRACE is not defined yet, make sure to add;
 

#define USE_STACKTRACE

And don't forget to link against the required library to use it;
 

-lexecinfo

once the error occurs, check the syserr log and post here with include the stack trace along with the functions that triggered this call

  • Premium
// ActorInstance.cpp -> void CActorInstance::Die()

void CActorInstance::Die()
{
	if (m_isRealDead)
		return;

	if (__IsMoveMotion() || __GetMotionType() == CRaceMotionData::TYPE_SKILL) // Clear the current motion if we are moving OR casting a skill
		Stop();
  
  [...]
}

 

This should fix the issue on the client, the animation should play now on the victim's screen.

 

Then, the character appearing and disappearing is probably because you have a check on server something like this:

		if (ch->IsPC() && ch->IsDead())
		{
			SPDLOG_WARN("MOVE: {} trying to move as dead", ch->GetName());

			ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
			ch->Stop();
			return;
		}

So, based on whatever you want to achieve, either remove or modify how you handle the "ghostmode" to fix the appearing/disappearing of the character

Edited by CORKY
  • Love 1
  • Active+ Member
1 hour ago, CORKY said:
// ActorInstance.cpp -> void CActorInstance::Die()

void CActorInstance::Die()
{
	if (m_isRealDead)
		return;

	if (__IsMoveMotion() || __GetMotionType() == CRaceMotionData::TYPE_SKILL) // Clear the current motion if we are moving OR casting a skill
		Stop();
  
  [...]
}

Are you using this fix on your server? I tested it but didn't see any difference. I think I may have found the main problem, though. Could the issue be because I'm using this?
https://metin2.dev/topic/27721-make-monsters-and-players-die-immediately/

I'll be always helpful!  😉

  • Premium
1 hour ago, ReFresh said:

Are you using this fix on your server? I tested it but didn't see any difference. I think I may have found the main problem, though. Could the issue be because I'm using this?
https://metin2.dev/topic/27721-make-monsters-and-players-die-immediately/

You'd have to remove those changes you did from that topic to see if it matters or not.

Related to the actual fix, I've tested the actual problem when I saw the topic. After the changes I've done, I couldn't replicate the issue anymore.

 

 

  • Good 1
  • Active+ Member

I can confirm that the following change didn't fix anything, at least for me. I can see no difference. Sometimes the death animation appears in the victim client window and in attacker not. Sometimes the death animation appears in the attacker client window and in the victim not. Other times, it also displays correctly on both clients. This behavior seems to be absolutely random, but I think it's because of latency between server & client. In the first window client send information to the server the victim is dead you should show death animation, but in the second victim window it sends the information later than in the attacker window, so the server will say the victim is already dead -> boom animation will be skipped.

You should test it when the attacker is hitting the victim and moving with the victim by attacking him and after few hits the victim will die and you should see the shit about we are talking. Also it can work on your local server with zero latency, but on server hosting it's different.

On 7/30/2025 at 3:42 PM, CORKY said:
// ActorInstance.cpp -> void CActorInstance::Die()

void CActorInstance::Die()
{
	if (m_isRealDead)
		return;

	if (__IsMoveMotion() || __GetMotionType() == CRaceMotionData::TYPE_SKILL) // Clear the current motion if we are moving OR casting a skill
		Stop();
  
  [...]
}
Edited by ReFresh

I'll be always helpful!  😉

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.