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).
FrancescoBorzi commented 3 years ago

isn't this 1-19? Makrura Clacker is in Durotar:

https://classic.wowhead.com/npc=3103/makrura-clacker

wizzymore commented 3 years ago

Hi,

This behaviour is completely normal. It was even discussed on WoW Classic a while ago before launch and Blizzard released this in the "It's a feature not a bug" list here They are supposed to run faster than you so you can't catch them, and, this is even realistic as in real life you would run faster because of the adrenaline rush.

Also, what you are showing there is from retail, you can not compare retail with this in our current example.

I'll say it as blizzard said it, this is a feature, not a bug.

The-GhostRider commented 3 years ago

Hi,

This behaviour is completely normal. It was even discussed on WoW Classic a while ago before launch and Blizzard released this in the "It's a feature not a bug" list here They are supposed to run faster than you so you can't catch them, and, this is even realistic as in real life you would run faster because of the adrenaline rush.

Also, what you are showing there is from retail, you can not compare retail with this in our current example.

I'll say it as blizzard said it, this is a feature, not a bug.

@wizzymore Thank you so much for your feedback!

image

apav commented 3 years ago

Hi,

This behaviour is completely normal. It was even discussed on WoW Classic a while ago before launch and Blizzard released this in the "It's a feature not a bug" list here They are supposed to run faster than you so you can't catch them, and, this is even realistic as in real life you would run faster because of the adrenaline rush.

Also, what you are showing there is from retail, you can not compare retail with this in our current example.

I'll say it as blizzard said it, this is a feature, not a bug.

Are you sure by "feared" they don't mean spells and abilities that fear? I can only recall low health enemies hobbling away in WotLK. If they did actually run at full speed or even greater, I think I would remember dying many times and confined spaces like caves being this difficult due to not being able to kill them in time.

eTzmNcbkrng commented 3 years ago

Agree with @apav here, feared mobs/players have always run faster than normal (unless under the effects of movement slowing). I think there is a difference between feared and fleeing.
That also goes directly against the video source I provided from live servers at the time.

Here's a response to that comment showing they're also interpreting it as a Warlock's Fear: image

Edit: Noticed the video I mentioned is on ChromieCraft Issue, not here. https://www.youtube.com/watch?v=8dNMBWh2wxY

The-GhostRider commented 3 years ago

Agree with @apav here, feared mobs/players have always run faster than normal (unless under the effects of movement slowing). I think there is a difference between feared and fleeing. That also goes directly against the video source I provided from live servers at the time. Edit: Noticed the video I mentioned is on ChromieCraft Issue, not here - https://www.youtube.com/watch?v=8dNMBWh2wxY - 6:55 and 8:10.

Here's a response to that comment showing they're also interpreting it as a Warlock's Fear:

Idk, could be or might be that they say "Fear" as concept "In General" of Fear, so they are not referring to a specific mechanic, they are simply explaining that "Fear" is fear, and when you have "Fear", you run away. So they found it "superfluous" to specify..

But as i said: idk, so i'm not sure 100%.

The-GhostRider commented 3 years ago

I think there is a difference between feared and fleeing.

Among the definitions, I can't see "Walk"

image

T1ti commented 3 years ago

I personally tought it was also an issue a few weeks ago so I had tested it it looks fine on AC, I found that on Classic some mobs just run very fast like murlocs, some run slow I found the same patterns in AC

55Honey commented 3 years ago

How can a Classic reference outclass a 3.3.5 retail Video? I am Not convinced.

55Honey commented 3 years ago

First off, this is not the kind of language, that i expect from a discussion on this repo. If you think this is the way to go, i am pretty sure you're advised to read about our Code of conduct. @Branel

On topic, in the videos provided it is visible that the mobs use a walking animation while fleeing, not the run animation. This is not related to the frostbolt as far as i can tell. I'll be happily proven wrong. Just not by a classic source unrelated to that fact.

If the sources regarding mob health being related to run speed are right, there is still an issue, beacause as of now, they run at full speed even at 1%.

The-GhostRider commented 3 years ago

If the sources regarding mob health being related to run speed are right, there is still an issue, beacause as of now, they run at full speed even at 1%.

I agree, in this..

wizzymore commented 3 years ago

Guys, such a big topic regarding this minor stuff.

The logic of running away in wotlk. Less health slow movement speed More health bigger movement speed Movement speed boost affected by the base speed of npc as well, that's why murlocs are Usain Bolt. ( i am not totally sure that this logic is implementez 100% in our core, but yes, this is a correct behaviour )

Also, the mage in the video has frost armor.

About clasic and retail 3.3.5, you can compare vanill with tbc and 3.3.5 in 90% of cases in the old world. The major changes got done in Cataclysm.

The current behaviour is correct. Also, fear means both humanoids getting feared also the spell fear.

In conclusion, humanoids RUN away when low health, and this RUN is not the normal base speed that they come to you, is bigger.

55Honey commented 3 years ago

If the sources regarding mob health being related to run speed are right, there is still an issue, beacause as of now, they run at full speed even at 1%.

Can somebody please test if the behaviour for a handful of different, fleeing mobs is the same for 1% and 20% health?

Reading the comments, i assume we can either safely close this or edit the initial issue based on these results.

The-GhostRider commented 3 years ago

The HP percentage does not affect the speed in Flee

https://user-images.githubusercontent.com/1884642/115545828-2a1be080-a29c-11eb-866d-16a615b81ed1.mp4

FrancescoBorzi commented 3 years ago

Regardless of what my opinion is about the technical issue here, this project is about software development and there are some rules that everyone should always respect.

I don't want to see people talking about other people being ignorant, about using or not the brain, about how neurons work, etc... This is a space to discuss bugs, fixes and technical topics, always respecting other users even when they technically wrong about something.

General note for everyone: If you are not able to be polite with other users, then this is not a project for you.

T1ti commented 3 years ago

FYI, mobs walking at reduced speed doesn't only apply in fear/fleeing status Mobs also run slower in combat if they are low healh, it's a global mechanic and not related to fleeing at all.

The threshold at which they are moving slower is about 20% They progressively run slower based on how much hp they lost below 20%

I noticed that at 1% health it's rougly 50% speed So they lose about 2.5% speed per 1% hp below 20%

T1ti commented 3 years ago

source : me using the print movespeed script on classic image image image

I slowly hit him over time, look how its speed gets progressively slower (the top left value)

This creature starts at about 8.0 speed, it reaches about 4.7 when I put him very low, i think that theorycaly 0% health would be about 50% speed as I got some extremly low health mobs to about 45% reduced speed

T1ti commented 3 years ago

It works exactly the same in fleeing, I didn't notice any speed diffference than their intended speed when they were fleeing

FrancescoBorzi commented 3 years ago

what's the status of this?

Maxproz commented 3 years ago

If this is still an issue, could try doing a *= on the velocity based on the creatures current health in MoveSplineInit.cpp. I think the fleeing movement generator calls into it.

Can see an example on reducing the speed on searched assistance - line 108

YunataSavior commented 3 years ago

Okay, so I resubbed for TBC prepatch just to test this...

https://clips.twitch.tv/BadCrypticHumanDxCat-DjJXzmByCK1rF_8R

(This is on Burning Crusade Classic servers)

I took an old lvl 60 mage and got a Dark Iron Tunneler to 16% health, then it flees.

CONTRARY TO WHAT ALL YOU HAVE BEEN SAYING, it did neither of the two things it would do on AzerothCore/ChromieCraft.

  1. It flees in a random direction. NOT into the other mobs in the area.
  2. You can DEFINITELY RUN FASTER THAN THE FLEEING MOB, EVEN AT 16% health!!!

So I was right this whole entire time...

eTzmNcbkrng commented 3 years ago

~~I just tested the same NPC on ChromieCraft and it behaved exactly the same as in your video. Big OOOOOF, I wanted you to be right.~~

I reckon it's inconsistent.

EDIT: Spoke too soon, mobs flee at a faster pace if they are within range of friendlies. As evidenced by @YunataSavior's video, this was not the case in TBC.

This video was taken on AzerothCore rev. 40ed3a575ba4 https://www.youtube.com/watch?v=PCBBDFrYR-0

NPC I tested:

Dark Iron Dwarf attempts to run away in fear!
Player selected NPC
DB GUID: 11192, current GUID: 21995.
Faction: 54.
npcFlags: 0.
Entry: 1051.
DisplayID: 825 (Native: 825).
Level: 27.
EquipmentId: 1 (Original: 1).
Health (base): 800. (max): 800. (current): 132.
Unit Flags: 557056.
Unit Flags 2: 2048.
Dynamic Flags: 4.
Faction Template: 54.
SpawnTime: Full:5m Remain:0s
Loot: 1051 Pickpocket: 1051 Skinning: 0
InstanceID: 0
Phasemask: 1
Armor: 1078
Position: -2844.992188 -2856.754883 33.356915.
AIName: SmartAI ScriptName: 
MechanicImmuneMask: 0

Here's his speed if he flees outside of his allies range:

[16:55:27] 3.5024838447571
[16:55:27] 3.4829020500183
[16:55:28] 0
[16:55:28] 3.4817657470703
[16:55:28] 3.4817657470703
[16:55:28] 3.4817657470703
[16:55:29] 3.4841544628143
[16:55:29] 3.4841544628143
[16:55:29] 3.4841544628143
[16:55:29] 0
[16:55:30] 0
[16:55:30] 0
[16:55:30] 0
[16:55:31] 3.4818525314331
[16:55:31] 3.4818525314331
[16:55:31] 3.489898443222
[16:55:31] 3.489898443222
[16:55:32] 3.489898443222
[16:55:32] 3.489898443222
[16:55:32] 3.489898443222
[16:55:32] 3.489898443222
[16:55:32] 3.489898443222

Here's his speed if he flees within range of allies

[16:56:33] 8.0103225708008
[16:56:33] 8.0103225708008
[16:56:33] 8.0103225708008
[16:56:33] 8.0103225708008
[16:56:33] 8.0103225708008
[16:56:33] 8.0103225708008
[16:56:34] 8.0103225708008
[16:56:34] 8.0103225708008
[16:56:34] 8.0103225708008
[16:56:34] 8.0103225708008
T1ti commented 3 years ago

I did a lot of testing previously on classic, I wasn't able to find a consistent pattern if fleeing is random or toward allies, there seemed to be some randomness but I think when close to allies they will run to them(or at least more likely?)

And assaid above, fleeing works differently if they are running to an ally, so I expect there is two types of fleeing, fleeing to an ally(probably triggered by having an alled creature close), and normal fleeing

I think I have a further proof of this behavior because I'm pretty sure I remember murlocs to start "talking" and making sounds(mrrrglrlgrlgrr) when they reach allies, it looked like some scripted call for help

edit : after further testing on classic, creatures are still slwoer even when fleeing toward allies

T1ti commented 3 years ago

@eTzmNcbkrng the video is private btw

T1ti commented 3 years ago

after further testing on classic, creatures are still slower even when fleeing toward allies

and the directino in which they flee seems compeltely random regardless of distance to other creatures, but when they're nearby a creature WHILE FLEEING they seem to have a special behavior that make them run to the creature and trigger a call for help

T1ti commented 3 years ago

https://www.youtube.com/watch?v=4mWrvfQ9Xzc This video showcases the fleeing call for help, you can hear the murloc running to its ally and making a sound(proof that an event is happening)

They always make this sound whenever they reach an ally, and then the creatures aggro in a fairly large AOE, not just the one creature he ran to

T1ti commented 3 years ago

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

This video shows that even while running to an ally, the creature is still slowed (5.64 speed instead of 8.0)

T1ti commented 3 years ago

So TLDR how fleeing works on classic :

FrancescoBorzi commented 3 years ago

what's the status of this?

55Honey commented 3 years ago

So TLDR how fleeing works on classic :

  • Fleeing doesn't change the creature's speed at all, it should still have the same speed as if it was not fleeing
  • But currently AC is missing the low health speed reduction mechanic, which is about -2.5% reduced speed per 1% hp below 20%. This is probably the msot important point
  • If you FEAR a creature which doesn't have reduced move speed(above 20% hp) like with warlock's fear, the creature will run at full speed.
  • as a recap, fleeing state never affects the creature's speed, creature's speed is only affected by external factors like the low health speed reduction mechanic, or other slwos applied by players
  • Creatures seem to run to other creatures while fleeing if they get close to them, but the original fleeing direction seems completely random(my personal analysis). When they do this, they stop at the creature and trigger a call for help, after a small delay the creatures will aggro and the fleeing creature will stop fleeing exactly at the same time the new creatures aggro.
  • basically, fleeing movement is compeltely RNG, UNTIL they get close to another creature, then they should? run to it and do a call for help.(previous point)

The Status is, we're missing someone to code this behaviour. @FrancescoBorzi

FrancescoBorzi commented 3 years ago

So TLDR how fleeing works on classic :

  • Fleeing doesn't change the creature's speed at all, it should still have the same speed as if it was not fleeing
  • But currently AC is missing the low health speed reduction mechanic, which is about -2.5% reduced speed per 1% hp below 20%. This is probably the msot important point
  • If you FEAR a creature which doesn't have reduced move speed(above 20% hp) like with warlock's fear, the creature will run at full speed.
  • as a recap, fleeing state never affects the creature's speed, creature's speed is only affected by external factors like the low health speed reduction mechanic, or other slwos applied by players
  • Creatures seem to run to other creatures while fleeing if they get close to them, but the original fleeing direction seems completely random(my personal analysis). When they do this, they stop at the creature and trigger a call for help, after a small delay the creatures will aggro and the fleeing creature will stop fleeing exactly at the same time the new creatures aggro.
  • basically, fleeing movement is compeltely RNG, UNTIL they get close to another creature, then they should? run to it and do a call for help.(previous point)

The Status is, we're missing someone to code this behaviour. @FrancescoBorzi

ok, added 30$ bounty on it and edited the original issue by adding the outcome of the discussion.

UltraNix commented 3 years ago

So the only bug here is that low-health mechanic. I have a question regarding to it: what about other slor effects on mobs below 20%? E.g. if mob have 10% hp and frostbolt debuff, it means that mob's speed is reduced twice: by frostbolt and then by low-health mechanic?

T1ti commented 3 years ago

So the only bug here is that low-health mechanic. I have a question regarding to it: what about other slor effects on mobs below 20%? E.g. if mob have 10% hp and frostbolt debuff, it means that mob's speed is reduced twice: by frostbolt and then by low-health mechanic?

I guess it would work the same way as when a creature has multiple slows from players, I think only the most powerful works

UltraNix commented 3 years ago

Not all slow effects are exclusive to others. Please, test it on Classic.

T1ti commented 3 years ago

Perhaps we should make a separate issue with what is needed for clarity ? Like 1 issue specifically for the low health slow mechanic

This needs be adressed asap, fleeing is like the msot broken and anoying mechanic atm

T1ti commented 3 years ago

Also the title is wrong and outdated

55Honey commented 3 years ago

Can you suggest a new title @T1ti ? I think we're bound to this issue because of the Bounty and all the cross-links.

T1ti commented 3 years ago

The intended mechanic is 2.5% reduced speed per 1% health below 20%

T1ti commented 3 years ago

Precision : It's a global mechanic, it shouldn't apply only while fleeing it's just that the fleeing speed should be the same as if the npc wasn't fleeing, so all slows apply.

T1ti commented 3 years ago

and ti's below 20%, not 15%

T1ti commented 3 years ago

Ok I did further testing in AC to analsye how it currently works, as I only analysed classic befor, and some additional classic testing : in AC creatures currently don't ALWAYS flee toward allies, there is a range check it is just extremly large. from my tessting it seems to be about 40 yards. this deosn't happen in classic, they run in a random direction like in fear and they stop and do a call for help if they get close to another creature

### TLDR of the 3 main issues :

- There MIGHT be a short range check in Classic, from my experience if the creatures are very clsoe to each other (about 10 yards), they seem to always run to the creature, though this only matter when killing gray mob as this is shorter than the detection range... So the previous mechanic could be kept but reduced to like 10 yards from 40

T1ti commented 3 years ago

Should we open an issue for each ? currently the title is only about the first point

ratkosrb commented 3 years ago

There are two kinds of Fleeing. In Classic all mobs flee in random direction, while in TBC I noticed mobs running towards nearest ally. Don't know if its an universal change though.

T1ti commented 3 years ago

There are two kinds of Fleeing. In Classic all mobs flee in random direction, while in TBC I noticed mobs running towards nearest ally. Don't know if its an universal change though.

I was doing my testing on the TBC PTR with low lvl mobs. It deosn't seem different than classic

YunataSavior commented 3 years ago

There are two kinds of Fleeing. In Classic all mobs flee in random direction, while in TBC I noticed mobs running towards nearest ally. Don't know if its an universal change though.

By "TBC", are you referring to "outlands", or "TBC Classic"?

YunataSavior commented 3 years ago

https://youtu.be/HsnZpGBaGKo?t=90

The above video was taken from retail TBC classic in Outlands.

Look VERY carefully at the top-right. You'll see a friendly that's WELL WITHIN range of the peons that the player is fighting (in terms of the 40 yard check). A few seconds into combat, one of the peons runs away in fear. It does NOT run into its friendly!

I think by default, let's make it such that, for every mob type, they do not beeline their friendlies, UNLESS we can produce SOLID VIDEO EVIDENCE that the original behavior is indeed intentional on the real servers (on a case-by-case basis).

T1ti commented 3 years ago

I tested it a lot and unless the creature is extremly close, like within 5-10 yards it seems to always run in a random direction

patou01 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:

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

patou01 commented 3 years ago

Found some unclear code. I expect this is partly trying to do what we refer to in this issue. I will be checking a bit around to see if I can change it to work. image

Should this slow from hp stack with slow from auras? (eg frostbolt)

T1ti commented 3 years ago

Found some unclear code. I expect this is partly trying to do what we refer to in this issue. I will be checking a bit around to see if I can change it to work. image

Should this slow from hp stack with slow from auras? (eg frostbolt)

I already reported that AC is currently applying a speed reduction when the creature is searching for assistance but no ally is there to run to image