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

[3.3.5] Strange NPC movement behavior #19998

Closed
Tauriella opened this issue Jul 6, 2017 · 43 comments
Closed

[3.3.5] Strange NPC movement behavior #19998

Tauriella opened this issue Jul 6, 2017 · 43 comments

Comments

@Tauriella
Copy link
Contributor

Strange behavior of NPC's
They go forward and back however without reason.

Steps to reproduce the problem:
Go to Shadowlabyrint and look

move

Branch(es):

CHANGEME 3.3.5

TC rev. hash/commit:

TrinityCore rev. 1f834d3 2017-07-06 21:39:46 +0200 (335 branch)

TDB version: TDB_full_world_335.63_2017_04_18 + updates

Operating system: Win7 64Bit

@Rushor
Copy link
Contributor

Rushor commented Jul 7, 2017

@Tauriella do you know if those creatures have waypoint or random movement and a creature formation?

@Killyana
Copy link
Member

Killyana commented Jul 7, 2017

It's related to the faction reaction, there's some other similar issues like: .go c 103784
I think this npcs must have monster sparring behavior.

@Tauriella
Copy link
Contributor Author

@Rushor the same issue on Hellfire Event the NPC's have 100% a waypoint the Master NPC move forward and backward just before the attack.

1 1

1 2

@ghost ghost changed the title Strange behavior of NPC's [3.3.5] [3.3.5] Strange NPC movement behavior Jul 7, 2017
@ghost ghost added the Branch-3.3.5a label Jul 7, 2017
@ghost
Copy link

ghost commented Jul 12, 2017

TrinityCore rev. 3f8c0cb 2017-07-11 12:52:53 +0200 (3.3.5 branch) (Win64, Release, Static)
Using World DB: TDB 335.63 + updates up to and including 2017_07_08_00_world.sql

I can confirm the scripted NPC behaviour in the Stair of Destiny (Dark Portal) event. It looks like the hostile group leader (Wrath Master) resets orientation, goes back a step or two with irregular intervals, then returns to original movement forward as scripted. (If you want to check more odd NPC movement behaviour, the event at Stair of Destiny is a fairly good spot for observation.)

@ghost
Copy link

ghost commented Jul 17, 2017

TrinityCore rev. d7919a9 2017-07-16 03:28:24 +0200 (3.3.5 branch) (Win64, Release, Static)
Using World DB: TDB 335.63 + updates up to and including 2017_07_16_00_world.sql

I found this issue present in the Horde escort quest Escorting Erland in Silverpine Forest,

as well as in some of the pathing low-level mobs (level 10-14) in the dead scar in Ghostlands.

@Magnifikator
Copy link
Contributor

Magnifikator commented Jul 30, 2017

This issue happens on several locations.
On NPCs with either waypoint paths or random waypoints. As far as I remind, there was some changes in movement generator in the past and it happens since that time.

Another example:
.go xyz -5815.62 -569.355 399.983 0
A leopard tries to attack a rabbit. Both have crazy movements.
Tested on d24ce17

@ghost
Copy link

ghost commented Jul 30, 2017

Like I mentioned in #14880 (comment) , there is a crazy loop going on between Scarlet mobs (Scarlet Invoker, Scarlet Medic and Scarlet Hound) at the Felstone Field farm building and the nearby undead scourge mobs. They are stuck in a loop of attacking and retreating at a very short distance, almost a blur because of the quick movements.

@morpheus4hire
Copy link

morpheus4hire commented Aug 9, 2017

Ok I have found out the commit that causes all of the npc issues described above. I went through and added each commit to a repo that I knew didn't have this issue and as soon as I commit e2a1ccd the issues with wierd npc movement start. Patrol out of goldshire acts wierd like it wants to attack but can't and random npc's around rabbits have wierd movement, etc.
@Treeston could you please take a look when you have a chance

@Treeston
Copy link
Member

Treeston commented Aug 9, 2017

On vacation, I can take a look when I get back.

@Treeston Treeston self-assigned this Aug 9, 2017
@morpheus4hire
Copy link

@Treeston
Your not supposed to worry about this stuff on vacation. :)
Hope you have a good vacation.
👍

@ghost
Copy link

ghost commented Aug 10, 2017

Thanks for the detective work, @morpheus4hire . Nice to know what caused it to start in the first place.

@morpheus4hire
Copy link

@Treeston
not sure if this will help but this is short video of behaviour I'm referencing
first is cat near rabbit (when rabbit is killed cat acts normal again)
https://www.youtube.com/channel/UCWv7PGTcuri25L8CIVuh4jQ
second is guard trying to attack wolf while patrolling
https://www.youtube.com/edit?o=U&video_id=3npDDdEL5HE
@tkrokli
can you take a look at videos as I have seen this similar behaviour in instances as well

@ghost
Copy link

ghost commented Aug 12, 2017

That behaviour is typical for any hostile NPC creature using creature_template.AIName=SmartAI . You will see it almost everywhere in the game, as long as you know what to look for. Wolf attacking Mouse, Rabbit, Rat, Squirrel etc. You will also see it whenever a humanoid Guard NPC is close enough to a hostile beast creature to start a fight, but the attack gets reset due to something broken in aggro handling / aggro reset. I thought this was documented well enough already, but I guess I was wrong. Please notice that this is happening anywhere in the game in 3.3.5 where NPCs are scripted to attack either a prey, a hostile beast or in scripted fights like in Western Plaguelands. I have not checked much in Northrend yet, but I have seen it a lot in Azeroth and Outland.

@Magnifikator
Copy link
Contributor

@tkrokli Can confirm that 100%

@Killyana
Copy link
Member

Killyana commented Aug 12, 2017

It's not related to movements, flags, or anything else, it's just factions, example:

  • spawn 2 npc: 321 with npc add temp 321
  • .mod fac 16 the first npc
  • mod fac 1925 the second npc
  • .npc follow one of them to trigger the combat
  • notice they are evading upon the combat start

You can get the 2 factions of any npcs that have this issue and reproduce it like this.
To help on this issue you can provide the couple of factions like: 16/1925

@Magnifikator
Copy link
Contributor

Magnifikator commented Aug 13, 2017

To be more precise: 16 and 1925 are faction templates (FactionTemplate.dbc) which controls exactly what @tkrokli told: Friend / Enemy relationships.

Template 16: (is faction 14, is monster, has no friends, all players are enemies, is friend with faction 14)

Template 1925: (is faction 14 too, is monster, has no friends, all players AND monsters are enemies, is enemy with faction 14)

On some point they start to try to fight each other, but one NPC seem to be reseting regulary to its spawn (waypoint?!) point.

If you switch on the network logger to debug you can see always "WORLD: Sent SMSG_AI_REACTION, type 2."

@Magnifikator
Copy link
Contributor

Magnifikator commented Aug 13, 2017

From my example 2 weeks ago:

Rabbit:
Faction template 31 (is faction 28, is nothing specific, has no general friends or enemies, is hostile to faction 973 (Monster, Predator), is friend to faction 148 (Ambient))

Leopard:
Faction template 66 (is faction 55, is monster, has no general friends, all players are enemies, is hostile to faction 28 (Prey, the rabbit), is friend to faction 55 (himself))

@Solzz
Copy link

Solzz commented Sep 28, 2017

any update on this?

If anyone needs to test this move one of the Razorhill guards closer to the Scorpids and you will see that the Razorhill Guard stands still and the Scorpid starts freaking out.

@Plexias
Copy link

Plexias commented Oct 11, 2017

Any update?

@Kruelism
Copy link

Thinking this wont be fixed any time soon?

Treeston added a commit that referenced this issue Jan 3, 2018
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.
@Treeston
Copy link
Member

Treeston commented Jan 3, 2018

closed by PR #19930 (532ab1c)

@Treeston Treeston closed this as completed Jan 3, 2018
@ghost
Copy link

ghost commented Jan 3, 2018

Wow, nice. I am really looking forward to see if this is back to normal now.

@Killyana
Copy link
Member

Killyana commented Jan 3, 2018

Someone else can .go c 103788 and see if the issue is fixed or not?

@Treeston Treeston reopened this Jan 3, 2018
@ghost
Copy link

ghost commented Jan 3, 2018

TrinityCore rev. 532ab1c 2018-01-03 20:04:19 +0100 (3.3.5 branch) (Win64, Release, Static)

Unfortunately not, the aggro/evade keeps resetting.
The behaviour is more moderate than before, though, at least if you look at the examples at Felstone Field / Dalson's Tears
(.tele FelstoneField / .tele DalsonsTears) - the NPCs move less frantically, but they still keep evading from combat.

@Kruelism
Copy link

Kruelism commented Jan 3, 2018

AzerothCore seems to have this issue fixed maybe find what they did to fix this issue? https://github.com/azerothcore/azerothcore-wotlk only last tested their core a month ago and it worked without the issues so might be worth checking into. Not fully sure how much of trinity they use tho.

@Treeston
Copy link
Member

Treeston commented Jan 3, 2018

Their "fix" is not having the latest TC. This is a regression after e2a1ccd.

@Kruelism
Copy link

Kruelism commented Jan 3, 2018

Ah damn at least i tried to be helpful lol

@ghost
Copy link

ghost commented Jan 3, 2018

I am uncertain whether my dbc/maps/vmaps/mmaps are too old, from back in 2017-11-22 (mix of 20., 21. and 22. actually) and if that invalidates my testing on current core for this specific issue. (Sure, I can rebuild those too, I just felt I had to test if this issue was solved right away.)

Treeston referenced this issue Jan 4, 2018
 to fix legacy bugs exposed by it:

- Triggers can no longer have a threat list (this may expose some ugliness in old legacy scripts)
- Threat entries are forced to OFFLINE if the AI refuses to attack the target
- Clean up passive creature evade behavior to be more consistent
- Fix a months old issue in spawn group management that would cause "Inactive" to incorrectly show in .list respawns for system groups outside of map 0
- Valithria script cleanups, remove old hacks and make it work with the new system. Closes #21174.
- Some strings cleanup
@Killyana
Copy link
Member

Still happen on rev. 31f14da
.go xyz -5815.62 -569.355 399.983 0

Treeston added a commit that referenced this issue Jul 18, 2018
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this issue Jul 18, 2018
Ovahlord referenced this issue in The-Cataclysm-Preservation-Project/TrinityCore Jul 22, 2020
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.
Ovahlord referenced this issue in The-Cataclysm-Preservation-Project/TrinityCore Jul 22, 2020
…ith critters. Closes #19998, for real this time.
Shauren pushed a commit that referenced this issue Aug 23, 2020
…using creatures to evade when chased by another creature from outside their own aggro range. Closes #19998.

(cherry picked from commit 1f57d1a)
funjoker pushed a commit that referenced this issue May 6, 2021
Shauren pushed a commit that referenced this issue May 16, 2021
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.

(cherry picked from commit 532ab1c)
Shauren pushed a commit that referenced this issue Oct 14, 2021
…ith critters. Closes #19998, for real this time.

(cherry picked from commit 0c476ff)
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

10 participants