Terraria Wiki

  • Discussions are now available on the Terraria Wiki.
  • Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.

READ MORE

Terraria Wiki
Advertisement
See also: NPC despawning

In Terraria, enemies, critters, and other NPCs will spawn off-screen and enter the screen area based on their AI. The rate at which enemies are spawned, the maximum number of enemies, and the type of enemies spawned are all dependent on the time of day, biome, the tile type of the ground, and other factors.

Spawn rates[]

Basics[]

The game determines new enemy spawns every tick.[1] There are two variables it takes into consideration when doing so: spawn rate and max spawns, with the spawn rate setting the chance of an enemy spawning at each tick, and the max spawns limiting the number of enemies that are active at a time.[2]

The default spawn rate is 1/600.[3] This means that for each tick, there is a chance of 1/600 that an enemy is spawned. Since there are 60 ticks in 1 second, there is a 9.52% chance that at least one enemy will spawn in a given second.

The default max spawns is 5.[4] This means that a new enemy can only be spawned if the sum of the NPC slots of all current active enemies is lower than 5. Most enemies occupy 1 NPC slot by default; see the following table for a list of all enemies with a higher or lower number of NPC slots. Active enemies exclude many enemies considered part of the same enemy, for example, body and tail parts of worms, because a Giant Worm, which has 6–8 segments (i.e. individual enemies), would otherwise occupy a disproportionate number of NPC slots. Town NPCs are not considered active NPCs for the purposes of NPC spawning. See the following table for a list of enemies that are not considered active.

 NPCs with non-default NPC slots 
Maximum number of loops have been performed
NPC NPC slots
Stingy Hornet Big Stingy Hornet 1.21
Stingy Hornet Little Stingy Hornet 0.87
Spikey Hornet Big Spikey Hornet 1.16
Spikey Hornet Little Spikey Hornet 0.78
Leafy Hornet Big Leafy Hornet 1.1
Leafy Hornet Little Leafy Hornet 0.92
Honey Hornet Big Honey Hornet 1.15
Honey Hornet Little Honey Hornet 0.8
Fatty Hornet Big Fatty Hornet 1.25
Fatty Hornet Little Fatty Hornet 0.85
Raincoat Zombie Big Raincoat Zombie 1.1
Raincoat Zombie Small Raincoat Zombie 0.9
Pantless Skeleton Big Pantless Skeleton 1.15
Pantless Skeleton Small Pantless Skeleton 0.85
Misassembled Skeleton Big Misassembled Skeleton 1.13
Misassembled Skeleton Small Misassembled Skeleton 0.87
Headache Skeleton Big Headache Skeleton 1.07
Headache Skeleton Small Headache Skeleton 0.93
Skeleton Big Skeleton 1.1
Skeleton Small Skeleton 0.9
Female Zombie Big Female Zombie 1.05
Female Zombie Small Female Zombie 0.87
Demon Eye Demon Eye (Variant 2) 1.15
Purple Eye Purple Eye (Variant 2) 1.1
Green Eye Green Eye (Variant 2) 0.85
Dilated Eye Dilated Eye (Variant 2) 0.9
Sleepy Eye Sleepy Eye (Variant 2) 1.1
Cataract Eye Cataract Eye (Variant 2) 1.15
Twiggy Zombie Big Twiggy Zombie 1.08
Twiggy Zombie Small Twiggy Zombie 0.92
Swamp Zombie Big Swamp Zombie 1.13
Swamp Zombie Small Swamp Zombie 0.87
Slimed Zombie Big Slimed Zombie 1.11
Slimed Zombie Small Slimed Zombie 0.89
Pincushion Zombie Big Pincushion Zombie 1.13
Pincushion Zombie Small Pincushion Zombie 0.93
Bald Zombie Big Bald Zombie 1.15
Bald Zombie Small Bald Zombie 0.85
Zombie Big Zombie 1.1
Zombie Small Zombie 0.9
Crimslime Big Crimslime 1.15
Crimslime Little Crimslime 0.85
Crimera (animated) Big Crimera 1.15
Crimera (animated) Little Crimera 0.85
Moss Hornet Giant Moss Hornet 1.8
Moss Hornet Big Moss Hornet 1.65
Moss Hornet Little Moss Hornet 1.35
Moss Hornet Tiny Moss Hornet 1.2
Hornet Big Stinger 1.2
Hornet Little Stinger 0.85
Armored Skeleton Heavy Skeleton 2
Angry Bones 1 Big Boned 2
Eater of Souls Big Eater 1.15
Eater of Souls Little Eater 0.85
Eye of Cthulhu (Phase 1) Eye of Cthulhu 5
Devourer Head Devourer Head 3.5
Eater of Worlds Head Eater of Worlds Head 5
Mother Slime Mother Slime 2
Fire Imp Fire Imp 3
Dark Caster Dark Caster 2
Cursed Skull Cursed Skull 0.75
Skeletron Head Skeletron Head 6
Bone Serpent Head Bone Serpent Head 6
Cave Bat Cave Bat 0.5
King Slime King Slime 5
Jungle Bat Jungle Bat 0.5
Piranha Piranha 0.5
Hellbat Hellbat 0.5
Demon Demon 2
Voodoo Demon Voodoo Demon 2
Spike Ball Spike Ball 0.3
Dungeon Slime Dungeon Slime 2
Blazing Wheel Blazing Wheel 0.3
Bird (NPC) Bird 0.4
Wyvern Head Wyvern Head 5
Giant Bat Giant Bat 0.5
World Feeder Head World Feeder Head 3.5
Angler Fish Angler Fish 0.5
Wall of Flesh Wall of Flesh 10
Retinazer Retinazer 5
Spazmatism Spazmatism 5
Skeletron Prime Skeletron Prime 6
The Destroyer Head The Destroyer Head 5
 NPCs that are never considered active 

Natural spawn rates[]

Key
1/x: spawn rate
y: max spawns

Spawn rate and max spawns have set values, which are different depending on the environment. They are formally defined for the environments mentioned in the following tables. Events that are not listed usually employ separate mechanisms to control spawn rates; bosses usually occupy enough NPC slots to block most other spawns.

Pre-Hardmode[]

Biome/Event/
Boss fight
Surface Underground Cavern Underworld
Day Night Blood Moon[5]

ForestForest

DesertDesert

Snow biomeSnow biome[6]

1/600
5
1/360
6
1/108
10
1/300
8
1/240
9
1/600
10
JungleJungle 1/240
7
1/144
9
1/60
15
1/120
12
1/96
13
n/a

The CorruptionCorruption

The CrimsonCrimson

1/390
6
1/234
7
1/70
13
1/195
10
1/156
11
n/a
DungeonDungeon n/an/an/a1/90
14
1/72
15
n/a
Meteorite (biome)Meteorite[7] 1/240
5
1/144
6
1/60
11
1/120
8
1/96
9
n/a
SandstormSandstorm 1/540
6
1/324
7
1/97
12
n/an/an/a
Underground DesertUnderground
Desert
1/120
15
1/72
15
1/60
15
1/60
15
1/60
15
n/a
Goblin ArmyGoblin Army 1/20
10 + 1.5 per player
n/a n/a n/a
Wall of FleshWall of
Flesh
fight
n/a n/a n/a n/a n/a 1/1800
3
The HallowHallow[8] 1/600
5
1/360
6
1/108
10
1/300
8
1/156
11
n/a

Hardmode[]

Biome/Event/
Boss fight
Surface Underground Cavern Underworld
Day Night Blood Moon[5]

ForestForest

DesertDesert

Snow biomeSnow biome[6]

1/540
6
1/324
7
1/97
12
1/243
10
1/216
11
1/540
12
JungleJungle 1/216
9
1/129
10
1/60
15
1/97
15
1/86
15
n/a

The CorruptionCorruption

The CrimsonCrimson

1/351
7
1/210
9
1/63
15
1/157
13
1/140
14
n/a
DungeonDungeon n/an/an/a1/72
15
1/64
15
n/a
Meteorite (biome)Meteorite[7] 1/216
6
1/129
7
1/60
13
1/97
11
1/86
12
n/a
SandstormSandstorm 1/216
9
1/129
10
1/60
15
n/an/an/a
Underground DesertUnderground
Desert
1/108
15
1/64
15
1/60
15
1/60
15
1/60
15
n/a

Goblin ArmyGoblin Army

Frost LegionFrost Legion

Pirate InvasionPirate Invasion

Martian MadnessMartian
Madness

Lunar EventsLunar Events

1/20
10 + 1.5 per player
n/a n/a n/a
Wall of FleshWall of
Flesh
fight
n/a n/a n/a n/a n/a 1/1620
3
The HallowHallow 1/540
6
1/324
7
1/97
12
1/243
10
1/140
14
n/a

Additionally, the spawn rate will be modified by the number of active enemies in the area. The fewer active enemies there are, the faster new ones will spawn:

  • If the sum of the NPC slots of all active enemies is lower than 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.6.
  • If the sum of the NPC slots of all active enemies is lower than 40% and greater than or equal to 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.7.
  • If the sum of the NPC slots of all active enemies is lower than 60% and greater than or equal to 40% of max spawns, the denominator of the spawn rate will be multiplied by 0.8.
  • If the sum of the NPC slots of all active enemies is lower than 80% and greater than or equal to 60% of max spawns, the denominator of the spawn rate will be multiplied by 0.9.

(Note that all products are rounded down to the nearest integer.)

The following table lists some examples for this mechanic. It is to be read in the following way: If the natural spawn rate and max spawns (as determined from the overview above) and sum of the NPC slots of all active enemies are equal to the values in the first three columns, then the spawn rate is altered as shown in the last column.

Spawn rate Max spawns NPC slots sum Altered spawn rate
1/600 6 0.8
(13.3% of max spawns)
1/360
1/173 15 10
(66.7% of max spawns)
1/155
1/430 12 10
(83.3% of max spawns)
1/430

Manual alteration of spawn rates[]

Certain items can be used to change the spawn rate and max spawns when used or placed, as per the following table. All effects are multiplicative rather than additive.

Item Spawn rate factor[9] Effective spawn rate Max spawns
Water CandleWater Candle(also if held) 1/0.75 +33% +50%
Battle PotionBattle Potion 1/0.5 +100% +100%
Calming PotionCalming Potion 1/1.3 −23% −30%
SunflowerSunflower 1/1.2 −17% ( only) −20%
Peace CandlePeace Candle(also if held) 1/1.3 −23% −30%
Invisibility PotionInvisibility Potion( only) 1/1.2 −17% −20%

These effects do not stack with themselves, i.e., a single Water Candle, Peace Candle, or Sunflower has the same effect as multiple of each one.

Water and Peace Candles cancel each other out, even though they do not alter spawn rates by the same absolute values. If both are active (e.g. a Peace Candle is held while a Water Candle is placed nearby), none is applied.

There is one exception to this: Water Candles placed (explicitly not held) in Space[10] always increase spawn rates, regardless of nearby Peace Candles. Their effectiveness depends on nearby Peace Candles, however:

Item Spawn rate factor[9] Effective spawn rate Max spawns
Water CandleWater Candleplaced in Space
(with no Peace Candle held or placed nearby)
1/0.375 +167% +50%
Water CandleWater Candleplaced in Space
(with a Peace Candle held or placed nearby)
1/0.5 +100% +50%

In addition, nearby Fairies have the same effect as Sunflowers and Invisibility Potions, reducing the effective spawn rate by 17% and decreasing the max spawns by 20%.

Up to this point, spawn rates cannot be increased to fractions greater than 1/60 and max spawns cannot be increased to values greater than 15. Both will be cut off there. The spawn rates and max spawns of the invasion events listed in the tables above are exempt from this. There is no lower limit for spawn rates and max spawns.

Effect of town NPCs on spawn rates[]

The presence of nearby town NPCs generally reduces spawn rates and max spawns. This effect is adjusted in the Underworld and in Graveyards.

Anywhere in the world above the Underworld ( except in a Graveyard)
Number of
nearby town NPCs
Spawn rate factor[9] Effective spawn rate Max spawns
1 1/1.5 −33% −13%
2 1/(9/7) −22% −27%
≥3 n/a n/a −40%
In the Underworld
Number of
nearby town NPCs
Spawn rate factor[9] Effective spawn rate Max spawns
1 1/(50/41) −18% −5%
2 1/(15/11) −27% −10%
≥3 1/1.8 −44% −17%
In a Graveyard
Number of
nearby town NPCs
Spawn rate factor[9] Effective spawn rate Max spawns
1 1/1.66 −40% −4%
2 1/2.33 −57% −7%
≥3 1/3 −66% −13%

When 3 or more town NPCs or the Skeleton Merchant are present nearby, no enemies will spawn. This is only valid for areas outside of the Underworld and Graveyards, and only for Classic worlds – in Expert Mode, there is still a 3.33*1/30 (3.33%) chance an enemy may spawn that tick. Enemies from events as well as bosses (and their servants) will bypass this restriction.

Journey Mode[]

Spawn rates can be manually altered in Journey Mode, from 0× (disabling spawns) to 10× the normal rate. Even with the spawn rate set to 0×, bosses may still be summoned, mining up Tombstones can still cause Ghosts to spawn, and certain Celestial enemies can spawn.

Spawn locations[]

Each player in the game will spawn their own enemies. If two players are in the same area, monsters will appear twice as fast as they would with only one player. Max Spawns rule are still used, which means that even if 2 players are in the same spot, you cannot gather 30 normal monsters near the spot. (Don't forget, the bats count as 1/2, and some special enemies count as 2 or more.)

Choosing a spot to spawn the enemy[]

Terraria Spawn Area

Spawn area illustration (status 2014)

Verify When the game decides to spawn an enemy, it will first choose a random tile within a rectangle around the player (specifically, the tile containing the top left corner of the player's hitbox). The maximum distance from the player it can choose from is 84 tiles east, 83 west, 46 up, and 45 down. If the picked tile is a solid block, it will try another one. Tiles that are actuated out do not count as solid. If the picked tile has a player-placed wall that blocks enemies from spawning, it will also try another tile.

Once an empty tile is found, it moves down until it finds the ground. (Note that this tile can be more than 45 tiles below from the player. If it finally is outside the "Active Rectangle" it will be instantly despawned, anyway.) If there is enough space for an enemy to be spawned at this location, this will be the tile it chooses. The exception to this is when the player is in an area where Harpies and many other flying enemies can be spawned. In this case, the game does not attempt to find a ground tile.

The chosen tile is then checked to make sure it is not within the "safe" area around the player. It cannot be within 62 tiles east or west, or 34 tiles up or down. Also, the chosen tile space must be completely outside 2088 × 1172 pixel rectangles centered on the center of each player's hitbox. (If the player is not riding a mount, the top edge of this is 34 + 3/16 tiles above the top left corner tile mentioned above, meaning that NPCs can spawn on ground exactly 35 tiles above a player standing on half blocks, but not a player standing on full blocks.)

Using certain items causes monsters to spawn further out than normal. Equipping a Rifle Scope or Sniper Scope does so only when the player has a compatible gun selected, whether or not the player is zoomed out.

Items Spawn range Safe range
Horizontal Vertical Horizontal Vertical
Normal 84 46 62 34
Rifle Scope (or derivatives) 114 62 92 50
Binoculars 124 68 102 56
Sniper Rifle 124 68 102 56
Sniper Rifle with Rifle Scope (or derivatives) 132 72 110 60

Note : If using the Depth Meter, Compass, or similar, each tile is equal to 2 feet, so double all measurements to get distances in feet

On the Mobile version Mobile version (pre-1.4 only), the no-spawn area around the player is 68 by 48 tiles, and the spawn area is 112 by 62 tiles. In addition, enemies cannot spawn closer than 34 tiles to the sides and 24 tiles up and down. They also cannot spawn farther than 56 tiles to the sides and 31 tiles up and down.

Choosing a type of enemy to spawn[]

The type of enemy spawned will depend on many factors including, but not limited to:

Notes[]

  • When standing on the left or right edge of the world, the enemies can spawn on screen, as long they are at least 62 tiles from the player. The screen is around 85 blocks wide, so in this case the enemies can spawn in the farthest quarter of the screen. (This may not necessarily be the case, some players have larger screens, as big as 120 blocks wide).
  • Equipping Binoculars does make the active rectangle bigger.

History[]

  • Desktop 1.4.0.1:
    • Added the following enemies to the list of NPCs that are never considered active: Skeletron Hand, Prime Cannon, Prime Saw, Prime Vice, Prime Laser, Martian Saucer, Martian Saucer Turret, Martian Saucer Cannon, and Dutchman Cannon.
    • Increased the natural spawn rates and max spawns in the Dungeon:
      • Increased spawn rates in the Underground layer from 1/120 (pre-Hardmode) and 1/97 (Hardmode) to 1/90 (pre-Hardmode) and 1/72 (Hardmode).
      • Increased spawn rates in the Cavern layer from 1/96 (pre-Hardmode) and 1/86 (Hardmode) to 1/72 (pre-Hardmode) and 1/64 (Hardmode).
      • Increased max spawns in the Underground layer in pre-Hardmode from 13 to 14.
    • Increased the natural spawn rates and max spawns in the Underground Desert:
      • Increased spawn rates on the surface during the day in pre-Hardmode from 1/180 to 1/120.
      • Increased spawn rates on the surface during the night in pre-Hardmode from 1/108 to 1/72.
      • Increased spawn rates in the Underground layer in pre-Hardmode from 1/90 to 1/60.
      • Increased spawn rates in the Cavern layer in pre-Hardmode from 1/72 to 1/60.
      • Increased max spawns on the surface to 15. The old max spawns were 10 (pre-Hardmode) / 12 (Hardmode) during the day, and 12 (pre-Hardmode) / 14 (Hardmode) during the night. Max spawns in the Underground Desert are now 15 at all times and under all conditions.
  • Desktop 1.2.4: Fixed bug where spawn rates would increase underground when a moon event is happening.
  • Desktop 1.2.3: Fixed bug where spawn rates were higher than intended everywhere rather than when below the middle of dirt layer.

References[]

  1. A tick is a time unit countable by the software. Most of Terraria's updating logic happens every tick. A tick has the length of 1/60th of a second, hence there are 60 ticks in a second and 3600 ticks in a minute.
  2. Information taken from the PC version PC 1.4.2.3 source code, method SpawnNPC() in Terraria.NPC.cs. There may be inaccuracies, as the current PC version PC version is 1.4.4.9.
  3. Information taken from the PC version PC 1.4.2.3 source code, field defaultSpawnRate in Terraria.NPC.cs. There may be inaccuracies, as the current PC version PC version is 1.4.4.9.
  4. Information taken from the PC version PC 1.4.2.3 source code, field defaultMaxSpawns in Terraria.NPC.cs. There may be inaccuracies, as the current PC version PC version is 1.4.4.9.
  5. 5.0 5.1 Blood Moons only affect the spawn rates above the surface.
  6. 6.0 6.1 Weather additionally affects spawn rates and max spawns in the Snow biome.
  7. 7.0 7.1 Only applied if the Meteorite biome does not overlap with the Dungeon, the Underground Desert, the Desert during a Sandstorm, the Jungle, or the evil biomes. If it does overlap with any of those biomes, then the overlapping biome's spawn rate and max spawns are used.
  8. If artificially created.
  9. 9.0 9.1 9.2 9.3 9.4 The product of the denominators is rounded down to the nearest integer.
  10. More precisely, above an altitude of 65% between the surface line and the top of the world, i.e. the same area where Space-exclusive enemies spawn in pre-Hardmode. See Space § Notes.
Advertisement