Strange behavior of NPC's
They go forward and back however without reason.
Steps to reproduce the problem:
Go to Shadowlabyrint and look
Branch(es):
CHANGEME 3.3.5
TC rev. hash/commit:
TrinityCore rev. 1f834d3cd195 2017-07-06 21:39:46 +0200 (335 branch)
TDB version: TDB_full_world_335.63_2017_04_18 + updates
Operating system: Win7 64Bit
@Tauriella do you know if those creatures have waypoint or random movement and a creature formation?
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.
@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.
TrinityCore rev. 3f8c0cb44632 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.)
TrinityCore rev. d7919a97de39 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.
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 d24ce1739a79
Like I mentioned in https://github.com/TrinityCore/TrinityCore/issues/14880#issuecomment-318573953 , 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.
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
On vacation, I can take a look when I get back.
@Treeston
Your not supposed to worry about this stuff on vacation. :)
Hope you have a good vacation.
👍
Thanks for the detective work, @morpheus4hire . Nice to know what caused it to start in the first place.
@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
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.
@tkrokli Can confirm that 100%
It's not related to movements, flags, or anything else, it's just factions, example:
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
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."
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))
Thank you for the reminder that FactionTemplate.dbc is different from Faction.dbc
Will see if I can make a list later, somewhat busy with other stuff at the moment.
The faction on the DB is 16 not 14 also in this case if it's modified to 14 the issue doesn't happen any more.
DB GUID: 103788 Entry: 26711. Faction: 1925.
Entry: 26481. Faction: 16.
Entry: 26705. Faction: 16.
In the DB we save the factiontemplate ID even the field is called faction. The linked faction is taken from faction.dbc.
Factiontemplate 1925 -> Faction 14 (Monster)
Factiontemplate 16-> Faction 14 (Monster)
It's not the case, you can check IG.
You mean with .npc info ? It shows faction but means factiontemplate.
There is no faction ID 1925 in the faction.dbc.
UPDATE `trinity_string` SET `content_default` = 'NPC currently selected by player: DB GUID: %u, current GUID: %u. Faction Template: %u. npcFlags: %u. Entry: %u. DisplayID: %u (Native: %u).' WHERE `entry` = 539;
This would clarify the gm command.
So when is this suspected to be fixed? Just wondering for when i should compile it again to continue working on my server
That depends on when someone will come up with a working solution approved by the main TC developers.
On vacation, I can take a look when I get back.
That's now. So, soon™.
Ok cool thanks
Issue tracked down.
EngageWithTarget
, which adds B to A's threat listUpdateVictim
. A is not on B's threat list (which is empty), so B evadesAnd there's even code that's supposed to handle this case, except said code has an oversight that caused it to never do anything.
...and it was never needed to do anything because of the old non-mutual combat system.
sigh
Any Idea why it happens only with some factions combination?
Edit: The issue is not fully fixed, only one npc attacks the second ne is passif.
.go c 103784
Any News ?
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.
Any update?
Thinking this wont be fixed any time soon?
closed by PR #19930 (532ab1c)
Wow, nice. I am really looking forward to see if this is back to normal now.
Someone else can .go c 103788 and see if the issue is fixed or not?
TrinityCore rev. 532ab1c7f865 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.
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.
Their "fix" is not having the latest TC. This is a regression after e2a1ccd.
Ah damn at least i tried to be helpful lol
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.)
Still happen on rev. 31f14dadde46
.go xyz -5815.62 -569.355 399.983 0
Most helpful comment
That's now. So, soon™.