Guide:NPC Happiness

 WORK IN PROGRESS, REWRITING ALL OF THIS OUTDATED STUFF 

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. This section shows an optimal, static housing setup which leaves each NPC at a very high happiness value by exploiting certain mechanics of the system.

Happiness overview
An NPC's "happiness" is less of a score, but rather more helpfully can be thought of as a multiplier. In basic conditions, with no positive or negative factors, an NPC has a happiness multiplier of 100%. Each positive and negative factor is multiplied together to form the final total. Of note is that a smaller multiplier is better; an easy way to remember this is that, for NPCs which sell things, the multiplier is applied as a discount to item prices.

The table shown here gives a full overview of the multipliers; for our purposes, here's a summary of the important bits:


 * Happiness is positively effected by crowding, biome preference, and NPC preference. A lack of crowding multiplies the total by 95%, a loved biome or NPC multiplies by 88%, and a liked biome or NPC multiplies by 94%.
 * At the end of the calculation, happiness is rounded down and capped at a minimum of 75%. Though this may seem like the goal to shoot for with all NPCs, for some of them, it is simply impossible due to them not liking or loving enough NPCs. Below, each NPC in the game is sorted into groups with a shared number of preferences.
 * Santa Claus has a loved biome, no loved NPCs, and no liked NPCs. His minimum multiplier is 83.6%, rounded down to 83%.
 * The Guide, Merchant, Dye Trader, Dryad, and Witch Doctor. Each has a liked biome, no loved NPCs, and two liked NPCs. Their minimum multiplier is 78.90548%, rounded down to 78%.
 * The Cyborg and Angler. Each has a liked biome, no loved NPCs, and three liked NPCs. Living with all of them prevents them from gaining the "no crowding" bonus. As such, their minimum multiplier is 78.074896%, rounded down to 78%.
 * The Zoologist, Tax Collector, Mechanic, Arms Dealer, Steampunker, Painter, Pirate, Stylist, Demolitionist, Goblin Tinkerer, Clothier, Wizard, Nurse, Tavernkeep, and Truffle. Each has a liked biome, one loved NPC and one liked NPC, resulting in each of them having a minimum achievable multiplier of 73.86896%, rounded down to 73%, then capped at 75%.
 * The Golfer has a liked biome, one loved NPC, and two liked NPCs. Living with all of them prevents him from gaining the "no crowding" bonus. As such, his minimum multiplier is 73.091392%, rounded down to 73%, then capped at 75%.
 * The Party Girl has a liked biome, two loved NPCs, and one liked NPC. Living with all of them prevents her from gaining the "no crowding" bonus. As such, her minimum multiplier is 68.425984%, rounded down to 68%, then capped at 75%.
 * The Princess has no biome preference and loves all NPCs. She also does not receive the "no crowding" bonus, nor the crowded penalty. As such, her theoretical maximum score (before being capped) would involve having literally every NPC in the game be her neighbor, which would result in 25 88% multipliers stacking together for minimum multiplier of 4.093236176%, rounded down to 4%, then capped at 75%.
 * With NPCs whose theoretical minimum is below 75%, one needn't achieve all of their positive factors, only enough to get below 75%. NPCs with minimums above 75%, however, have no such wiggle room.

Static strategies
This section provides several solutions ranging from very good (and for most purposes, more than good enough) all the way to almost entirely flawless, with variations depending on what you prioritize. A few useful observations are needed to make this possible:


 * An NPC can be neighbors with two NPCs without having those two NPCs be considered neighbors with each other. This can be achieved by positioning them in a line, like a street with houses on it. This same strategy can be used to form even more complex webs of neighboring. The necessary positioning can be finicking and frustrating to achieve, but is indeed possible.
 * One of the biggest hurdles one might encounter when trying to make an optimal housing system is that certain NPCs who love/like being neighbors prefer different biomes. In some cases, this can be circumvented by using hybrid biomes, but a Forest-[anything] pairing will leave you stumped. Luckily, there's a clever solution; simply have each house be in a different biome. This can be effectively done by having each house be built on a different side of a biome "border" while still being close enough to be considered neighbors.

Unfortunately, even with these, non-mutual neighboring preferences form cracks in any static housing system (see here for a way to address these with a dynamic system):


 * The Tax Collector requires all four possible positive factors in order to reach his minimum of 75%. Unfortunately, this comes at the detriment of a 106% multiplier to the Merchant and a 112% multiplier to the Party Girl. The Merchant is already incapable of reaching 75%, and with the 106% multiplier added, even with all his bonuses the lowest he can reach is 88%. The Party Girl, in her preferred biome with her two loved NPCs and one like NPC (and sans the "no crowding" bonus, as that's 3 total neighbors), can counteract the negative multiplier almost entirely, ending up with a final modifier of, quite unfortunately, 76%. All together, this requires you to make a choice of which NPC's happiness is more important to you: the Tax Collector, or the Merchant and Party Girl, as it is simply impossible to make all of them simultaneously maximally happy.
 * A very similar situation occurs with the Clothier and Truffle. The Clothier must be neighbors with the Truffle in order to be fully happy, but this gives the Truffle a 106% multiplier, making his minimum 82%. Again, it is impossible for these two to be fully happy at the same time.

With this established, below are the solutions.

Good enough for most people
In this section is a solution that strikes a good balance between low modifiers and convenience, both in terms of construction, usability, and pylon placement. As a general guideline, this solution attempts to have every NPC uncrowded, in a biome they like, and with a loved NPC. This achieves a 78% modifier, only 3% off from the theoretical minimum. This is so close to the theoretical minimum as to be, as the section says, good enough for most people.

The solution below is structured in "sets" of biomes; each biome in a set will be next to each other. Biome sets themselves can be however far apart you wish, as they are totally unconnected. Biome sets can also be separated at your convenience to allow for spacing out pylons:


 * Pirate <-> Angler <-> Golfer <-> Wizard <-> Party Girl
 * Pirate and Angler in an Ocean, Golfer in a Forest, Wizard and Party Girl in Hallow.
 * Stylist <-> Dye Trader <-> Arms Dealer <-> Nurse
 * Stylist in an Ocean (the opposite one to the above group). Dye Trader, Arms Dealer, and Nurse in a Desert.
 * Zoologist <-> Witch Doctor <-> Dryad <-> Painter <-> Steampunker <-> Cyborg
 * Zoologist in a Forest. Witch Doctor, Dryad, and Painter in a Jungle. Steampunker in a Desert. Cyborg in a Tundra.

Dynamic adjustment
The above strategy can be slightly tweaked to achieve a more perfect arrangement... with the caveat that the system will require you to change where an NPC lives on the fly every time you want to talk to them. Unwieldy, inconvenient, and even more effort on top of the above, but if you're truly searching for perfection, here it is: