NPC spawning
In Terraria, enemies, critters, and other NPCs will spawn off-screen and enter the screen area based on their AI. The rate at which NPCs are spawned, the maximum number of NPCs, and the type of NPCs spawned are all dependent on the time of day, biome, the tile type of the ground, and other factors.
Note that for the purpose of NPC spawning, the term "friendly town NPCs" includes all friendly NPCs that can move into houses, Traveling Merchant, Old Man, and town pets(Desktop, Console and Mobile versions), but does not include the Skeleton Merchant(Desktop, Console and Mobile versions).
Spawn limits
The number of NPCs that can exist at the same time is capped at 200.[1] Each NPC instance existing in the world (including friendly NPCs) will occupy one of the 200 slots.
When Moon Lord is alive, no NPCs will be spawned for players that are less than 281.25 tiles from the Moon Lord's Core.[2]
When all NPC slots are occupied and there is a new NPC spawn attempt, the game will check for "replaceable" NPCs. If there is a replaceable NPC, that NPC will be directly replaced with the spawning NPC. If no replaceable NPCs exist, the spawn attempt will fail and do nothing.[3]
The following types of NPC are considered replaceable:[4]
- Bees spawned by the Queen Bee.
- NPCs spawned by statues.
- Explosive Bunnies spawned by the Bunny Cannon via wire.
Spawn rates
Basics
The game determines new NPC spawns every tick.[5] 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 NPC spawning at each tick, and the max spawns limiting the number of NPCs that are active at a time.[6]
The default spawn rate is 1/600.[7] This means that each tick, there is a chance of 1/600 (0.17%) that an NPC is spawned. Since there are 60 ticks in 1 second, there is a 9.52% chance that at least one NPC will spawn in a given second.
Additional notes:[10]
- During a Slime Rain, Blue Slimes and any of the variants that share the primary NPC ID value of 1 (Jungle Slime, Yellow Slime, Red Slime, Purple Slime, Black Slime, Baby Slime, Pinky, and Green Slime) will have their effective NPC count multiplied by 0.65.
- Friendly town NPCs are not counted into the effective NPC count.
- Critters released by players are not counted into the effective NPC count.
- Probes are considered inactive when the Destroyer exists.
- Certain Old One's Army enemies are considered inactive only when a Mysterious Portal exists (see table below).
|
The following NPCs are considered inactive only when a Mysterious Portal exists |
---|
|
Natural spawn rates
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 have high effective NPC counts to block most other spawns.
Pre-Hardmode
Biome/Event/ Boss fight |
Surface | Underground | Cavern | Underworld | ||
---|---|---|---|---|---|---|
Day | Night | [b] | ||||
1/600 5 | 1/360 6 | 1/108 10 | 1/300 8 | 1/240 9 |
1/600 10 | |
Jungle(no friendly town NPCs nearby)[d] | 1/240 7 | 1/144 9 | 1/43[e] 15 | 1/120 12 | 1/96 13 | n/a |
Jungle(1 friendly town NPC nearby)[f] | 1/330 7 | 1/198 8 | 1/59[e] 14 | 1/165 11 | 1/132 12 | n/a |
Jungle(2 friendly town NPCs nearby)[f] | 1/420 6 | 1/251 7 | 1/75 13 | 1/210 10 | 1/168 11 | n/a |
Jungle(3 or more friendly town NPCs nearby)[f] | 1/510 6 | 1/306 7 | 1/91 12 | 1/255 9 | 1/204 10 | n/a |
1/390 6 | 1/234 7 | 1/70 13 | 1/195 10 | 1/156 11 | n/a | |
Dungeon | n/a | n/a | n/a | 1/90 14 | 1/72 16[g] | n/a |
Meteorite[h] | 1/240 5 | 1/144 6 | 1/43[e] 11 | 1/120 8 | 1/96 9 | n/a |
Jungle Temple[i] | 1/480 6 | 1/288 7 | 1/86 12 | 1/240 9 | 1/192 10 | n/a |
Sandstorm(Desktop, Console and Mobile versions) | 1/540 6 | 1/324 7 | 1/97 12 | n/a | n/a | n/a |
Underground Desert(Desktop, Console and Mobile versions) | 1/120 15 | 1/72 18[g] | 1/21[e] 30[g] | 1/60 24[g] | 1/48[e] 27[g] | n/a |
Goblin Army | 1/20 10 + 1.5 per player |
n/a | n/a | n/a | ||
Wall of Flesh fight |
n/a | n/a | n/a | n/a | n/a | 1/1800 3 |
Hallow[j] | 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 | [b] | [k] | ||||
1/540 6 | 1/324 7 | 1/97 12 | 1/108 11 | 1/243 10 | 1/216 11 |
1/540 12 | |
Jungle(no friendly town NPCs nearby)[d] | 1/216 9 | 1/129 10 | 1/38[e] 18[g] | 1/43[e] 16[g] | 1/97 15 | 1/86 16[g] | n/a |
Jungle(1 friendly town NPC nearby)[f] | 1/297 8 | 1/178 9 | 1/53[e] 16[g] | 1/59[e] 15 | 1/133 14 | 1/118 15 | n/a |
Jungle(2 friendly town NPCs nearby)[f] | 1/378 7 | 1/226 9 | 1/67 15 | 1/75 14 | 1/170 13 | 1/151 14 | n/a |
Jungle(3 or more friendly town NPCs nearby)[f] | 1/459 7 | 1/275 8 | 1/82 14 | 1/91 13 | 1/206 12 | 1/183 13 | n/a |
1/351 7 | 1/210 9 | 1/63 15 | 1/70 14 | 1/157 13 | 1/140 14 | n/a | |
Dungeon | n/a | n/a | n/a | n/a | 1/72 18[g] | 1/64 19[g] | n/a |
Meteorite[h] | 1/216 6 | 1/129 7 | 1/38[e] 13 | 1/43[e] 12 | 1/97 11 | 1/86 12 | n/a |
Jungle Temple[i] | 1/432 7 | 1/259 8 | 1/77 14 | 1/86 13 | 1/194 12 | 1/172 13 | n/a |
Sandstorm(Desktop, Console and Mobile versions) | 1/216 9 | 1/129 10 | 1/38[e] 18[g] | 1/43[e] 16[g] | n/a | n/a | n/a |
Underground Desert(Desktop, Console and Mobile versions) | 1/108 18[g] | 1/64 21[g] | 1/19[e] 36[g] | 1/21[e] 33[g] | 1/48[e] 30[g] | 1/43[e] 33[g] | n/a |
Martian Lunar Events(Desktop, Console and Mobile versions) |
1/20 10 + 1.5 per player |
n/a | n/a | n/a | |||
Wall of Flesh fight |
n/a | n/a | n/a | n/a | n/a | n/a | 1/1620 3 |
Hallow | 1/540 6 | 1/324 7 | 1/97 12 | 1/108 11 | 1/243 10 |
1/157 13 |
n/a |
Additionally, the spawn rate will be modified by the number of active NPCs in the area. The fewer active NPCs there are, the faster new ones will spawn:
- If effective NPC count of all active NPCs is lower than 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.6.
- If effective NPC count of all active NPCs is lower than 40% and greater or equal 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.7.
- If effective NPC count of all active NPCs is lower than 60% and greater or equal 40% of max spawns, the denominator of the spawn rate will be multiplied by 0.8.
- If effective NPC count of all active NPCs is lower than 80% and greater or equal 60% of max spawns, the denominator of the spawn rate will be multiplied by 0.9.
(Note that all products are rounded down if they are decimals.)
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 effective NPC count of all active NPCs 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 | Effective NPC count | 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 |
A second pass of this is performed if the player is in The Corruption or The Crimson or below the vertical center of the Underground layer:
- If effective NPC count of all active NPCs is lower than 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.7.
- If effective NPC count of all active NPCs is lower than 40% and greater or equal 20% of max spawns, the denominator of the spawn rate will be multiplied by 0.9.
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.[11] All effects are multiplicative rather than additive.
Item | Spawn rate factor[l] | Effective spawn rate | Max spawns |
---|---|---|---|
Water Candle(also if held) | 1/0.75 | +33% | +50% |
Battle Potion | 1/0.5 | +100% | +100% |
Calming Potion | (Desktop, Console and Mobile versions) 1/1.65 (Old-gen console and 3DS versions) 1/1.2 |
(Desktop, Console and Mobile versions) −39% (Old-gen console and 3DS versions) −17% |
(Desktop, Console and Mobile versions) −40% (Old-gen console and 3DS versions) −20% |
Sunflower((Desktop, Console and Mobile versions) only) | 1/1.2 | −17% | −20% |
Peace Candle(Desktop, Console and Mobile versions)(also if held) | 1/1.3 | −23% | −30% |
Invisibility Potion((Desktop, Console and Mobile versions) only) | 1/1.2 | −17% | −20% |
Angler armor(set bonus; (Desktop, Console and Mobile versions) only) | 1/1.3 | −23% | −30% |
Fairy(Desktop, Console and Mobile versions)(having at least one Fairy within 120 tiles) |
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.
On the Old-gen console version and Nintendo version, placed and held Water Candles stack with each other.
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.
On Desktop, Console, and Mobile, there is one exception to this: Water Candles placed (explicitly not held) in Space[m] always increase spawn rates, regardless of nearby Peace Candles. Their effectiveness depends on nearby Peace Candles, however:
Item | Spawn rate factor[l] | Effective spawn rate | Max spawns |
---|---|---|---|
Water Candleplaced in Space(with no Peace Candle held or placed nearby) | 1/0.375 | +167% | +50% |
Water Candleplaced in Space(with a Peace Candle held or placed nearby) | 1/0.5 | +100% | +50% |
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 friendly town NPCs on spawn rates
The presence of nearby friendly town NPCs generally reduces spawn rates and max spawns.[12] All friendly town NPCs within a 240×135-tile rectangle centered on the player are considered.[13]
On Desktop, Console, and Mobile, this effect is adjusted in the Underworld and in Graveyards.
These effects are greatly reduced when the player is in range of any invasion.
None of these effects will apply under any of these circumstances:
- The player has the Shadow Candle(Desktop, Console and Mobile versions) debuff or holding a Shadow Candle.
- The player is in the Corruption, the Crimson, Dungeon, the Meteorite biome.
- The player is within range of a Celestial Pillar, Old One's Army.
- Any of the following events are active: Blood Moon, Pumpkin Moon, Frost Moon, or Solar Eclipse.
When there are friendly town NPCs nearby, the player is considered as in front of safe walls. However, this effect is not guaranteed if the player is in Underworld ("safe wall chance" in the following table). They also increases the chance for using a special critter spawning pool ("critter chance" in the following table) instead of the ordinary spawning pool (which is a mixture of enemies and critters). If that happens, the max spawn will be reduced, otherwise the spawn rate will be reduced.
Number of nearby friendly town NPCs |
Safe wall chance | Critter chance | Critter max spawns |
Spawn rate [l][n] | Effective spawn rate[o] |
---|---|---|---|---|---|
1 | 100% | 1/3 (33.33%) | 60% | 1/2 (50%) | 1/3 (33.33%) [p] |
2 | 100% | 2/3 (66.67%) | 60% | 1/3 (33.33%) | 1/9 (11.11%) [q] |
≥3 | 100% | 100% [r] | 60% | 1 [s] | 0 [t] |
Number of nearby friendly town NPCs |
Safe wall chance | Critter chance | Critter max spawns |
Spawn rate [l][n] | Effective spawn rate [o] |
---|---|---|---|---|---|
1 | 1/2 (50%) | 1/10 (10%) | 50% | 1/1.25 (80%) | 18/25 (72%) [u] |
2 | 3/4 (75%) | 1/5 (20%) | 50% | 1/1.5 (66.67%) | 8/15 (53.33%) [v] |
≥3 | 9/10 (90%) | 1/3 (33.33%) | 50% | 1/2 (50%) | 1/3 (33.33%) [w] |
Number of nearby friendly town NPCs |
Safe wall chance | Critter chance | Critter max spawns |
Spawn rate[l][x] | Effective spawn rate[o] |
---|---|---|---|---|---|
1 | 100% | 1/9 (11.11%) | 60% | 1/1.66 (60.24%) | 8/15 (53.33%) [y] |
2 | 100% | 1/6 (16.67%) | 60% | 1/2.33 (42.92%) | 5/14 (35.71%) [z] |
≥3 | 100% | 1/3 (33.33%) | 60% | 1/3 (33.33%) | 2/9 (22.22%) [aa] |
When 3 or more friendly town NPCs are present nearby, a town(Desktop, Console and Mobile versions) mini-biome is formed and no enemies will spawn. This is only valid for areas outside of the Underworld and Graveyards, and only for Classic worlds – in Expert Mode(Desktop, Console and Mobile versions), there is still a 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(Desktop, Console and Mobile versions), 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 Pillar enemies can spawn.
Spawn locations
Each player in the game will spawn their own NPCs. If two players are in the same area, NPCs 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, it is impossible to gather 30 normal NPCs near the spot. Note that some NPCs count as more than or less than 1 NPC. See above for details.
Choosing a spot to spawn the NPC
When the game decides to spawn an NPC, 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 west, 83 east, 46 up, and 45 down. [14]
Using certain items causes NPCs 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 its upgrades) | 114 | 62 | 92 | 50 |
Binoculars | 124 | 68 | 102 | 56 |
Sniper Rifle | 124 | 68 | 102 | 56 |
Sniper Rifle with Rifle Scope (or its upgrades) | 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
The game then starts checking whether the chosen tile is valid for spawning:
If the tile chosen is a solid tile (includes all solid blocks, platforms, Planter Boxes, and Bubble)[15], or it has a safe wall that blocks enemies from spawning, the attempt is considered invalid. Tiles that are actuated out do not count as solid.
After that, the game checks the 2×3 area above the chosen tile to see if there is enough space for spawning. If any of the 6 tiles are outside of the true world border, solid, or contains lava, the attempt is considered invalid. Note that the area is 1 tile left of the chosen tile as shown in the image.
The process described above will repeat at most 50 times to find a valid spawning tile. However, the attempt may still fail for the following reasons (there will be no retrying in these cases):
- The chosen tile space must be completely outside 2088×1172-pixel rectangles centered on the center of each player's hitbox.[af]
- When the the player is in Dungeon, the chosen tile must be a Dungeon Brick with a wall above it (any wall will meet the requirement, even safe walls).[ag]
- When the two tiles right above the chosen tile contain liquid, the liquid must be water.[ah]
- When the chosen tile is Mowed grass or Mowed Hallowed grass, there is a 1/10 (10%) chance for the spawning to fail if none of the following events are active: Blood Moon, Solar Eclipse, Pumpkin Moon, Frost Moon, Slime Rain, and any invasion.
Choosing a type of NPC to spawn
After a valid tile has been chosen, the game will then determine what type of NPC should be spawned.
When choosing NPCs to spawn, enemies that can pass through solid blocks (e.g. Wyvern, Chaos Elemental, Floaty Gross, etc.) will not be chosen if the player is in front of any safe wall. This effect can be negated by the Shadow Candle(Desktop, Console and Mobile versions). However, these enemies will never be chosen if the player remains stationary[ai] for at least 5 seconds[16], regardless of wall and Shadow Candle.
Generally, the type of NPC spawned will depend on many factors including, but not limited to:
- Time of day
- Weather (e.g., Angry Nimbus and Ice Golem require Rain/Blizzard)
- Depth
- Distance east or west (Ocean NPCs, Martian Probes, Goblin Scouts, etc.)
- Player's current biome (Corruption, Meteor, Jungle, etc., in the case of most biome-specific flying NPCs)
- Tile the NPC spawns on (Jungle grass, Ebonstone, Marble, etc. in the case of most biome-specific grounded NPCs)
- Wall behind the player (Lihzahrd Brick Wall, Dungeon Brick Wall, etc.)
- Wall behind the NPC's spawn location (Dungeon Brick Wall variants)
- Special events (Blood Moon, Solar Eclipse, invasion events, etc)
- Randomness
Details
The following details describe the behavior of NPC spawning in worlds without the remixWorld
attribute[17] (i.e. some information below does not apply to Don't dig up and Get fixed boi worlds).
First, the game will check for certain environments used for spawning. This usually checks for the type of chosen tile (i.e. the ID of the tile) or other tiles near it, and the player's location. The check includes the following:
- Determine if Living Tree NPCs can spawn.
- The chosen tile and the two tiles above it are checked. Living Tree NPCs can spawn if at least one of them has an unsafe Living Wood Wall.
- Determine if Marble Cave or Granite Cave NPCs can spawn. The check ends when any of the following checks find a Marble Block or Granite Block.
|
- Determine if Spider Nest NPCs can spawn.
|
- Determine if Underground Desert NPCs can spawn (see Underground Desert § Spawning mechanics for details).
- Determine if Windy Day NPCs can spawn.
- The wind must be blowing from the spawning location to the player's location.
- Determine if Ocean NPCs can spawn.
|
Then, the game will determine the spawning tile. The check starts from the chosen tile and goes downwards and ends when a solid tile that is not a platform, Planter Box, or Conveyor Belt is found, to a maximum depth of 30 tiles below the chosen tile.[18] If no such tile is found, the chosen tile will be used as the spawning tile. The type of spawning tile will then be used for NPC spawning.
Finally, the type of NPC spawned will be determined by the player's current environment and spawning tile type. Below is a table of NPC types and conditions. Note that specific NPCs may have other restrictions to their spawning.
Source of NPC[aj] | Condition | |
---|---|---|
Solar Pillar |
| |
Vortex Pillar | ||
Nebula Pillar | ||
Stardust Pillar | ||
Space |
| |
Goblin Army |
| |
Frost Legion | ||
Pirate Invasion | ||
Martian Madness | ||
Living Tree |
| |
Unconscious Man |
| |
Spider Nest |
| |
Underground Desert |
| |
Arapaima | ||
Blood Jelly |
| |
Blood Feeder | ||
Ocean water |
| |
Sleeping Angler(extra spawn on Sand) |
| |
Jungle water(also Piranha and Angler Fish) |
| |
Underground water(Jellyfish) |
| |
Surface water |
| |
Bound Goblin |
| |
Bound Wizard |
| |
Old Shaking Chest |
| |
Critters |
| |
Dungeon |
| |
Meteorite biome |
| |
Frost Moon |
| |
Pumpkin Moon | ||
Solar Eclipse |
| |
Underground Fairies |
| |
Gnome(outside Living Tree) |
| |
Gnome(in front of Dirt Wall) |
| |
Fungo Fish |
| |
Surface Glowing Mushroom |
| |
Underground Glowing Mushroom |
| |
Corruption(Worm enemies) |
| |
Mimics(Don't dig up and Get fixed boi) |
| |
Mimics(Underground) | ||
Wooden Mimic | ||
Wraith | ||
Hoppin' Jack | ||
Doctor Bones |
| |
Lac Beetle |
| |
Worm |
| |
Gold Worm | ||
Mouse | ||
Gold Mouse | ||
Snail |
| |
Jungle birds |
| |
Jungle frogs |
| |
Hive block(Hornets, Moss Hornets) |
| |
Hardmode Jungle |
| |
Jungle Temple |
| |
Hive Wall(Hornets, Moss Hornets) |
| |
Underground Jungle |
| |
Jungle Bat |
| |
Snatcher | ||
Sandstorm |
| |
Mummy |
| |
Dark Mummy |
| |
Blood Mummy |
| |
Light Mummy |
| |
The Hallow |
| |
Enchanted Sword |
| |
Any Crimson biome |
| |
Any Corruption biome |
| |
Surface biomes |
| |
Underground |
| |
Ice Slime |
| |
The Underworld |
| |
Cavern |
| |
Rock Golem |
| |
Cyan Beetle | ||
Cochineal Beetle | ||
Chaos Elemental |
|
Notes
- When standing on the left or right visible world border, NPCs can spawn on screen, as long they are at least 62 tiles from the player.
History
- Desktop 1.4.4:
- Reduced the natural spawn rates and max spawns in the Jungle if there are friendly town NPCs nearby.
- Added separate spawn rate and max spawns values for the Jungle Temple.
- Increased the spawn rate reduction of the Calming Potion from 23% to 39% and its max spawns reduction from 30% to 40%.
- Desktop 1.4.0.1:
- Added the following NPCs 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.
- The Invisibility Potion now reduces spawn rates by 17% and max spawns by 20%.
- Desktop 1.3.0.1:
- Changed the effect of nearby friendly town NPCs on spawn rates and max spawns:
- The effect is now less intense in the Underworld.
- 1 nearby friendly town NPC now reduces spawn rates by 33% instead of 17% and reduces max spawns by 13% instead of 27%.
- 2 nearby friendly town NPCs now reduce spawn rates by 22% instead of 44% and reduce max spawns by 27% instead of 13%.
- Placed and held Water Candles no longer stack.
- Added an additional spawn rate increase for Water Candles placed in Space.
- Increased the spawn rate reduction of the Calming Potion from 17% to 23% and its max spawns reduction from 20% to 30%.
- Sunflowers now grant the Happy! buff, which reduces spawn rates by 17% and max spawns by 20%.
- Changed the effect of nearby friendly town NPCs on spawn rates and max spawns:
- 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
- ↑ Information taken from the Desktop 1.4.4.9 source code, field
npc
inTerraria.Main.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
MoonLordFightingDistance
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
NewNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
CanBeReplacedByOtherNPCs
inTerraria.NPC.cs
. - ↑ 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.
- ↑ Information taken from the Desktop 1.4.4.9 source code, method
SpawnNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
defaultSpawnRate
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
defaultMaxSpawns
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
npcSlots
inTerraria.NPC.cs
. Also mentioned as "enemy slot" in offical changelogs. - ↑ 10.0 10.1 Information taken from the Desktop 1.4.4.9 source code, methods
CheckActive()
inTerraria.NPC.cs
andDoesntDespawnToInactivity()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
SpawnNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
SpawnNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
AddIntoPlayersTownNPCSlots()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
SpawnNPC()
inTerraria.NPC.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
nactive()
inTerraria.Tile.cs
and fieldtileSolid
inTerraria.Main.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, method
AFKTimeNeededForNoWorms()
inTerraria.NPC.cs
and propertyIsStandingStillForSpecialEffects
inTerraria.Player.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, field
remixWorld
inTerraria.Main.cs
. - ↑ Information taken from the Desktop 1.4.4.9 source code, methods
SpawnNPC_TryFindingProperGroundTileType()
inTerraria.NPC.cs
andIsValidSpawningGroundTile()
inTerraria.NPC.cs
.
- ↑ Most inactive NPCs are NPCs that is considered part of another NPC, for example, body and tail parts of worms. Otherwise, a Giant Worm that has 6–8 segments (i.e. individual NPCs) would have a disproportionate number added to effective NPC count.
- ↑ 2.0 2.1 Blood Moons only affect the spawn rates above the surface.
- ↑ 3.0 3.1 Weather additionally affects spawn rates and max spawns in the Snow biome.
- ↑ 4.0 4.1 Nearby means within a 240×135-tile rectangle centered on the player.
- ↑ 5.00 5.01 5.02 5.03 5.04 5.05 5.06 5.07 5.08 5.09 5.10 5.11 5.12 5.13 5.14 5.15 5.16 Note that the spawn rate will be capped at 1/60; see below.
- ↑ 6.0 6.1 6.2 6.3 6.4 6.5 Nearby means within a 240×135-tile rectangle centered on the player. This is active even if the player has the Shadow Candle(Desktop, Console and Mobile versions) debuff, which otherwise nullifies the effect of friendly town NPCs on NPC spawning.
- ↑ 7.00 7.01 7.02 7.03 7.04 7.05 7.06 7.07 7.08 7.09 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17 7.18 Note that the max spawns will be capped at 15; see below.
- ↑ 8.0 8.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.
- ↑ 9.0 9.1 More precisely: If the player is standing in front of unsafe Lihzahrd Brick Walls (wall ID 87), i.e. also in the entrance area of the temple.
- ↑ If artificially created.
- ↑ Solar Eclipses only affect the spawn rates above the surface.
- ↑ 12.0 12.1 12.2 12.3 12.4 12.5 The product of the denominators is rounded down if it is a decimal.
- ↑ 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.
- ↑ 14.0 14.1 This only applies if not using the critter spawning pool.
- ↑ 15.0 15.1 15.2 Here we only count enemy spawns and do not count critter spawns, so this value indicates how "safe" a town is.
- ↑ There is a 1/3 (33.33%) chance for not try to spawn enemies at all and 2/3 (66.67%) chance to try with 1/2 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{2}{3} * \frac{1}{2}= \frac{1}{3} }[/math].
- ↑ There is a 2/3 (66.67%) chance for not try to spawn enemies at all and 1/3 (33.33%) chance to try with 1/3 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{1}{3} * \frac{1}{3}= \frac{1}{9} }[/math].
- ↑ 29/30 (96.67%) in Expert Mode(Desktop, Console and Mobile versions)
- ↑ The spawn rate is untouched here, but since critters are always spawned, this value is completely irrelevant.
- ↑ 20.0 20.1 20.2 No enemies will spawn at all
- ↑ There is a 1/10 (10%) chance for not try to spawn enemies at all and 9/10 (90%) chance to try with 4/5 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{9}{10} * \frac{4}{5}= \frac{18}{25} }[/math].
- ↑ There is a 1/5 (20%) chance for not try to spawn enemies at all and 4/5 (80%) chance to try with 2/3 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{4}{5} * \frac{2}{3}= \frac{8}{15} }[/math].
- ↑ There is a 1/3 (33.33%) chance for not try to spawn enemies at all and 2/3 (66.67%) chance to try with 1/2 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{2}{3} * \frac{1}{2}= \frac{1}{3} }[/math].
- ↑ This is applied regardless of whether the critter spawning pool is used.
- ↑ There is a 1/9 (11.11%) chance for not try to spawn enemies at all and 8/9 (88.89%) chance to try with 3/5 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{8}{9} * \frac{3}{5}= \frac{8}{15} }[/math].
- ↑ There is a 1/6 (16.67%) chance for not try to spawn enemies at all and 5/6 (83.33%) chance to try with 3/7 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{5}{6} * \frac{3}{7}= \frac{5}{14} }[/math].
- ↑ There is a 1/3 (33.33%) chance for not try to spawn enemies at all and 2/3 (66.67%) chance to try with 1/3 spawn rate. Hence, the effective spawn rate is [math]\displaystyle{ \frac{2}{3} * \frac{1}{3}= \frac{2}{9} }[/math].
- ↑ There is a 1/3 (33.33%) chance for the denominator to be multiplied by 2. Hence, the spawn rate factor is [math]\displaystyle{ \frac{1}{3} * \frac{1}{2} }[/math] (denominator multiplied by 2) plus [math]\displaystyle{ \frac{2}{3} * \frac{1}{1} }[/math] (denominator left unchanged). This is equivalent to [math]\displaystyle{ \frac{1}{3}*\frac{1}{2} + \frac{2}{3} = \frac{5}{6} }[/math] or [math]\displaystyle{ 1/\frac{6}{5} = 1/1.2 }[/math].
- ↑ There is a 2/3 (66.67%) chance for the max spawns to be multiplied by 0.6. Hence, the max spawns factor is [math]\displaystyle{ \frac{2}{3} * \frac{6}{10} }[/math] (max spawns multiplied by 0.6) plus [math]\displaystyle{ \frac{1}{3} * 1 }[/math] (max spawns left unchanged). This is equivalent to [math]\displaystyle{ \frac{2}{3}*\frac{6}{10} + \frac{1}{3} = \frac{11}{15} }[/math], which as a percentage is [math]\displaystyle{ \frac{11}{15} - 1 = -\frac{4}{15} = -0.266\cdots \approx -27 \% }[/math].
- ↑ There is a 2/3 (66.67%) chance for the denominator to be multiplied by 3. Hence, the spawn rate factor is [math]\displaystyle{ \frac{2}{3} * \frac{1}{3} }[/math] (denominator multiplied by 3) plus [math]\displaystyle{ \frac{1}{3} * \frac{1}{1} }[/math] (denominator left unchanged). This is equivalent to [math]\displaystyle{ \frac{2}{3}*\frac{1}{3} + \frac{1}{3} = \frac{5}{9} }[/math] or [math]\displaystyle{ 1/\frac{9}{5} = 1/1.8 }[/math].
- ↑ There is a 1/3 (33.33%) chance for the max spawns to be multiplied by 0.6. Hence, the max spawns factor is [math]\displaystyle{ \frac{1}{3} * \frac{6}{10} }[/math] (max spawns multiplied by 0.6) plus [math]\displaystyle{ \frac{2}{3} * 1 }[/math] (max spawns left unchanged). This is equivalent to [math]\displaystyle{ \frac{1}{3}*\frac{6}{10} + \frac{2}{3} = \frac{13}{15} }[/math], which as a percentage is [math]\displaystyle{ \frac{13}{15} - 1 = -\frac{2}{15} = -0.133\cdots \approx -13 \% }[/math].
- ↑ 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.
- ↑ This is to prevent Dungeon NPCs spawning outside the Dungeon.
- ↑ This means no NPCs will spawn in Shimmer or honey that is more than 1 tile deep (any attempt in lava would have be considered invalid in the previous stage).
- ↑ Technically, moving at a speed less than 0.1875 tiles/second (0.05 pixels/tick) in horizontal and vertical directions.
- ↑ The spawned NPC will be one of the NPCs appearing in this environment, or one of the NPCs mentioned.