Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creature flee speed when "run-away" triggers is too fast! [25$] #21899

Open
icedragn43 opened this issue May 2, 2018 · 17 comments
Open

Creature flee speed when "run-away" triggers is too fast! [25$] #21899

icedragn43 opened this issue May 2, 2018 · 17 comments

Comments

@icedragn43
Copy link

icedragn43 commented May 2, 2018

Description: Creature flee speed when "run-away" triggers is too fast!

When fighting mobs that run away when under a certain health level, more often than not they run away at 100%+ full speed. Sometimes they "hobble"/walk away as intended, or do the running animation but look snared.

Current behaviour: Runs away at 100% speed

Mob runs away too quickly to rally nearby enemies for support.

Expected behaviour:

Mob speed should be closer to that of walking than full on sprinting AFAIK. This does not feel blizzlike.

Steps to reproduce the problem:

  1. Blackrock Sentry - 4065 (all blackrock), Redridge Mystic - 430 (all redridge gnolls).
  2. Fight mob until it triggers creature flee at X hp.
  3. Be annoyed that it's already out of your range and running away full speed pulling more mobs that do the same which exponentially grows as more start fleeing full speed in all directions. Die. Repeat.

Branch(es):

3.3.5

TC rev. hash/commit:

TrinityCore rev. 88130d8 2018-03-29 20:18:52 +0200 (3.3.5 branch) (Win64, R
elease, Static)
Using SSL version: OpenSSL 1.1.0h 27 Mar 2018 (library: OpenSSL 1.1.0g 2 Nov 2
017)
Using Boost version: 1.65.1
Using MySQL version: 5.6.39
Using CMake version: 3.11.0
Compiled on: Windows 10.0.16299
Automatic database updates are disabled for all databases!
Worldserver listening connections on port 8085
Realmlist (Realm Id: 1) configured in port 8085
VMAPs status: Enabled. LineOfSight: 1, getHeight: 1, indoorCheck: 1
MMAPs status: Enabled
maps directory located in data/maps. Total size: 252191207 bytes
vmaps directory located in data/vmaps. Total size: 588247501 bytes
mmaps directory located in data/mmaps. Total size: 2152621724 bytes
Using enUS DBC Locale as default. All available DBC locales: enUS
Using World DB: TDB 335.64

Operating system: Windows 10

*** Tried googling this issue and searching the issues on here, found nothing that seemed related. ***

@Killyana Killyana added the Invalid-Intended/WontFix/Blizzlike It's working properly, on blizzlike way, we don't go to fix it. label May 2, 2018
@Killyana
Copy link
Member

Killyana commented May 2, 2018

Npcs have only 2 speeds, walking speed and run speed, on '%s attempts to run away in fear' they run.

@Killyana Killyana closed this as completed May 2, 2018
@Riztazz
Copy link
Contributor

Riztazz commented May 2, 2018

This is still valid issue, they should run but be slowed by 33%, current implementation sets the speed properly to 66% but before the movement is initialized it resets back to default value in one of the functions, iirc it was CombatStop or attackStop

@Killyana
Copy link
Member

Killyana commented May 2, 2018

Could you link the code where the speed is changed?

@Riztazz
Copy link
Contributor

Riztazz commented May 2, 2018

https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Movement/MotionMaster.cpp#L627 this gets called which does this:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Unit/Unit.cpp#L5573 and before actual movement is initialized, it doesnt have reduced speed

Edit: Speed reduction is in UpdateSpeed function in unit.cpp
edit2: in here https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Unit/Unit.cpp#L8537

@Killyana Killyana reopened this May 2, 2018
@Killyana Killyana added Comp-Core Sub-Movement and removed Invalid-Intended/WontFix/Blizzlike It's working properly, on blizzlike way, we don't go to fix it. labels May 2, 2018
@Killyana
Copy link
Member

Killyana commented May 2, 2018

@ccrs could you take a look to this?

@Riztazz
Copy link
Contributor

Riztazz commented May 2, 2018

Broken since forever, not related to ccrs commits, i think it was one of treeston changes to AttackStop but i could be wrong

@Treeston
Copy link
Member

Treeston commented May 7, 2018

UpdateSpeed properly sets the reduced speed, movegen does not honor it. Not going to address this until after #21888.

@Treeston Treeston removed their assignment May 7, 2018
@Riztazz
Copy link
Contributor

Riztazz commented May 7, 2018

It does honor it, logic is messed up in AttackStop which is called just before distract generators are called which brings old movement speed :P

@Aokromes Aokromes changed the title Creature flee speed when "run-away" triggers is too fast! Creature flee speed when "run-away" triggers is too fast! [10$] Jun 14, 2019
@Aokromes
Copy link
Member

10$ bounty added.

@Jinnaix
Copy link
Contributor

Jinnaix commented Jun 15, 2019

@Riztazz - to give you an update
i applied your code that you gave me in irc yesterday.
It didn't make any difference - creatures still run at 100% speed.

@Aokromes Aokromes changed the title Creature flee speed when "run-away" triggers is too fast! [10$] Creature flee speed when "run-away" triggers is too fast! [25$] Nov 7, 2019
ryancheung added a commit to ryancheung/TrinityCore that referenced this issue Dec 22, 2019
ryancheung added a commit to ryancheung/TrinityCore that referenced this issue Dec 22, 2019
ryancheung added a commit to ryancheung/TrinityCore that referenced this issue Dec 22, 2019
@jackpoz
Copy link
Member

jackpoz commented Dec 22, 2019

@Riztazz how about something like jackpoz@b931fc9 ?

@Killyana
Copy link
Member

Killyana commented Dec 22, 2019

I noticed for some spawns when they flee they doesn't have the UNIT_FLAG_FLEEING
For example:
1st case:
.go c 7514 (aggro the pack of three)
.dam 350 the mystic to trigger the fleeing then .npc info
result:

  • UNIT_FLAG_IN_COMBAT (0x80000)
  • UNIT_FLAG_FLEEING (0x800000)

2nd case:
.go c 28334 (aggro the npc)
.dam 350 the mystic to trigger the fleeing then .npc info
result:

  • UNIT_FLAG_IN_COMBAT (0x80000)

The npc get UNIT_FLAG_FLEEING (0x800000) only if there's no npc around to call for help, if there's a friendly npc that could be call for help the fleeing npc will not get UNIT_FLAG_FLEEING

@Killyana
Copy link
Member

@jackpoz I removed this line: https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/game/Entities/Unit/Unit.cpp#L5580 and the issue get fixed for npcs that doesn't stop movement to cast spells like npc Entry: 430 (For this casters if they are not in chasing mode they will use the correct fleeing speed, otherwise the speed will not be reduced)

@jackpoz
Copy link
Member

jackpoz commented Dec 23, 2019

I opened a PR at #23997

@jackpoz
Copy link
Member

jackpoz commented Dec 27, 2019

862d473 fixed one of the many issues related to fleeing and searching for assistance

@Killyana
Copy link
Member

Killyana commented Dec 27, 2019

Remaining issues:

Killyana referenced this issue Dec 30, 2019
Fix AssistanceMovementGenerator using 100% MOVE_RUN speed instead of 66% . Please note that the fleeing mechanic still has some open issues that this single commit doesn't fix
@Teppic1
Copy link
Contributor

Teppic1 commented Dec 31, 2019

I was under the impression that the speed reduction was dependent on the health of the npc, so that if they're hit after they begin fleeing at ~15% they will slow down further. That's based on research from someone else though so I've got no videos to back it up with.

xvwyh referenced this issue Jan 5, 2020
* Core/Movement: Fix fleeing speed to 66% run speed

Fix fleeing speed to 66% run speed until the creature starts returning home

* Fix build

* Don't check speed type

* Don't apply speed reduction twice

* Fix no-pch (1st try)

* Make sure every spell focus is interrupted when seeking assistance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants