Threat is a mechanism in Dragon Age: Origins whereby enemies decide which characters in your party to attack.
Threat Level Edit
Threat Level is the means by which a character's threat is deduced, and is often referred to as relating to "enemy hostility." Essentially, the higher threat level a character has, the more "hostile" or aggressive enemies will be towards that character, which will result in drawing more enemies to attack that character. The lower the threat level a character has, the less "hostile" enemies will be, and the more likely an enemy will seek out a different target to attack - assuming their threat level is higher.
Threat Mechanics in Combat Edit
The strategic use of a party's varying threat levels is widely considered to be a key element of successfully overcoming the opposition, especially at higher levels of difficulty.
The initial threat value for each party member upon being sighted is 10 (this value is relevant since Mages can reset all threat - except for the distance component - with Mind Blast).
On difficulties lower than Nightmare, armor increases the initial threat. The bonus is 5 for light armor, 10 for medium / heavy / massive armor.
On difficulties lower than Nightmare, melee weapons increase the initial threat by 5.
Party members are added to an enemy's threat table in the order they are perceived (this is based on the distance). There is a small delay for distant party members.
After a party member has been added to the threat table, a distance-based threat component is initialized (distance between enemy and party member). This threat component scales approximately like this (distance in m):
|Distance in m||Threat|
1.8m - 2m is the common melee-combat distance.
The amount of threat generated is:
ThreatIncrease = 100 * DamageDealt / MaximumHealth of Enemy
For an enemy with 200 hit points:
- Taking the enemy from 180 to 140 health (40 damage) draws 20 threat.
- Taking the enemy from 60 to 20 health (40 damage) draws 20 threat as well.
Rogues will only draw 80% of the threat noted above.
Warriors have special abilities that can increase the amount of threat drawn.
- Taunt provides a one-time AoE threat increase of 300 (400 with Frightening Appearance).
- Threaten doubles the threat amount due to damage dealt.
- Most Activated Talents should draw additional threat from affected enemies. However, this only works for very few talents:
- Armor does not increase threat beyond the small bonus upon being sighted.
Some spells that affect enemies in a negative way draw additional threat, in addition to damage dealt. In many cases, this is not working properly for many spells and noted in the spell descriptions. However, it is working correctly for the following spells (per their spell descriptions):
- Area of Effect spells
- Single-Target spells
- Walking Bomb draws 50 Threat (in addition to damage-based threat) on Casual/Normal, increased to 100 on Hard/Nightmare. Explosion damage draws damage-based threat.
- Virulent Walking Bomb draws 70 Threat (in addition to damage-based threat). Explosion damage draws damage-based threat.
- Crushing Prison draws 100 Threat (in addition to damage-based threat)
- Petrify draws 100 Threat
- Death Hex draws 100 Threat
- Misdirection Hex draws 60 Threat
- Horror draws 60 Threat
- Paralyze draws 50 Threat
- Affliction Hex draws 30 Threat from the primary target. No Threat is drawn from the surrounding nearby enemies.
- Weakness draws 10 Threat
- Vulnerability Hex draws 10 Threat
Animate Dead is a special case as the summoned skeleton (not the caster) draws a lot of Threat when initially summoned.
Items with the Increases Hostility and Intimidation property such as Ageless do not have their effects implemented properly and do not adjust threat in any way. Cadash Stompers, which have the Increases Hostility property are an exception and simply add +5 threat per hit, though this behavior is specific to this particular item and not all items with the Increases Hostility property. A mod is available that addresses many of these issues.
- Non-hostile spells and all buffs do not draw threat.
- Mind Blast clears all Threat drawn by the Mage, except for the distance-based component.
- Stealth causes the Rogue to disappear from perception by all enemies. After an event processing delay, the stealthed rogue will be dropped from all threat tables. However, if Stealth is broken quickly (within 1-2s, e.g. due to an automatic attack because the base AI forces the Rogue to defend himself or an attack was already queued), threat is not dropped. If the Rogue was dropped from the Stealth tables, his threat numbers will start from scratch with the Initial Threat and distance-based threat numbers.
- Feign Death works similarly to Stealth. The same caveat applies, if Feign Death is given up too quickly, the drop from the Stealth tables (and subsequent drop of Threat) may not occur.
Note that the threat number for the Rogue may be higher than for other party members after being rediscovered, since the other party members will have lost some or all of the Initial Threat due to threat decay of 0.5 per second.
- Distraction clears all Threat, except for the distance-based component.
Disengage lowers threat by 100.
The Reduces Hostility property found on items such as Bard's Dancing Shoes, Dalish Promise Ring, Amulet of Accord, Magister's Cinch, Adaia's Boots is not implemented properly and does not reduce threat in any way. A mod is available to address this issue.
Once a distance of 60m is reached, enemies will lose perception of the party member. The party member will be dropped from the Threat table. Once perceived again, threat starts from scratch (Initial Threat + distance-based threat).
If a party member runs faster than the enemy, running away and causing a chasing enemy to pass close by another party member can trigger a target switch to the other party member (if his threat due to distance is higher). This can be a useful tactic, if a Mage is attacked by several enemies at the beginning of combat (at Nightmare difficulty, the only threat difference between party members is due to distance at the beginning of combat).
Common Threat StrategiesEdit
Tank & Range: Perhaps the most common use of threat in combat is to elevate the threat level of one (or perhaps two) specific Warriors in your party, often who are equipped with a weapon & shield. The high threat levels draw most of the enemies attacks to the Warrior with a high threat level. They act as a "tank" whose job it is to soak up massive amounts of damage while the other 3 party members either heal & buff, do back stabbing damage, do massive two-handed damage, deal high magic damage, or use other ranged attacks.
Enemy Target SwitchingEdit
Enemies will always try to attack the target they hate most (has the highest threat amount to this particular enemy).
Enemies with melee weapons have timers limiting how often they switch targets. The timer start value is initialized to 0 and increases by 5s (up to 25s), each time the target is switched. While the timer is counting down, targets will not be switched (unless the current target cannot be attacked).
If the target has 20% health left, enemies will not switch to a higher threat target with a probability of 50%. If the target has 10% health left, enemies will not switch to a higher threat target with a probability of 90%.
An exception to targeting the most-hated enemy, are ranged AoE attacks some creatures can perform. Those are controlled by a Tactics system similar to the party AI. These tactics may contain ability / spell triggers based on clustered enemies and target range. Examples would be the Harvester's Vile Disembowelment and Varterral's Scream.
Threat decays at a rate of 0.5 per second (the distance-based threat component does not decay).
Verification and Testing NotesEdit
Hooking into the engineEdit
Most of the threat management/updating is done in ai_threat_h.nss. This is a header file, so it cannot be directly recompiled. Root scripts with a main() function using this header must be recompiled, e.g. rules_core.nss, player_core.nss, spell_aoe_instant.nss, spell_aoe_duration.nss, talent_model.nss, talent_singletarget.nss.
Useful script functions:
- float threat = GetThreatValueByObjectID(oCreature, oAttacker); Returns current threat value.
- GetName(oAttacker) Name of party member.
- GetName(oCreature) Name of enemy, as displayed in game.
- GetTag(oCreature) Base name of the *.utc file of the actual creature spawned.
- ObjectToString(oCreature) Unique Object ID of the creature.
Testing was performed with Patch 1.02; Toolset 1.01.
- Base threat upon sighting (including weapon / armor bonus at lower difficulties).
- Threat based on damage (including Threaten functionality, Frightening Appearance does not give Threaten bonus).
- Spells draw additional threat, taken from ABI_base.xls, threat_impact column. The threat_impact value is multiplied by 10. Walking Bomb special case verified. This is triggered by the EVENT_TYPE_CAST_AT event in rules_core.nss. This is working for about half the spells. Spell descriptions have been updated.
- Most Talents do not draw additional threat, there are threat_impact values in ABI_base.xls as well. All activated Talents have been checked. Only Archery talents Arrow of Slaying, Pinning Shot and Scattershot, Shale talents Stone Roar, Regenerating Burst, Rock Barrage and Stone Aura, and Dog talent Overwhelm draw additional Threat. The EVENT_TYPE_CAST_AT event is used as here as well to trigger the Threat update.
- Feign Death, Stealth reduce threat if the Rogue has disappeared from perception long enough.
- Reaching a distance of more than 60m drops threat.
- Target switch counters, limiting melee target switch rate.
- Mind Blast.
- Items with Reduces Hostility and Increases Hostility and Intimidation properties do not work (tested items: Bard's Dancing Shoes, Ageless). However, items like Cadash Stompers with Increases Hostility property do work (note the lack of "intimidation" in the property description). The latter items add 5 points of threat per hit.
- The distance-based threat generation is happening somewhere deep in the bowels of the engine and not performed using scripts. The values appear to be reproducible, but special cases that have not been discovered may exist.