Terraria

Terraria

144 ratings
Happy NPC Explanation and Setup
By prpl_mage
Did the new NPC system leave your megacity flats useless? Do you need someone to tell you how this system actually works? Maybe you just want someone to tell you where to place your NPCs so you don't have to think about all of this?
You're in the right place.
A guide about Happiness, Pylons, NPC placement etc
2
10
2
   
Award
Favorite
Favorited
Unfavorite
NPC and Housing Basics
Let's start with some basics, skip this section if you already know this.
(If you already get what housing, happiness and pylons are - then skip down a few sections).


NPCs can "move in" to houses that you build.
it doesn't need to be a house or look like a house. But there are some conditions for it to be considered by the game to be "Suitable".

To build a suitable house you need certain types of furniture and a living area:
  • A Light source such as: torches, lamps, lanterns, chandeliers, candelabras
  • Sittable furniture such as: Chairs, Benches, Sofas, Beds
  • Tables such as : Workbench, Table, Dresser, Bathtub, Bookcase, Piano



It also needs:
  • An opening such as: Doors or Platforms. (note that you can't just leave an opening.)
  • Solid floor: at least 1 tile of the floor needs to be a solid block rather than a platform. And this block can't be adjacent to the outlines of the house (this is for the NPC home tile).
  • Background walls: These needs to be placed to obscure the background or natural spawned walls
  • At least 30 tiles of "inside" so in general a 6x10 tiles large house is fine
  • To not have a lot of Corruption or Crimson nearby. Placing Sunflowers can counter this however.

The red banner with a face that can be seen in the picture is considered to be the NPCs "home tile" and where they will stand when night comes. For pylons and happiness, that's where the game measures distances from - not the NPC itself.
Added in 1.4 (Journey's End) is the ability to form Towns which changes the background music and decreases enemy spawning nearby (and instead increases critter spawn rate. How? Simply have 3 NPCs living in suitable houses within 100 blocks of each other or such.

"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."

With 25 NPCs in the game it's understandable that you want to keep them all in one place but there is now a better way. There are also some pets and slimes that can be assigned to a house and lives together with NPCs rather than needing their own space.

Another thing added in 1.4 is the option to build a teleportation system with "Pylons" that function with 2 NPCs nearby and can only be bought from a NPC with high Happiness. And this is where the point of this guide comes into play.

"To remain functional, a pylon needs to have two NPCs housed within a 169×124-tile rectangle centered on the pylon" (pets and town slimes also work)
Happiness and what it does
Happiness is a new "hidden" stat that applies to each NPC individually. It is directly related to the price of items bought and sold at that NPC.
Each NPC starts out with 100 Happiness. It can be decreased down to 75 (which is good) or increased to 150 (this is bad). I realize this sounds weird, but it just is like this.
When an NPC reaches 90 or lower they will sell Pylons for 10g - your discount.

This happiness value is also the discount on the items the NPC sell, so if you max a NPC to 75 then all items sold by that NPC have their cost reduced to 75% of the normal max price (that means, a 25% discount). Likewise the money you get from selling an item to the NPC is increased up to 133%.
The problem is... There is no way to check their current value except for choosing "Happiness" when talking to them, and even then they just give messages based on their preferences:
  • If they like or dislike the Biome they are in.
  • How they feel about NPCs nearby (within 25) that they like, love, dislike and hate
  • If it is too crowded (when there are 7 or more NPCs within 120 tiles)
  • If they gain the non-crowded bonus (less than 2 within 25 and less than 3 beyond 25 but within 120)

(PS, Tinkerer Reforge prices, Taxcollectors revenue, Angler rewards are also affected by happiness)

So how can you tell their happiness? Here are some general items each NPC sells easrly if you want an easy way to guess their current happiness (if you are okay at math).
For example, if you check the Piggy Bank that costs 1G, and it costs 94S, then you know the price is currently 94%, so happiness must be 94 at the moment.

NPC
Item
Base Cost
Merchant
Piggy Bank
1 G
Demolitionist
Dynamite
20 S
Dye Trader
Gold Dye
1 G
Zoologist
Squirrel Hook
2 G
Golfer
Worn Golf Club
10 S
Dryad
Planter Box
1 S
Tavernkeeper
Ale
1 S
Arms Dealer
Flintlock
5 G
Stylist
Dye Remover
2 G
Painter
Brush
1 G
Goblin Tinkerer
Ruler
10 G
Witchdoctor
Blowgun
5 G
Clothier
Black Thread
1 G
Mechanic
Mech Lens
1 G
Party Girl
Party Wagon
10 G

Hardmode:
NPC
Item
Base Cost
Truffle
Mushroom Cap
2 G
Wizard
Bell
1 G
Pirate
Pirate Hat
5 G
Steampunker
Steam Minecart
10 G
Cyborg
Dry Rocket
50 S
Princess
Princess 64
10 G
Biomes and Pylons
So Pylons are sold once the happiness of a NPC is 90 or lower (and there is another NPC nearby). But why get Pylons?

Well Pylons form a fast travel network, each pylon matches a biome in the game which means you can travel there near instantanious if you have it placed near (100 ish blocks) of 2 NPCs (or a pet) and in the correct biome.
Remember that you can only place one of each pylon type in a world.


There is a Pylon for the following biomes:
  • Forest (above surface)
  • Jungle
  • Snow
  • Desert
  • Ocean
  • Cavern (below surface)
  • Hallow
  • Mushroom
  • Universal (not related to any biome)

Likewise, for an NPC to sell the Snow Pylon for example the NPC must be considered to be in the Snow Biome when you shop with them.

Once bought you can rearrange your NPCs however you want, you can even buy multiple ones and store them for later if you don't wish to repeat this it in later playthroughs.

Simply put. Place any NPC in a biome they like with at least 1 NPC they like within 25 and their Happiness should be 84, enough to get a 16% discount and open their inventory for the Pylon of that biome (you only need 90).
Or place an NPC with an NPC they Love in any Biome they don't dislike and it should give you the option as well.

Biome Priority:
If the Crimson overtakes your Desert biome the Desert Pylon will no longer function since the game will consider it to no longer be a Desert biome.
Same thing goes with the Hallow which will override the Snow, Desert, Ocean and Cavern Pylons as shown below:

Priority list taken directly from the wiki: (Meaning, I have not tried all those yet so I assume they are correct.
1. Dungeon, 2 Corruption, 3 Crimson, 4 Glowing Mushroom Biome
5 Hallow, 6 Jungle, 7 Snow, 8 Ocean
9 Desert, 10 Underground/Cavern/underworld, 11 Forest

Likewise The Cavern Pylon works in the Underground, Cavern or Underworld layer. But things like the Underground Jungle will count as a Jungle biome, so the Cavern Pylon will not work.

Universal Pylon
The Universal Pylon is unique in 3 ways.
1. It is not bought like the other,s 2. It can be placed anywhere, 3. It doesn't need NPCs around to function

To get the Universal Pylon from the Zoologist you need to fill out your Bestiary (monster/critter/NPC list) to 100% in that world. Just about all enemies are needed, even the alternative world evil.
I would suggest going for this in one world, then just buy tons of them and save for later.

Your world will either have: Salamander, Giant Shelly or the Crawdad so only 1 of those are needed.
https://terraria.wiki.gg/wiki/Bestiary
I'm sure there is a good guide out there for this.
Numbers and Happiness
Let's explain the math behind this then.

Happines starts at 100
Then the positive and negatives are multiplicative, much like crit chance and so on.
Look at the table below to see what affects it:

The Positive
Criteria
Effect
Loved Biome
0.88
Each loved NPC within 25
0.88
Liked Biome
0.94
Each liked NPC within 25
0.94
Solitude: No more than 2 NPC within 25 & no more than 3 NPC 26-120 away
0.95

The Negative
Criteria
Effect
Hated Biome
1.12
Each hated NPC within 25
1.12
Disliked Biome
1.06
Each disliked NPC within 25
1.06
Crowded: If there are more than 3 NPC within 25, for each extra NPC in range
1.05
(I hope this is still correct, they've changed these numbers so many times now for like each update since the release...)
PS, there is a section further down with all the NPC's preferences, sorry for the layout.


Note that distance is counted in tiles and from the "NPC home tile" aka, the spot below where their banner is located rather than the real distance between NPCs.

Note that the Pets and Slimes will not count towards these crowded checks.

Note that Santa is the only NPC that actually hates and Loves Biomes, so you can just ignore those two modifiers.

Note that the Princess is unique that she maxes her unhappiness if she DOESN'T have at least 2 other NPCs nearby OR more than 3 between 25-120 away. And she automatically loves 3 nearby NPCs, so either she is the happiest gal alive or the most miserable (and all other NPCs like her).
Numbers and Calculations Examples
Let's present an example with NPCs you can get early in the game: The Guide, Golfer and Zoologist. (+ the Merchant because the formula changed again) all placed in the Forest Biome.

We know the following about this setup:
The Zoologist likes the Forest and that her feelings towards the Golfer are positive (liked) and neutral towards the Guide and Merchant.
The Golfer likes the Forest and has a positive feeling (like) towards the Zoologist and neutral towards the Guide.
(If you want to learn more about thier preferences then there is a section further down with that)
But let's ignore the other guys and just focus on the Zoologist for now.

Let's say you want to buy something from the Zoologist, the Squirrel Hook for example, a useful early game Hook item that costs 2g.



Example 1
If we cram all four of them into the smallest possible rooms as close to each other as possible and use the table from the previous section to calculate what the happiness of the Zoologist will be:

100 x 0.94 (for liked biome) = 94
94 x 0.94 (for a liked NPC within 25t) = 88.36
88.36 x 1.05 (for the 3rd NPC within 25) = 92.778
92.778 rounded to closest is 93.
Equals happiness of 93 and therefore prices of 93%

Squirrel Hook's cost will be 1g 86s

Example 2
If we remove the Merchant or move him more than 25 tiles away from the others we instead get:

100 x 0.94 (for liked biome) = 94
94 x 0.94 (for a liked NPC within 25t) = 88.36
88.36 x 0.95 (since there are no more than 2 within 25, and no more than 3 up to 120 away) = 83.942
83.942 rounded up to 84.
Equals happiness of 84 and therefore prices of 84%

Squirrel Hook's cost will be 1g 68s

Example 3
What if we cram all 25 NPCs into the same area but we make sure that there are no more than 2 within 25 of the different "houses" and just the Zoologist, Golfer and Guide sharing a place.

100 x 0.94 (for liked biome) = 94
94 x 0.94 (for a liked NPC within 25t) = 88.36
No bonus nor penalty for overcrowding
88.36 rounded down to 88.
Equals happiness of 88 and therefore prices of 88%

Squirrel Hook's cost will be 1g 78s

Example 4
The worst case scenario we cram all NPCs into small barracks as close to each other as possible. We just assume that we have all the NPCs that affect the zoologist here.

100 x 0.94 (for liked biome) = 94
94 x 0.94 (for a liked NPC within 25t) = 88.36
88.36 x 0.88 (for a loved NPC within 25t) = 77.75
77.75 x 1.06 (for a disliked NPC within 25t) = 82,41
82,41 x 1.12 (for a hated NPC within 25) = 92.29
92.29 x 2.65 (for the 20 something more than 2 NPCs within 25) = 244.56
244.56 rounded down to 244, but max is capped at 150, so 150.
Equals happiness of 150 and therefore prices of 150%

Squirrel Hook's cost will be 3g

Example 5
Let's go with the best case scenario. Careful placement to make the Zoologist as happy as possible. We switch out the Guide with the Witch Doctor(loved) and remove the Merchant. Making sure that only 2 NPCs are within 25 tiles whom the Zoologist have positive feelings towards. We also make sure that there aren't more than 3 NPCs between 25 and 120 away.

100 x 0.94 (for liked biome) = 94
94 x 0.94 (for 1 liked NPC within 25t) = 88.36
88.36 x 0.88 (for 1 loved NPC within 25t) = 77.7568
77.7568 x 0.95 (since there are no more than 2 within 25, and no more than 3 up to 120 away) = 73.86896
73.86896 rounded up to 74. But the minimum is 75, so 75.
Equals happiness of 75 and therefore prices of 75%

Squirrel Hook's cost will be 1g 50s


Conclusion
So remember to only keep 2 others within 25, no more than 3 other NPCs close nearby (26-120), any more than that and you lose one of the positives and instead get a negative.
NPC Preferences (with pictures and lists)
The problem here for making the perfect setup is that the NPCs don't feel the same towards each other.
For example the Stylist likes the Pirate. But the Pirate dislikes the Stylist.

You're getting these two charts as well as a link to the official wiki:
https://terraria.wiki.gg/wiki/NPCs#Happiness


Just gonna list the biomes they like and dislike so the next part makes sense

NPC
Positve Biome
Negative Biome
Guide
Forest
Ocean
Merchant
Forest
Desert
Zoologist
Forest
Desert
Golfer
Forest
Cavern
Demolitionist
Cavern
Ocean
Goblin Tinkerer
Cavern
Jungle
Clothier
Cavern
Hallow
Dye Trader
Desert
Forest
Arms Dealer
Desert
Snow
Steampunker
Desert
Jungle
Dryad
Jungle
Desert
Painter
Jungle
Forest
Witch Doctor
Jungle
Hallow
Stylist
Ocean
Snow
Angler
Ocean
Desert
Pirate
Ocean
Cavern
Mechanic
Snow
Cavern
Tax Collector
Snow
Hallow
Cyborg
Snow
Jungle
Santa
Snow(L)
Desert(H)
Nurse
Hallow
Snow
Tavernkeep
Hallow
Snow
Party Girl
Hallow
Caverns
Wizard
Hallow
Ocean
Truffle
Mushroom
-
Princess
-
-

NPC preferences
(You might want to open this to see the text, tried to make it clearer but it got too large.)

Some of these preferences are mutual but far too many aren't leading to a bit of a puzzle to make it work. But these are your ace pairings regardless of location:
Nurse and Arm's Dealer
Mechanic and Goblin Tinkerer
Demolitionist and Tavernkeep
Suggested Setups
Alright, so this is too much thinking for you? Just want answers? I will list two setups here. One for pre hardmode and one for hardmode.

Both will assume that you want at least 1 NPC happy enough to purchase a Pylon in that biome and have access to all of them.
My personal preference will go in here as well as which NPCs I tend to prioritize.

"House" In this case refers to suitable housing with the NPCs ending up within 25 of each other but not within 25 of other "houses".

Note, this has not been updated since the lessened restrictions for crowding.

Pre-Hardmode
18 NPCs, 6 Pylons.

Forest
House 1 - Merchant(84), Zoologist(84), Golfer(94)
House 2 - Guide(84)

Cavern
House 1 - Demolitionist(79), Tavernkeep(84), Clothier(89)

Desert
House 1 - Arms Dealer(79), Nurse(84)

Jungle
House 1 - Dryad(84), Witch Doctor(84), Painter(79)

Ocean
House 1 - Angler(84), Party Girl (95)
House 2 - Stylist(79), Dye Trader(95)

Snow
House 1 - Goblin Tinkerer(84), Mechanic(79)

There you have it, not everyone will be in their prefered biome or with prefered people but at least some sort of positive result. And at least 1 of the NPCs in the biomes should be down to 90 or lower to sell you a Pylon.
No more than 2 within 25 (by placing in different "houses) and 6 or less NPCs in each location to gain the 0.95 bonus.
Use the Pet cat/dog/bunny to fill up the "towns" if you want to move an NPC somewhere else so the Pylons still work (needs 2npcs within 100 ish)


Hardmode
25 NPCs, 9 Pylons

Forest
House 1 - Merchant(84), Zoologist(84), Golfer(94)

Cavern
House 1 - Demolitionist(79), Tavernkeep(84), Clothier(89)
House 2 - Goblin Tinkerer(79), Mechanic(88)

Desert
House 1 - Arms Dealer(74), Nurse(84), Steampunker(89)

Jungle
House 1 - Dryad(84), Witch Doctor(84), Painter(79)
Same as before

Ocean
House 1 - Angler(84), Party Girl (95), Pirate(79)
House 2 - Stylist(79), Dye Trader(95)

Snow
House 1 - Tax collector(89) + Pet
House 2 - Cyborg(89), (Santa(83))

Hallow
House 1 - Wizard(84), Princess(84) + Pet

Mushroom
House 1 - Guide(95), Truffle(79) + Pet

Universal
House 1 - Free space for 2 NPCs to move someone here when you want a simple "non-crowded bonus" or more for certain purchases.

We now use the pets to fill out to decrease monster spawns and crowd some of the Biomes for the pylons. There can of course be other setups but this is how I prefer to do it.
Min Max Setup
This is an attempt to get the most out of your useful NPCs.
Some of these NPCs could of course be happier, but I have disregarded their happiness for other people's happiness.

To make an even more optimal housing would be careful planing of where the home tile is for each NPC so that some NPC are within 25 of NPCs they like but not that all of the NPCs in a biome would be within 25 of each other.
For example the Zoologist could be within 25 of the Witch Doctor, who in turn is within 25 of the Dryad BUT not the Painter.
Or by placing settlements between two biomes. For example The Cavern Pylon being next to an underground snow biome so that the Mechanic is considered to be in both when you talk to her.

Instead lets list how to make certain NPCs happy and build from that! A different type of maxing

In this case I will prioritize certain NPCs (marked in bold) for each area. Also, like before some uses several "houses" that are seperated but some NPCs are still within 25 tiles thanks to careful placement (but still not more than 5 NPCs in the same area to get the solitude bonus).

A lot of these will of course be similar to the above examples. But more at the expense of other NPCs we now disregard.

Cavern

Goblin Tinkerer (74)
Mechanic(88) and Dye Trader(95)

Demolitionist (74)
Tavernkeeper(84), + Mechanic within 25

Desert

Arms Dealer (74)
Nurse(84), + Steampunker within 25

Steampunker (74)
Cyborg(84), Stylist (100) +Arm's Dealer within 25

Mushroom

Truffle (74)
Guide(95), Dryad(89)

Forest

Wizard (78)
Merchant (84), Golfer(100)

Ocean

Angler (79)
Party Girl(106), Tax collector(89)


So you are free to do whatever you want with the Snow, Jungle and Hallow biome here. Not as important, but suggestions follow:

Jungle
Painter(89), Witchdoctor(89), Zoologist (83)

Snow
Clothier(95) + All the pets because no one likes him

Ocean 2
Pirate(95) + A pet

Place the Princess near any NPC that you want to buff up, just don't get her too close to the others to inflict the penalty.
Tips and tricks
  • The most important advice is to keep less than 3 NPCs within 25 tiles of eachother. Crowding is what gets you the biggest penalty right there. So each "house" should only contain 3 NPCs in total.

  • Another good thing is to keep less than 6 NPCs in the same place. If you have more than 3 outside of 25(but within 120) of an NPC they will lose a positve addition. There is no penalty here, but you miss out on a bonus. So a biome with two "houses" of 3 NPCs each are in the clear.

  • Keep the liked and loved NPCs nearby to counteract whatever other negative penalty you may inflict upon them.

  • Only focus on the NPCs you will actually visit. No one cares if the Guide lives in the Ocean biome with the Painter and Steampunker. He may dislike all of that but he doesn't even have anything to sell. So who cares?

  • Focus on the Goblin Tinkerer if you tend to reforge, or the Mechanic and Painter if you are building something. Don't try to please all of them, move them if you really need them later on.

  • Likewise, you don't need everyone to live near a Pylon, by hardmode you have plenty of ways to get where you want fast. Drop some NPCs into the Dungeon, Sky Islands, Underworld. It's your world! Don't let the system decide for you.

  • Even if you place a NPC by themselves in a biome they like their Happiness will be around (89), that's an 11% discount without much effort at all. Add a pet and the Pylon will work as well.

  • Otherwise, don't worry too much about this and play the game like you want to. Avoid placing too many within 25 of each other and you are fine really.

Know any better setups for certain biomes? Please share!
Updated again...
I don't have the time to change the entire guide at the moment but here comes the latest changes that affects this topic:

1. You now only need to reach 0.9 happiness for Pylons to be sold. As a consequence there is now a condition that at least 2 NPCs be present.

2. Hybrid biomes are less of a problem. Meh.

3. Unclear about the third point, if it refers to the close proximity, the within 120, or both. But the cap was increased, so that's good news for everyone. Problem is, no one knows what the new number is... I thik crowded started at 4 or more before, so it should be 5 or more now? The wiki isn't updated so I guess not?

4. The new special seed ignores the happiness system. Instead all NPCs sell and buy things at standard rates but they all offer pylons. The message option is even missing.


NPC HAPPINESS CHANGES

Pylons now require a minimum of 2 NPCs under all conditions to be sold

The minimum required happiness for NPCs to sell Pylons is now more forgiving, with the number from 0.85 to 0.9 (the lower the number, the happier, with 1.0 being completely neutral). This means that it is now easier to make NPCs happy enough to sell a Pylon.

If an NPC is present in a hybrid biome (for example, the Hallowed Desert), and they like at least one of those biomes, then they will gain positive happiness from the biome they like. This will only work for a liked biome vs a neutral/disliked biome; it will not allow a neutral biome to overcome a disliked biome. This also does not override major unhappiness/housing invalidation due to being near the Corruption, Crimson, or Dungeon.

The number of NPCs you can have in a town before Crowded penalties begin to take effect has been increased by 1
14 Comments
a cat Aug 18, 2023 @ 10:53pm 
░░░░░█▐▓▓░████▄▄▄█▀▄▓▓▓▌█Help
░░░░░▄█▌▀▄▓▓▄▄▄▄▀▀▀▄▓▓▓▓▓▌█ Doge
░░░▄█▀▀▄▓█▓▓▓▓▓▓▓▓▓▓▓▓▀░▓▌█ Take
░░█▀▄▓▓▓███▓▓▓███▓▓▓▄░░▄▓▐█▌ Over
░█▌▓▓▓▀▀▓▓▓▓███▓▓▓▓▓▓▓▄▀▓▓▐█ Steam
▐█▐██▐░▄▓▓▓▓▓▀▄░▀▓▓▓▓▓▓▓▓▓▌█▌ Copy
█▌███▓▓▓▓▓▓▓▓▐░░▄▓▓███▓▓▓▄▀▐█ And
█▐█▓▀░░▀▓▓▓▓▓▓▓▓▓██████▓▓▓▓▐█ Paste
▌▓▄▌▀░▀░▐▀█▄▓▓██████████▓▓▓▌█▌
▌▓▓▓▄▄▀▀▓▓▓▀▓▓▓▓▓▓▓▓█▓█▓█▓▓▌█▌ DO IT.
█▐▓▓▓▓▓▓▄▄▄▓▓▓▓▓▓█▓█▓█▓█▓▓▓▌
adsobi Dec 29, 2021 @ 4:44pm 
thanks, ill try.
prpl_mage  [author] Dec 29, 2021 @ 1:02pm 
Check the values for the NPCs by looking at the prices for the NPCs there. If there are more than 2 within 25 they will complain that it is crowded.
If they are close enough (within 25) to a NPC they like they should say so when you choose their "Happiness" option.
adsobi Dec 28, 2021 @ 5:00pm 
is there a reason as to why the forest setup for prehardmode doesnt work? or am i just stupid.
wstelzer15 Dec 24, 2021 @ 9:11am 
Put the Goblin Tinkerer with the Mechanic and everything will be great between them.
LadyOfGuns Dec 23, 2021 @ 4:55am 
Great
ThatOneSpacePirate Dec 18, 2021 @ 11:45pm 
Amazing honestly, I was confused and intrigued before, but now I'm leaving fully read up on happiness. Thank you!!
Mellorina Dec 18, 2021 @ 2:42pm 
Great guide, you really went above and beyond with this!
applpaplvevo Dec 18, 2021 @ 10:51am 
i like pie
prpl_mage  [author] Dec 18, 2021 @ 6:52am 
Glad you enjoyed it