AI

From Terraria Wiki
Jump to: navigation, search
In the Terraria Wiki, the term "NPCs" generally refers to Town NPCs; however, for the purpose of this article, it also encompasses enemies and critters.

AI (artificial intelligence) is the behavioral pattern exhibited by an NPC. For instance, the Caster AI will always warp, shoot three times, pause for three seconds, and then warp again. Knowing the AI an enemy uses can provide an advantage in combat, as it offers an idea of how the enemy will attack and react in given scenarios.

In addition, additional AI is added for certain NPCs, such as the non-aggressive mode of surface slimes, the Eater of Souls' circling around the player, the Wandering Eye's acceleration, or the ranged attack of some Fighter AI enemies.

AIs are not given names in the game code, so they are given names here to assist in identifying them across the wiki. Most AI names are given based on observed behavior (such as Flying AI), NPC groups (such as Slime AI), or the first NPC to implement the AI (such as Demon Eye AI).

There are 112 different AI types:

ID Name Description NPCs
0 No AI Doesn't move.
1 Slime AI Hops in one direction, slides on slopes, floats in water, follows player if damaged or it's nighttime.
2 Demon Eye AI Flies, follows player, bounces off walls in an arc.
3 Fighter AI Will walk, jump over holes, follow player. It will try to line up vertically first. If it fails to reach its target, it will back up a bit, then re-attempt. It is the most common AI in Terraria.
  • 4 Eye of Cthulhu AI Alternates between trying to stay above the player and summoning Servants of Cthulhu, and charging at the player occasionally. Spins when at low health, and begins exclusively charging at the player. Always looks at player.
    5 Flying AI Flies, looks at player, follows player.
    6 Worm AI Burrows in ground (and/or air), passes through blocks, follows player.
    7 Passive AI Walks semi-randomly, jumps over holes.
    As of the 1.3 update, all Passive NPCs talk to each other and the player, and each NPC has a different weapon to defend themselves when an enemy is nearby.
    8 Caster AI Casts spells at player, stays stationary, warps after three casts, warps if falling. It stops casting spells if damaged, then warps if left alone.
    9 Spell AI Travels in a direct line toward player, going through blocks. Used by casters.
    10 Cursed Skull AI Tries to drift toward or around player, often stays a little bit out of reach once having touched the player.
    11 Head AI Tries to stay above player, spins and moves towards player occasionally.
    12 Skeletron Hand AI Waves, damages player.
    13 Plant AI Extends on a vine towards player, looks at player. Dies if not rooted to a block.
    14 Bat AI Spasmodically flies toward player.
    15 King Slime AI Hops toward the player, releases Blue Slimes when damaged (releases Spiked Slimes when damaged in Expert mode), teleports toward the player when player is out of reach.
    16 Swimming AI Swims back and forth, moves towards the player if they are in water.
    17 Vulture AI Stands still until player gets within five blocks of AI or is damaged. AI then acts similarly to the Flying AI.
    18 Jellyfish AI Floats back and forth, swims toward player in small bursts if player is in water.
    19 Antlion AI Looks at player, climbs overlapping blocks, shoots falling sand at nearby players.
    20 Spike Ball AI Swings in a circle from a pivot point on a chain.
    21 Blazing Wheel AI Moves along walls, floors and closed doors.
    22 Hovering AI Similar to the Fighter AI, floats over the ground instead of jumping.
    23 Flying Weapon AI Doesn't adhere to gravity or tile collisions. Spins several times, then heads straight towards the player. Any damage cancels its attack and forces it to spin again.
    24 Bird AI Stands still until player gets nearby, then flies away. Avoids walls and obstacles and changes direction if one is in the way.
    25 Mimic AI Stands still until player approaches or attacks, then leaps towards them with varying heights.
    26 Unicorn AI Slowly gains speed while moving, jumps over obstacles.
    27 Wall of Flesh AI Wall of Flesh Mouth with Wall image attached. Traverses the world horizontally. Also spawns with two Wall of Flesh Eyes which share its health.
    28 Wall of Flesh Eye AI Bound to an entity, watches player, and shoots projectiles. The more damaged it is, the more it shoots.
    29 The Hungry AI Similar to the Plant AI, but attached to an entity.
    30 Retinazer AI Alternates between attempting to stay diagonally above player while shooting projectiles slowly, and attempting to stay beside player and shooting projectiles very rapidly.
    31 Spazmatism AI Alternates between shooting projectiles and staying beside player, and charging toward player.
    32 Skeletron Prime Head AI Same as Head AI
    33 Prime Saw AI Occasionally charges at the player, heads directly towards player when enraged.
    34 Prime Vice AI Occasionally charges at the player, rapidly charges when enraged.
    35 Prime Cannon AI Fires bombs upwards, aims directly at player when enraged.
    36 Prime Laser AI Fires projectiles at player, shoots very rapidly when enraged.
    37 The Destroyer AI Similar to worm AI except it will shoot projectiles from the body and tail and is unable to "fly" in air. It will also release Probes.
    38 Snowman AI Jumps and runs toward the player, similar to Fighter AI.
    39 Tortoise AI Crawls a bit, then leaps toward player. Will indefinitely leap towards the player in water.
    40 Spider AI Capable of climbing background walls as well as through platforms. Used only when crawling on a wall. Without a wall listed enemies seamlessly transform into their walking variants, which use Fighter AI.
    41 Herpling AI Jumps high and attempts to land on the player. It can strafe to the sides in midair.
    42 Lost Girl AI Turns into a Nymph when a player gets too close.
    43 Queen Bee AI Alternates between attempting to stay above player while firing projectiles downwards or spawning bees, and charging back and forth very rapidly.
    44 Flying Fish AI Flies straight towards player.
    45 Golem Body AI Jumps towards player every few seconds, shoots lasers.
    46 Golem Head AI Bound to an entity.
    47 Golem Fist AI Flies towards player, returns when hit.
    48 Free Golem Head AI Attempts to fly back and forth, shoots projectiles at player.
    49 Angry Nimbus AI Attempts to stay directly above the player, and fires projectiles downwards.
    50 Spore AI Drifts downwards while following player, destroyed on contact.
    51 Plantera AI Clings to nearby blocks, chases player, fires projectiles and spiky balls that bounce around.
    52 Plantera's Hook AI Moves forward briefly before latching onto a block.
    53 Plantera's Tentacle AI Acts very similar to the Plant AI, only bound to a certain entity.
    54 Brain of Cthulhu AI Doesn't adhere to gravity or tile collisions, and teleports occasionally in first form. Once all Creepers are killed, it will begin rapidly teleporting and moving toward the player.
    55 Creeper AI Circles around an entity, charging at player.
    56 Dungeon Spirit AI Moves directly towards player, gaining momentum. Emits blue-ish particles.
    57 Mourning Wood AI Moves towards player, stops, and fires projectiles straight at the player.
    58 Pumpking AI Very similar to the Head AI. Spawns with two Pumpking Scythes.
    59 Pumpking Scythe AI Very similar to the Hand AI.
    60 Ice Queen AI Flies around, shooting a barrage of ice-based projectiles.
    61 Santa-NK1 AI Moves across the ground, stops moving, and launches many different types of projectiles.
    62 Elf Copter AI Attempts to fly around the player, shooting bullets rapidly if they are in sight.
    63 Flocko AI Flies towards the player at high speed.
    64 Firefly AI Flies slowly in any direction and occasionally glows.
    65 Butterfly AI Flies slowly in any direction.
    66 Passive Worm AI Moves along the ground, pause for a bit, then continue moving. Will avoid walls and moves in the other direction if it has hit one.
    67 Snail AI Acts similarly to the Passive Worm AI, but climbs up walls instead of moving away.
    68 Duck AI Swims in water, or walks on land. Will fly away when a player is nearby, landing after a while.
    69 Duke Fishron AI Rams player multiple times before summoning entities. In second form, it flies in circles and summons entities.
    70 Detonating Bubble AI Flies through the air, chases player, and disappears after a period of time. Explodes and deals damage if it succeeds in reaching player.
    71 Sharkron AI Follows an arcing path, dies when it touches a wall or player.
    72 Bubble Shield AI Desktop VersionConsole VersionMobile Version Created by the Martian Officer, absorbs all damage dealt to the officer.
    73 Tesla Turret AI Desktop VersionConsole VersionMobile Version Built by Martian Engineers on the ground.
    74 Corite AI Desktop VersionConsole VersionMobile Version Travels through blocks, charges at the player.
    75 Rider AI Has a Rider and a corresponding mount, if one is destroyed the other keeps attacking.
    76 Martian Saucer AI Desktop VersionConsole VersionMobile Version Flies around the player, fires a Death Ray straight down, can only be damaged if all four turrets have been destroyed.
    77 Moon Lord Core AI Desktop VersionConsole VersionMobile Version Positions behind the player, invulnerable until the Moon Lord's head and hands are defeated.
    78 Moon Lord Hand AI Desktop VersionConsole VersionMobile Version Flees to the left and right of the player, opens and closes, fires Phantasmal Spheres, Phantasmal Eyes, and Phantasmal Bolts. Spawns True Eye of Cthulhu when health is depleted.
    79 Moon Lord Head AI Desktop VersionConsole VersionMobile Version Flies above the player, shoots a Phantasmal Deathray and then some Phantasmal Bolts, spawns True Eye of Cthulhu when defeated.
    80 Martian Probe AI Desktop VersionConsole VersionMobile Version Floats at a constant height, turns red and files away if the player gets near it, triggers the Martian Madness event if it gets off screen.
    81 True Eye of Cthulhu AI Desktop VersionConsole VersionMobile Version Flies around the Moon Lord, shoots Phantasmal Sphere, Phantasmal Deathray, Phantasmal Eye and Phantasmal Bolts at the player.
    82 Moon Leech Clot AI Desktop VersionConsole VersionMobile Version Travels from the player to the Moon Lord's head, heals part of the Moon Lord for 1000 HP if it reaches the mouth.
    83 Lunatic Devote AI Desktop VersionConsole VersionMobile Version Never moves, causes the Lunatic Cultist to spawn when all are killed.
    84 Lunatic Cultist AI Desktop VersionConsole VersionMobile Version Teleports around the player, fires shadow fireballs, ice mist, fireballs and lighting orbs. Creates duplicates of itself and summons Phantasm Dragons and Ancient Visions, triggers Lunar events when defeated.
    85 Star Cell/Brain Suckler AI Desktop VersionConsole VersionMobile Version Flies around the player, slowly floats towards them. Usually sticks to the player.
    86 Ancient Vision AI Desktop VersionConsole VersionMobile Version Flies around the player, does not adhere to gravity or tile collisions.
    87 Biome Mimic AI Desktop VersionConsole VersionMobile Version Passive until approached by the player. Attacks by jumping, dashing rapidly, and jumping into the air and slamming down on the player, ignoring block collision. Periodically "shuts" and becomes immune to damage and reflects projectiles in Expert Mode.
    88 Mothron AI Desktop VersionConsole VersionMobile Version Flies through blocks, lunges at the player, occasionally lays a Mothron Egg.
    89 Mothron Egg AI Desktop VersionConsole VersionMobile Version Doesn't move, spawns Baby Mothrons after a while.
    90 Baby Mothron AI Desktop VersionConsole VersionMobile Version Spawns from Mothron Eggs, flies, lunges at the player.
    91 Granite Elemental AI Desktop VersionConsole VersionMobile Version Floats towards the player, passing through tiles if the player is far enough. Drops to the ground when hurt in Expert mode.
    92 Target Dummy AI Desktop VersionConsole VersionMobile Version Stationary, recoils when damaged.
    93 Flying Dutchman AI Desktop VersionConsole VersionMobile Version Floats about the player, is defeated when all 4 cannons are destroyed.
    94 Celestial Pillar AI Desktop VersionConsole Version Bobs up and down in place, can only be damaged when 100 / 150 of its event enemies are defeated. Triggers Moon Lord to spawn when all 4 are defeated.
    95 Small Star Cell AI Desktop VersionConsole VersionMobile Version Remains stationary, eventually grows into a full sized star cell.
    96 Flow Invader AI Desktop VersionConsole VersionMobile Version Floats around the player, summons 3 orbiting minions, fires projectiles at the player.
    97 Nebula Floater AI Desktop VersionConsole VersionMobile Version Floats around the player, summons 3 orbiting minions, charges at the player and fires laser while teleporting.
    98 Unknown Currently, no NPCs follow this AI. Its specifics are unknown. n/a
    99 Solar Fragment AI Desktop VersionConsole VersionMobile Version Spawned from the "mouth" of the Solar Pillar. Shot upward on spawn and gradually falls down to the ground, destroyed on contact with blocks or the player.
    100 Ancient Light AI Desktop VersionConsole VersionMobile Version Fired in spreads of five by the Lunatic Cultist.
    101 Ancient Doom AI Desktop VersionConsole VersionMobile Version Spawned from Lunatic Cultist in Expert mode, fires 4 projectiles in a "+" shape when defeated/summoned.
    102 Sand Elemental AI Desktop VersionConsole Version Floats around, moving towards the player, and occasionally spawns three 'sandnados'. Gets faster the more it is damaged.
    103 Sand Shark AI Desktop Version Hides under sand (and its variants), occasionally dashes at the player.
    104 Unknown Currently, no NPCs follow this AI. Its specifics are unknown. n/a
    105 Eternia Crystal AI Desktop VersionConsole Version Stays still, targeted by Old One's Army monsters, ends the Old One's Army event if health reaches 0.
    106 Mysterious Portal AI Desktop VersionConsole Version Spawns Etherian enemies.
    107 Attacker AI Desktop VersionConsole Version Moves towards the Eternia Crystal to attack it, and floats through blocks if it can't reach the crystal.
    108 Flying Attacker AI Desktop VersionConsole Version Flies above the Eternia Crystal, pauses, and then dives for it. The cycle then repeats.
    109 Dark Mage AI Desktop VersionConsole Version Slowly moves towards the Eternia Crystal. Occasionally summons multiple Old One's Skeletons around it and heals enemies.
    110 Betsy AI Desktop VersionConsole Version AI behaves similarly to the Duke Fishron AI. Shoots fireballs and rarely sweeps over the crystal with Flame Breath.
    111 Etherian Lightning Bug AI Desktop VersionConsole Version AI behaves similarly to the Hovering AI. Shoots lightning below it repeatedly.
    n/a Lepus AI 3DS Version Jumps similarly to King Slime, generates entities while on the ground.
    n/a Ocram AI Old-gen console version3DS Version Flies around, spawns minions, shoots lasers, and charges at the player.
    n/a Turkor the Ungrateful AI 3DS Version Body does not move; heads lunge at the player. Occasionally spawns more heads.