azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.54k stars 2.62k forks source link

[Fleeing for Assist]: NPCs on Low HP need 1.666% reduced speed per 1% health below 30% HP [$30] #5342

Closed The-GhostRider closed 2 years ago

The-GhostRider commented 3 years ago

EDITED: to add the outcome of the discussion here, provided by @T1ti

So TLDR how fleeing works on classic :


Originally reported https://github.com/chromiecraft/chromiecraft/issues/183

ISSUE: FACTION SIDE:

BOTH

CONTENT PHASE:

ALL

SMALL DESCRIPTION:

Half the times, when you're fighting a humanoid mob that will flee at low health, once they reach the threshold, they will IMMEDIATELY take off at a very high speed, even faster than regular running, towards an enemy pack. Once they get anywhere near another mob, they will INSTANTLY pull the mob.

This is blatantly wrong, even by Classic standards.

This is really frustrating and punishing to deal with. Sure, you can say "just save your burst for when they get really low", but that's not a luxury that can always be afforded, especially by certain classes. And when that happens: death.

EXPECTED BLIZZLIKE BEHAVIOUR:

https://www.youtube.com/watch?v=CuvYOo1jG1k

I don't think ALL the mobs are supposed to run at ludicrous speeds. Even for the ones that do, they seem way too fast.

What's 100% wrong is that the mobs pull way too quickly once they get to other mobs. If you're ranged, the fleeing mob can get into kissing range with the non-pulled mob, and you can still kill the fleeing mob without the other pulling. Here, not quite...

CURRENT BEHAVIOUR:

See "Small Description".

STEPS TO REPRODUCE THE PROBLEM:

Watch the video I linked above, then recreate it using a Paladin at-level with leveling gear. Notice how you get destroyed by the mobs in the cave.

AC HASH/COMMIT:

https://github.com/chromiecraft/azerothcore-wotlk/commit/6a7155eb7e82309ac34a38eec65eb7663b0605a0

OPERATING SYSTEM:

Ubuntu 20.04

MODULES:
OTHER CUSTOMIZATIONS:

None.

SERVER:

ChromieCraft

--- There is a **[$30 open bounty](https://www.bountysource.com/issues/97911246-fleeing-for-assist-npcs-on-low-hp-need-2-5-reduced-speed-per-1-health-below-20-hp?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github)** on this issue. Add to the bounty at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40032087&utm_medium=issues&utm_source=github).
T1ti commented 3 years ago

@T1ti This is not fixed as far as I understand. Are we confident in "2.5% per 1% missing hp"? In the video you linked: the creature is still slowed (5.64 speed instead of 8.0) 5.64/8 = 0.7, so it was slowed 30% for 7% hp under 20%. ie 1% = 30/7 = 4.2% per hp? I recall mobs becoming extremely slow at a few percents, but at the same time, I think they lose speed more progressively than a cut-off at 20%.

I have a somewhat working piece of code, but need the following info:

  • does this apply to all mobs, or are there known exceptions (bosses? I think they used to slow down as well)
  • Is the formula of 2.5% per % below 20% correct? My understanding is that this formula would give a speed reduction of 17.5% (2.5*7, as he has 13% hp) on the murloc you showed, however we are seeing almost double that.
  • when the same mob is healed, should he turn back to his normal speed? (my memories from official wow is yes)

Then I will need to evaluate what happens when slows are stacked, to confirm I didn't make a hack.

Update, I did additional testing on TBC classic and it is below 30%, not 20%...

The reduction seems to be 1.666...%(2.5/1.5) per level. this value is basically. 50(assuming 50% reduced hp at 0% health) / 30(levels) = 50 / 30 = 2.5/1.5(simplified).

image

My formula seems to match pretty well the values measured on classic. Note that speed varies quite a lot on classic(by up to 5%ish), based on if they are turning, using animations etc so it is hard to get perfect values,but the values measured match my formula very well, it is linear.

55Honey commented 3 years ago

Thanks T1ti, i'm updating the title based on your findings.

patou01 commented 3 years ago

So I have a way of doing this, however it might increase the server load a decent amount (scaling linearly with the amount of mobs engaged on the server), so that could be a concern. (probably a non-issue actually on further thought).

Currently my solution would be to modify the Unit::update() function to call UpdateSpeed() and withing UpdateSpeed add a few lines to compute the necessary slow. However I would like to get some input from a more experienced dev before I make a PR. Anyone know who I could discuss this with? @55Honey maybe you know this ? Or is the process to "just throw a PR and if we think the idea is wrong we refuse it" ?

I am not sure if this slow should stack however, mobs hit by a frostbolt at 5% hp seem to become extremely slow, if you have the possibility, @T1ti do you mind checking that?

https://drive.google.com/file/d/13bjOIbnYuGEbbXED5n3Uq9cF3Nx8TqOE/view?usp=sharing Here's an example of my current behaviour, it's definitely not ideal to review it this way but I think that gives an idea?

T1ti commented 3 years ago

perhaps trigger the slow on creature hp changed

btw I suspect that on classic it's like 1.66% per 1% health lost, imo it is progressive in digits and they do the exact math calculation, like if at 14.54% hp :8 - ( 30 - 14.54) * ...

T1ti commented 3 years ago

image the slow does stack, here's a frostbolt. 2.77 at 7% hp

T1ti commented 3 years ago

the value looks very close to your video, your stacking formula is probably correct (3.2 at 9% with frostbolt)

patou01 commented 2 years ago

@T1ti, @Stifler82 I believe this issue is fully fixed isn't it?