How is Threat or Aggro Calculated
-
qwertyh88
- Posts: 175
- Joined: Sun May 08, 2016 11:56 am
How is Threat or Aggro Calculated
I noticed that whenever I am playing my ranger it tends to grab all the aggro whenever it attacks one enemy; this is especially annoying when going against epic bossses and we have an supposedly good tank that is "suppose to grab the aggro" but the moment my ranger goes in for the hit, the boss turns its attention to him...
- zhazz
- Posts: 850
- Joined: Sat Feb 08, 2020 7:12 am
Re: How is Threat or Aggro Calculated
From my own experience it is based on two things:qwertyh88 wrote: ↑Fri May 15, 2020 7:34 pm I noticed that whenever I am playing my ranger it tends to grab all the aggro whenever it attacks one enemy; this is especially annoying when going against epic bossses and we have an supposedly good tank that is "suppose to grab the aggro" but the moment my ranger goes in for the hit, the boss turns its attention to him...
- Armor Class (AC)
- Proximity
That being said, however, the concepts of Aggro or Threat doesn't exist in D&D.
The Man-at-Arms (MaA) class is the only class that allow a characters to force a monster to attack that character. But even that can be overridden by the two factors above, once the forced "attention" fades, or if the monsters cannot get to the MaA character.
- Rhifox
- Custom Content
- Posts: 3964
- Joined: Wed Jan 13, 2016 2:34 am
Re: How is Threat or Aggro Calculated
As far as I'm aware they beeline for the person with the lowest AC.
Tarina — The Witch of Darkhold, a dealer in spirits and black magic
- Blackman D
- Retired Staff
- Posts: 4819
- Joined: Sat Sep 12, 2009 5:43 am
- Location: IL
Re: How is Threat or Aggro Calculated
there is no aggro like mmos, yes they will go for the lowest AC but they will target the most vulnerable person around, so physical attacks you will see lowest AC but say mages will target someone without SR or immunities since the AI cheats and knows if a spell will work before hand...
everyone is evil till proven otherwise
- Steve
- Recognized Donor
- Posts: 8139
- Joined: Wed Jul 08, 2015 5:42 am
- Location: Paradise in GMT +1
Re: How is Threat or Aggro Calculated
AI will also turn its attention onto the PC causing most Damage (but I’ve yet to determine if that is per hit or per round).
Talsorian the Conjuransmuter - The (someTIMEs) Traveler
The half-MAN, the MYrchanT(H), the LEGENDermaine ~ Jon Smythe [Bio]
Brinn Essebrenanath — Volamtar, seeking wisdom within the earth dream [Bio]
- Touri
- Posts: 1104
- Joined: Tue Aug 10, 2010 1:43 pm
- Location: GMT +1
Re: How is Threat or Aggro Calculated
Hi all,
I had the same problem with my melee ranger. I believe there are at least some things:
Armor Class >the lower the AC the more aggro you will get.
Damage >the enemy will target the one that does the most damage
The enemy will only target you, if you attacked it. Otherwise it will attack the closest target.
I think that the damage thing counts several rounds too. When I wait some rounds before I attack and let the tank do some damage over really a few rounds, I sometimes can attack without getting the aggro.
I also think that the experience points are a parameter. The enemy often attacks the char with the highest xp. So if you have a lvl 30 and a lvl 30 with ECL or the ECL xp, it will attack the one with the higher xp, depending on the other parameters as well.
If you have have a ranged fighter, be careful to not attack a target that is not attacked by tank/melee fighters or it will directly run to you.
As melee you can try to hit and run. Hit the first attacks and run away before it turns to you.
Kind regards
Touri
I had the same problem with my melee ranger. I believe there are at least some things:
Armor Class >the lower the AC the more aggro you will get.
Damage >the enemy will target the one that does the most damage
The enemy will only target you, if you attacked it. Otherwise it will attack the closest target.
I think that the damage thing counts several rounds too. When I wait some rounds before I attack and let the tank do some damage over really a few rounds, I sometimes can attack without getting the aggro.
I also think that the experience points are a parameter. The enemy often attacks the char with the highest xp. So if you have a lvl 30 and a lvl 30 with ECL or the ECL xp, it will attack the one with the higher xp, depending on the other parameters as well.
If you have have a ranged fighter, be careful to not attack a target that is not attacked by tank/melee fighters or it will directly run to you.
As melee you can try to hit and run. Hit the first attacks and run away before it turns to you.
Kind regards
Touri
- Endelyon
- Posts: 3606
- Joined: Sun Jul 06, 2014 4:24 am
Re: How is Threat or Aggro Calculated
There's no simple answer to this, conventionally the monster AI uses an extremely complicated system of dozens (perhaps hundred) weights and measures to determine what to do every single round of combat. It's one of the most complicated scripts in the entire game (and quite vanilla on our server), however some customization can be added to it for specifically triggered events, like Man at Arms gets the class ability Mocking Challenge that goads creatures into attacking them if they fail a Will DC.
Outside of these specific instances it's never possible to "guarantee" that one player will hold threat.
Outside of these specific instances it's never possible to "guarantee" that one player will hold threat.
-
c2k
- Posts: 1230
- Joined: Sat May 16, 2009 7:29 pm
Re: How is Threat or Aggro Calculated
I believe is greatest potential damage, since the enemies always turn on sneak attackers.
- Kitunenotsume
- Posts: 631
- Joined: Sun May 17, 2020 10:57 pm
- Location: UTC -7
Re: How is Threat or Aggro Calculated
While target priority from a distance is quite complicated, I can add some insight on melee interactions.
The number one influence over melee target priority is proximity.
Outside spellcasters and certain dedicated ranged 'fleeing' mobs, most AI will prioritize engaging the closest target within their weapon range.
Unfortunately, this is only recalculated once a round and does not change any queued action targets, so it can take up to 12 seconds to see a target shift (One round to complete the current action, and potentially up to another round to finish any second queued action).
What is considered 'closest' is often complicated, as different weapon types in NWN2 have a different 'Preferred Range'.
It isn't 5-feet.
Each weapon is affected by "Pref Attack Distance" in the baseitems.2da, with daggers coming in at 1.1, longswords at 1.5, greatswords at 1.8, and so on. *
This number affects the distance in meters in-game that your (and the enemy's) characters will run to to engage.
(Note that this isn't the same thing as true weapon range, which is affected by other melee limits)
This means that, using auto-attacks or mouse actions, a rogue will almost always end up closer than a fighter to the enemy
The solution here is that the fighter (or tank) needs to manually move closer to the enemy than their allies will engage at.
Once the 'tanky' character has their face veritably squished into the space occupied by the monster, you should see the monster turn and deal with the now-closest threat once new actions are assigned to mobs.
This can be used to pull target-priority off just about anyone, including unbuffed mages in their robes, but as noted above can take up to 12 seconds to kick in.
If proximity lapes during the calculation (like the mage runs away and the monster follows to complete their action), the next action will be queued attacking the closest-target, which is probably the same as the previous round. Mobs will continue after their current target with their last queued action until interrupted, since the current action is usually only replaced once complete and will only sometimes be overridden by the game engine.
For this reason, running is about the worst thing you can do if you want a monster to engage someone else, unless you know that your 'tank' is capable of moving faster than the monster and/or you can move fast enough that the fighter *will* become closer even if the monster follows you (such as Expeditious Retreat/Haste).
This isn't the only factor, as Endelyon pointed out, because the entire script is highly complex, but in regards to melee the above generally holds true. Magic and combat outside melee are affected much less by proximity, as target vulnerability has a higher influence when you can hit anyone you can see.
TLDR: Melee Agro is mostly proximity based. If you use shorter weapons than the fighter, you will get aggro more, unless the fighter manually moves closer than you do.
Hope that helps.
Cheers,
~Kit
* : These can be adjusted by a developer, and don't always make sense. For example: by default, Greatswords and Warmaces have a longer auto-range (1.8) than any other PC weapon, including Halberds (1.7) or Spears (1.5) which should have Reach. Meanwhile a Greatclub has a lower auto-range (1.2) than a longsword (1.5). Whips, for some unknown reason demonstrate their 15-foot P&P utility at only 1.7, but I have seen servers adjust it properly out to around 3.
The number one influence over melee target priority is proximity.
Outside spellcasters and certain dedicated ranged 'fleeing' mobs, most AI will prioritize engaging the closest target within their weapon range.
Unfortunately, this is only recalculated once a round and does not change any queued action targets, so it can take up to 12 seconds to see a target shift (One round to complete the current action, and potentially up to another round to finish any second queued action).
What is considered 'closest' is often complicated, as different weapon types in NWN2 have a different 'Preferred Range'.
It isn't 5-feet.
Each weapon is affected by "Pref Attack Distance" in the baseitems.2da, with daggers coming in at 1.1, longswords at 1.5, greatswords at 1.8, and so on. *
This number affects the distance in meters in-game that your (and the enemy's) characters will run to to engage.
(Note that this isn't the same thing as true weapon range, which is affected by other melee limits)
This means that, using auto-attacks or mouse actions, a rogue will almost always end up closer than a fighter to the enemy
The solution here is that the fighter (or tank) needs to manually move closer to the enemy than their allies will engage at.
Once the 'tanky' character has their face veritably squished into the space occupied by the monster, you should see the monster turn and deal with the now-closest threat once new actions are assigned to mobs.
This can be used to pull target-priority off just about anyone, including unbuffed mages in their robes, but as noted above can take up to 12 seconds to kick in.
If proximity lapes during the calculation (like the mage runs away and the monster follows to complete their action), the next action will be queued attacking the closest-target, which is probably the same as the previous round. Mobs will continue after their current target with their last queued action until interrupted, since the current action is usually only replaced once complete and will only sometimes be overridden by the game engine.
For this reason, running is about the worst thing you can do if you want a monster to engage someone else, unless you know that your 'tank' is capable of moving faster than the monster and/or you can move fast enough that the fighter *will* become closer even if the monster follows you (such as Expeditious Retreat/Haste).
This isn't the only factor, as Endelyon pointed out, because the entire script is highly complex, but in regards to melee the above generally holds true. Magic and combat outside melee are affected much less by proximity, as target vulnerability has a higher influence when you can hit anyone you can see.
TLDR: Melee Agro is mostly proximity based. If you use shorter weapons than the fighter, you will get aggro more, unless the fighter manually moves closer than you do.
Hope that helps.
Cheers,
~Kit
* : These can be adjusted by a developer, and don't always make sense. For example: by default, Greatswords and Warmaces have a longer auto-range (1.8) than any other PC weapon, including Halberds (1.7) or Spears (1.5) which should have Reach. Meanwhile a Greatclub has a lower auto-range (1.2) than a longsword (1.5). Whips, for some unknown reason demonstrate their 15-foot P&P utility at only 1.7, but I have seen servers adjust it properly out to around 3.
Last edited by Kitunenotsume on Tue Jun 30, 2020 12:14 am, edited 1 time in total.
I play a baker. Sometimes she provides counseling or treatment.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
-
c2k
- Posts: 1230
- Joined: Sat May 16, 2009 7:29 pm
Re: How is Threat or Aggro Calculated
Well, it is true that there are tags that you can add to creatures to make them behave and target differently, hence the complexity. I really don't know how much of this was used in BG spawn design though.
- Kitunenotsume
- Posts: 631
- Joined: Sun May 17, 2020 10:57 pm
- Location: UTC -7
Re: How is Threat or Aggro Calculated
From my experience thus far (not even a month yet, admittedly), the above observations hold true.
My main is a heavy-armor-and-shield user, partnered with rogues and casters usually, and I haven't observed any significant situations where melee threat priority has been unable to be redirected by proximity manipulation.
Admittedly I haven't touched epic content, but all the major dungeons around BG and FAI seem to follow the expectations I listed.
As noted in the post, however, these observations apply to melee once combat has started - initial engagement and non-melee can be quite different.
My main is a heavy-armor-and-shield user, partnered with rogues and casters usually, and I haven't observed any significant situations where melee threat priority has been unable to be redirected by proximity manipulation.
Admittedly I haven't touched epic content, but all the major dungeons around BG and FAI seem to follow the expectations I listed.
As noted in the post, however, these observations apply to melee once combat has started - initial engagement and non-melee can be quite different.
I play a baker. Sometimes she provides counseling or treatment.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
- DaloLorn
- Posts: 2467
- Joined: Tue Mar 26, 2019 2:44 am
- Location: Discord (@dalolorn)
Re: How is Threat or Aggro Calculated
So if you want to avoid aggro, use swords... and if you want to draw it, use clubs?Kitunenotsume wrote: ↑Thu May 28, 2020 4:01 pm From my experience thus far (not even a month yet, admittedly), the above observations hold true.
My main is a heavy-armor-and-shield user, partnered with rogues and casters usually, and I haven't observed any significant situations where melee threat priority has been unable to be redirected by proximity manipulation.
Admittedly I haven't touched epic content, but all the major dungeons around BG and FAI seem to follow the expectations I listed.
As noted in the post, however, these observations apply to melee once combat has started - initial engagement and non-melee can be quite different.
That file contains some very strange preferences... Interestingly, it looks like finessable weapons consistently try to get up close and personal.
European player, UTC+1 (+2 during DST). Ex-fixer of random bits. Active in Discord.
Active characters:
Active characters:
- Zeila Linepret
- Ilhara Evrine
- Linathyl Selmiyeritar
- Belinda Ravenblood
- Virin Swifteye
- Gurzhuk