Aggro

From Terraria Wiki
Jump to navigation Jump to search

Aggro, short for aggression or aggravation, is an invisible statistic that determines the distance at which enemies will begin to attack the player. Terraria features various items that can alter this statistic when equipped.

All enemies target the player based on criteria set in their AI. Most will constantly try to find a target, while others may only target if the player is in water, for example.

!!Error: Invalid EICONS input! Currently, the Stardust Guardian is the only summon able to divert an enemy's target away from the player. It overrides the player's presence, but only if it is closer than 200 pixels from said enemy. Otherwise, an enemy may target the player or the Guardian – whichever is closer. It is best to summon the Stardust Guardian closer to hordes of enemies, rather than a small few, to avoid being targeted when a few enemies disperse or die. As of 1.4.0.1(Desktop, Console and Mobile versions), the Stardust Guardian targets the closest enemy and whose actions can no longer be influenced by the player.

Armor and other items that "increase/decrease enemy targeting" cause enemies to consider a player to be closer or farther away than they actually are. Therefore, having a Stardust Guardian close to an enemy but also having aggro-increasing accessories equipped, the player could be considered "closer" than the Stardust Guardian is, potentially resulting in temporarily being targeted instead of the Guardian.

If the Eternia Crystal(Desktop, Console and Mobile versions) is present, the Old One's Army will target it by default, only targeting the player or Guardian if they get "in the way".

Gear

Decrease

The following items reduce the player's aggro statistic, meaning that enemies will have to get closer to target the player.

Item Aggro change
Invisibility PotionInvisibility Potion −750 (while not using an item)
−250 (while using an item)
Putrid ScentPutrid Scent(Desktop, Console and Mobile versions) -400
Arcane FlowerArcane Flower(Desktop, Console and Mobile versions) -400
Recon ScopeRecon Scope(Desktop, Console and Mobile versions) -400
Stalker's QuiverStalker's Quiver(Desktop, Console and Mobile versions) -400
Psycho KnifePsycho Knife(Desktop, Console and Mobile versions) In stealth mode, aggro is decreased based on visibility to a cap of −750
Shroomite armorShroomite armor(full set) In stealth mode, aggro is decreased based on visibility to a cap of −750
Vortex armorVortex armor(Desktop, Console and Mobile versions)(full set) In stealth mode, aggro is decreased based on visibility to a cap of −1200
  • Aggro reductions of −750 (or more) nearly guarantee the player will not be targeted.
  • Vortex armor provides the largest aggro reduction available in the game.

Increase

These items increase the player's aggro statistic, meaning that enemies can be farther from the player and still target them.

Item Aggro change
Turtle HelmetTurtle Helmet +250
Turtle Scale MailTurtle Scale Mail +250
Turtle LeggingsTurtle Leggings +250
Beetle HelmetBeetle Helmet +250
Beetle ShellBeetle Shell +400
Beetle LeggingsBeetle Leggings +250
Solar Flare HelmetSolar Flare Helmet(Desktop, Console and Mobile versions) +300
Solar Flare BreastplateSolar Flare Breastplate(Desktop, Console and Mobile versions) +300
Solar Flare LeggingsSolar Flare Leggings(Desktop, Console and Mobile versions) +300
Flesh KnucklesFlesh Knuckles(Desktop, Console and Mobile versions) +400
Berserker's GloveBerserker's Glove(Desktop, Console and Mobile versions) +400
Hero ShieldHero Shield(Desktop, Console and Mobile versions) +400

Formula

Most enemies will only attack the target they are closest to. They will determine the player's distance first, then the Stardust Guardian's (if applicable) and finally the distance to the Eternia Crystal(Desktop, Console and Mobile versions) (if applicable). The distance for the player formula is[1]

abs(targetPlayer.center.x - enemy.center.x) + abs(targetPlayer.center.y − enemy.center.y) − targetPlayer.aggro

The result from that formula is then compared to the guardians formula result:

abs(guardian.center.x − enemy.center.x) + abs(guardian.center.y - enemy.center.y) − 200

Whichever results in the higher value is targeted.

Old One's Army formula

Enemies in the Old One's Army(Desktop, Console and Mobile versions) follow a separate formula due to having to attack the player, as well as the crystal. An enemy will first determine the distance between the Eternia Crystal and it with a simple distance formula. Then, barring the chance the enemy is currently "ghosted", the enemy determines the "distance" to the player with the following formula.

distance(enemy.position, targetPlayer.position) − targetPlayer.aggro

Even though this formula does account for aggro, a player will be ignored if they are not within 200 pixels of the specified enemy.[2] Like with regular enemies, if the Guardian is closer to an enemy than the player is, and is within 400 pixels of it, then the Guardian is targeted instead of the player.

Notes

  • (Desktop, Console and Mobile versions) All slimes (except Spiked Slimes, King Slime, and Queen Slime) will ignore the player and the Stardust Guardian entirely when the Royal Gel accessory is equipped.
  • A Confused enemy will always face away from its target.
  • The following is a list of combos for the lowest attainable aggro:
    • (Desktop, Console and Mobile versions) The lowest attainable aggro is −4300, resulting from a combo of the Vortex armor in stealth mode, the Psycho Knife, the Putrid Scent, the Arcane Flower, the Recon Scope, the Stalker's Quiver, and the Invisibility Potion (while not using an item).
    • !!Error: Invalid EICONS input! The lowest attainable aggro is −3100, resulting from a combo of the Vortex armor in stealth mode, the Psycho Knife, the Putrid Scent, and the Invisibility Potion (while not using an item).
    • (Old-gen console and 3DS versions) The lowest attainable aggro is −1500, resulting from a combo of Shroomite armor in stealth mode and the Invisibility Potion (while not using an item).
  • The following is a list of combos for the highest attainable aggro:

History

  • Desktop 1.4.0.1: The Stardust Guardian now targets the closest enemy; its actions can no longer be influenced by the player.
  • Desktop 1.3.0.1:
    • Slimes no longer target the player if the player has Royal Gel equipped.
    • Introduced the Stardust Guardian, which can divert aggro away from the player.
  • Console 1.0.750.0: (PlayStation 4)
    • Slimes no longer target the player if the player has Royal Gel equipped.
    • Introduced the Stardust Guardian, which can divert aggro away from the player.

Footnotes

  1. Information taken from the Desktop version Desktop 1.4.3.6 source code, method TryTrackingTarget() in Terraria.NPC.cs. There may be inaccuracies, as the current Desktop version Desktop version is 1.4.4.9.
  2. Betsy, with a slightly different targeting system, will not target the player based on distance, and will instead target the player so long as the player is closest to it in comparison to the Stardust Guardian or Eternia Crystal.