Terraria Wiki

Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.


Terraria Wiki
This is a Guide page.
This is a Guide page.
This means the page will walk you through a specific task, strategy, or enemy/boss fight.
Status: Subject to revision (This Guide does not meet certain quality standards and may be heavily outdated.)
Desktop versionConsole versionMobile versionNintendo Switch version
Desktop/Console/Mobile/Switch-Only Content: This information applies only to the Desktop, Console, Mobile, and Switch versions of Terraria.

The NPC happiness mechanic poses a complex puzzle to avoid paying excessively high prices. Many NPCs who like each others' company prefer different biomes, and some NPCs like another but are disliked or hated in return. Additionally, purchasing pylons in order to set up a network is impossible without putting thought into NPC happiness.

There are several different ways to address the situation, this guide is intended to discuss them. The last section gives a single general solution for all NPCs, but before that it is worth discussing more flexible strategies.

Basic constraints[]

The exact rules are listed on NPCs § Factors affecting happiness, but the issues can be summarized (all of these factors combine):

  • NPCs get a 12% or 6% bonus for being in a loved or liked biome, or a penalty for being in a hated or disliked one.
  • They get a similar bonus or penalty for being housed near another NPC they love, like, dislike, or hate.
    • "Near" in this context means that their housing flags are within 25 tiles (50 feet) of each other.
  • They get an "overcrowding" penalty for having more than three "nearby" NPC, no matter the relationship. The penalty is 5% for each additional "nearby" NPC, i.e., for the fourth, the fifth, etc. "nearby" NPC.
  • Conversely, they get a 5% "solitude" bonus for not having more than two NPCs nearby, and having no more than three other NPCs (that is, the two "roommates" do not count) within 120 tiles.
    • Note that this much larger range may sometimes represent over a full screen's width.

The above factors affect a variety of transactions with NPCs:

  • Vendor prices for selling their items will be lower if they are happy, higher if they are unhappy.
  • Conversely, vendor prices for buying the player's items will be higher if they are happy, lower if they are unhappy.
  • This does affect the Nurse's fees for healing and the Goblin Tinkerer's reforging costs.
  • This also affects the Angler's quest rewards – if happy or unhappy, he will give rewards as if the player had completed more or fewer quests, respectively.
  • This even affects the Tax Collector's revenue stream – if happy, he will not only collect more money in a given time, but gather a higher maximum amount, and the reverse if he is unhappy.

And two other factors come into play, but for these happiness is irrelevant – all that matters is the NPC's presence:

  • NPCs also suppress enemy spawning nearby. In Normal mode, 3 NPCs "on screen" are needed to completely suppress the spawning of enemies, which is usually desirable for a town.
  • To remain functional, a pylon needs to have two NPCs housed within 169×124-tile rectangle centered on the pylon.

Depending on game progress, there are also up to three town pets available. These count as NPCs for pylons and enemy suppression, but not for crowding/solitude calculations; while it is sometimes claimed that they can affect the happiness of nearby NPCs, this is not the case either positively or negatively, rendering them useful primarily for keeping a town eligible for pylons and enemy suppression when other NPCs are not available (for instance, keeping a dog and cat in the same duplex as the Nurse and Arms Dealer would prevent you from accidentally disabling their pylon if you often relocate the two of them for boss fights), or for extending a town's enemy suppression zone further without crowding its inhabitants.

Casual strategy[]

Some more general points to consider:

  • Empty houses are not considered – even if a given space could house an NPC, if it does not, then it has no effect on NPC happiness.
  • Not all NPCs are created equal:
    • The Goblin Tinkerer is widely considered the largest money sink in the entire game, so any discounts you can get from him will add up.
    • Similarly, the Tax Collector is an ongoing revenue stream, so you'll want to keep him happy.
    • The Nurse's prices do not necessarily matter much, in the sense that you're usually in no position to bargain when you need her services. However, if you are likely to use her often, you should probably try to keep her happy. While a Potion of Return can let you drop by wherever she is, this will not be desirable during some boss fights, so if you are bringing her to the fight, you might want to bring a roommate along to keep her happy.
    • If you rarely purchase from a given NPC or their wares are cheap (like the Painter's), you will not have to care much about their happiness – and with a little advance warning, you can move them into a better environment when you do need to make a big purchase.
    • You want at least one vendor to be as happy as possible when buying your items, and probably at least one for each of your major bases.
    • The Guide's happiness has no effect at all and can be disregarded entirely.

Examining the rules, it seems that a reasonable strategy is as follows:

  • Pick locations for your pylons (and perhaps some non-pylon bases), and loosely cluster two or three "duplex" NPC homes at each of them, each duplex separated by over 25 tiles.
  • The "duplex" part means that each of these homes would also include a "guest room", a second housing-suitable space. This does not need to be filled up front, but it lets you bring in a liked or loved roommate on short notice, and also serves as ready housing for new arrivals until you pick a new spot for them.
  • This allows you to give all the NPCs some space, while making sure the pylon stays live.
  • The third NPC, or a town pet, comes in handy in case you need to pull an NPC elsewhere on short notice.

This general arrangement can evolve as new NPCs arrive, with the guest rooms doubling as ready housing for newcomers. You can also pair off your more valuable NPCs as desired without disturbing their neighbors, while leaving the less popular ones on pylon duty or exile.

Calculated strategy[]

An "optimal solution" for pairing off all the NPCs is listed below, maximizing average happiness across all NPCs. This includes all NPCs including Hardmode (except for the Princess), and represents a single setup meant to be left unchanged. By nature, such an optimization cannot take full account of issues such as easy access or pylon placement, and this one is fairly simple – focused on average happiness, no priority for the "important" NPCs mentioned above, and it assumes all NPCs are paired or alone.

It is assumed that for each NPC A, there are at maximum two other NPCs within 25 tiles and there are at maximum three other NPCs between 25 and 120 tiles away. The final values include the 5% bonus granted for this "solitary" setup.

NPC A NPC B Biome Price modifier for NPC A
ZoologistZoologist GolferGolfer ForestForest 84%
GolferGolfer ZoologistZoologist ForestForest 84%
MerchantMerchant n/a ForestForest 89%
NurseNurse Arms DealerArms Dealer DesertDesert 84%
Arms DealerArms Dealer NurseNurse DesertDesert 79%
TavernkeepTavernkeep DemolitionistDemolitionist UndergroundUnderground /
CavernCavern /
The UnderworldThe Underworld
DemolitionistDemolitionist TavernkeepTavernkeep UndergroundUnderground /
CavernCavern /
The UnderworldThe Underworld
Tax CollectorTax Collector ClothierClothier UndergroundUnderground /
CavernCavern /
The UnderworldThe Underworld
ClothierClothier Tax CollectorTax Collector UndergroundUnderground /
CavernCavern /
The UnderworldThe Underworld
Party GirlParty Girl WizardWizard The HallowThe Hallow 79%
WizardWizard Party GirlParty Girl The HallowThe Hallow 89%
MechanicMechanic Goblin TinkererGoblin Tinkerer Snow biomeSnow biome 79%
Goblin TinkererGoblin Tinkerer MechanicMechanic Snow biomeSnow biome 84%
SteampunkerSteampunker CyborgCyborg Snow biomeSnow biome 84%
CyborgCyborg SteampunkerSteampunker Snow biomeSnow biome 84%
Santa ClausSanta Claus n/a Snow biomeSnow biome 84%
DryadDryad Witch DoctorWitch Doctor JungleJungle 84%
Witch DoctorWitch Doctor DryadDryad JungleJungle 84%
PainterPainter n/a JungleJungle 89%
AnglerAngler PiratePirate OceanOcean 89%
PiratePirate AnglerAngler OceanOcean 79%
Dye TraderDye Trader StylistStylist OceanOcean 95%
StylistStylist Dye TraderDye Trader OceanOcean 79%
GuideGuide TruffleTruffle Glowing Mushroom biomeGlowing Mushroom biome 95%
TruffleTruffle GuideGuide Glowing Mushroom biomeGlowing Mushroom biome 79%
Simple NPC Setup
Biome 1st set of neighbors1 2nd set of neighbors1
Forest Golfer Zoologist Merchant n/a
Snow Biome Steampunker Cyborg Mechanic Goblin Tinkerer
Desert Arms Dealer Nurse n/a n/a
Underground / Cavern / The Underworld Tax Collector Clothier Demolitionist Tavernkeep
Ocean Angler Pirate Stylist Dye Trader
Jungle Dryad Witch Doctor Painter n/a
The Hallow Wizard Party Girl n/a n/a
Glowing Mushroom biome Truffle Guide n/a n/a

Town pets can be placed anywhere. Placing them at the locations with only 2 NPCs can help keep pylons powered in the event that one of the NPCs is somewhere else or missing.

The Princess should be placed in the Forest2, Desert, Jungle2, The Hallow, or Glowing Mushroom biome to avoid over crowding in the other locations.

1. There must be a 25 tile gap separating the 2 Neighbor groups.

2. The Princess would have to be placed near the Merchant or Painter.

The above setup can be improved by putting nearby NPCs in different biomes.

1. Put the Nurse in a nearby hallow to the Arms Dealer. If there is none, make one using seeds or a clentaminator. Just make sure it can't spread to the desert and override it.

2. Put the Mechanic in an ice cavern biome, then put the Goblin Tinkerer in a regular cave nearby.

3. Do the same with the Tax Collector and the Clothier, with the Tax Collector in the ice caverns and the Clothier in the regular caverns.

4. Create a nearby snow biome to a desert or vice versa and put the Steampunker in the Desert and the Cyborg in the Snow.

5. Put the Truffle in the Glowing Mushroom Biome with a nearby Forest for the Guide.

Newer Strategy[]

In, the "overcrowding"/"solitude" limit was changed to more than/less than 3 neighbours. A strategy which exploits this to increase average happiness can be found below. Identical assumptions are made to the older strategy, but we consider groups of one, two, three, and four, rather than just one or two.

We assume every set of neighbours (particularly those that share a biome) are at least 120 blocks away from each other.

NPC Setup
Biome(s) Neighbors (and happiness per biome)
Forest Merchant(0.89)
Forest Zoologist(0.84) Golfer(0.84)
Hallow or Underground / Cavern / The Underworld Tavernkeep(0.79, 0.84) Demolitionist(0.84, 0.79)
Hallow Party Girl(0.79) Wizard(0.89)
Desert Nurse(0.84) Dye Trader(0.84) Arms Dealer(0.79)
Jungle Dryad(0.84) Painter(0.79) Witch Doctor(0.84)
Ocean Stylist(0.84) Angler(0.89) Pirate(0.83)
Snow Goblin Tinkerer(0.84) Mechanic(0.79) Santa Claus(0.84)
Snow Steampunker(0.84) Tax Collector(0.89) Cyborg(0.84)
Glowing Mushroom biome Guide(0.89) Clothier(0.84) Truffle(0.83)