Terraria NPC happiness is a nigh invisible stat that influences a handful of useful features. The system is surprisingly detailed and finding it naturally would require having plenty of talks with your NPCs along with a mountain of trial and error.
What does NPC happiness do?
NPC happiness has two primary effects:
- It influences the prices in NPC shops. Higher happiness means lower prices, while lower happiness means higher prices.
- HIgher happiness allows you to buy Pylons from NPC shops.
There are also a few other traits unique to certain special NPCs. The Nurse's healing prices, Angler's quest rewards, and Tax Collector's money gain are all influenced by happiness as well.
The most important feature is the ability to purchase pylons. There is a pylon for each major biome (aside from Hell, which counts as being part of the Cavern biome, and the Corruption/Crimson) that can be purchased from NPC shops in that biome. The Glowing Mushroom biome also has a pylon despite being a minor biome by all standards.
You can travel between placed pylons so long as both pylons are near a town, which is a gathering of two or more NPCs, and are in their respective biomes. Only one of each type of pylon may be placed. Pylons are also unusable while a boss is alive.
How to raise NPC happiness
NPC happiness is based on the biome that they're in and the NPCs that are living around them. You can check if an NPC is happy or not and what they're happy (or unhappy) about by selecting Happiness when talking to an NPC.
Each NPC has specific biomes that they love, like, dislike, and hate. They'll gain a large amount of happiness for living in biomes they love and a small amount for a liked biome. Conversely, they'll lose happiness in a disliked or hated biome.
The same rule is applied to nearby NPCs. Each NPC has other NPCs that they love, like, dislike, and hate. Specifically, an NPC is defined as nearby when its housing flag is within 25 blocks.
There is also an incentive to keep NPC groups small. An NPC becomes less happy when there are more than two nearby NPCs. They also receive a happiness buff if there are no more than two nearby NPCs and no more than three other NPCs within 120 blocks.
To optimize NPC happiness, you'll need to form small towns of like-minded NPCs. You'll need to prioritize which NPCs you want to be happy since not every NPC can be at max happiness at the same time.
For help organizing all of the NPCs available in Terraria, go check out How Many NPCs are in Terraria? on Pro Game Guides!