Searching for optimal NPC housing

We can move the Tavernkeep/Demolitionist pair from Hallow to Underground without affecting their total effective discounts. It just swaps their modifiers from 75%/80% to 80%/75% respectively.
Well spotted! I think that’s a better set-up overall, actually, both because it means there’s someone in the Underground so the pylon is usable, and because the Demolitionist’s discount is more useful than the Tavernkeep’s (since it doesn’t apply to purchases with Defender Medals). I’m going to update the first post to have this one instead.
 
The list looks much improved! Do note as Lana stated, that some combinations can be placed Underground without affecting their happiness. The only criteria for this is that they do not hate/dislike the underground. Otherwise it's perfectly fine. Arms Dealer/Nurse is a prime example of this.

Still not sure why you would want to have more than 2 as it reduces the bonuses unless:

I had this idea once a while back of placing all Npcs in the same general area with having max bonuses. Some Geometry (as the distances are radiuses not perfect squares) as well as a Happiness sort of Matrix could get close to 100% of all NPCs. You'd have to pick a Underground and Surface crossing point, as well as make some artificial biomes with some tricky housing. I think it can be done. I'm just lazy and don't want to spend the time on it. Plus it defeats the purpose of Pylons.
 
Just adding another couple of lists. First, an easy manual change to the previous list: putting the Mechanic and the Goblin Tinkerer in the Underground. Now, the Mechanic doesn’t like this and goes up to 85%, but the Tinkerer likes it and goes down to 75%. That gives us seven NPCs at the maximum discount, and isn’t the Tinkerer the one people most want to save money on anyway?
  • Desert: Arms Dealer (75%), Nurse (80%)
  • Forest A: Golfer (80%), Zoologist (80%)
  • Forest B: Merchant (85%)
  • Hallow: Party Girl (75%), Wizard (85%)
  • Jungle A: Dryad (80%), Witch Doctor (80%)
  • Jungle B: Painter (85%)
  • Mushroom: Guide (90%), Truffle (75%)
  • Ocean A: Angler (85%), Pirate (75%)
  • Ocean B: Dye Trader (90%), Stylist (75%)
  • Snow A: Clothier (85%), Tax Collector (85%)
  • Snow B: Cyborg (80%), Steampunker (80%)
  • Underground A: Demolitionist (75%), Tavernkeep (80%)
  • Underground B: Goblin Tinkerer (75%), Mechanic (85%)
Secondly, another one that the optimiser spat out. Before rounding, this is actually the best yet (by a measly 0.02 percentage points), but it comes out equal after rounding. But I still want to share it, because it’s now achieved eight NPCs at 75%! And one of those is the Mechanic, for the mechanism builders among us.
  • Desert A: Arms Dealer (75%), Nurse (80%)
  • Desert B: Dye Trader (85%), Stylist (80%)
  • Forest: Golfer (80%), Zoologist (80%)
  • Hallow: Party Girl (75%), Wizard (85%)
  • Jungle A: Dryad (85%), Painter (75%)
  • Jungle B: Witch Doctor (85%)
  • Mushroom: Guide (90%), Truffle (75%)
  • Ocean A: Angler (85%), Pirate (75%)
  • Ocean B: Cyborg (85%), Steampunker (80%)
  • Snow A: Merchant (95%), Tax Collector (75%)
  • Snow B: Goblin Tinkerer (80%), Mechanic (75%)
  • Underground A: Demolitionist (75%), Tavernkeep (80%)
  • Underground B: Clothier (85%)
Modifying the calculations to give weights to each NPC’s happiness is proving a bit tricky, but it’s still on the to-do list.
 
Revisiting this topic after a few months, I’ve found that the most NPCs you can get to the maximum happiness (prices at 75%) at once is eleven. This is because you need to put them in their liked biome with their loved neighbour (and with nobody else close enough to negate the no-crowding bonus). Only sixteen NPCs have a loved neighbour, and making some of them maximally happy makes at least five of them less so:
  • You can have the Painter (with the Dryad), the Steampunker (with the Cyborg), the Stylist (with the Dye Trader), the Tax Collector (with the Merchant), and the Truffle (with the Guide) all maxed out
  • You can only max out one each from the ‘mutual love’ pairs: Arms Dealer or Nurse; Demolitionist or Tavernkeep; Goblin Tinkerer or Mechanic
  • The Golfer and the Pirate both need the Angler to be maxed out, so pick one… specifically, pick the Pirate, because of the next item
  • The Wizard wants the Golfer in order to be maxed out, so the logical choice is the Pirate with the Angler and the Wizard with the Golfer
  • Maxing out the Party Girl needs either the Wizard or the Zoologist, but since we’ve already maxed out the Wizard’s happiness, put her with the Zoologist—or, put the Zoologist with the Witch Doctor, maxing out her happiness instead
This is not to say that this is an optimal arrangement under the conditions I laid out at the beginning (or under any other conditions, except seeing how many NPCs you can get to the maximum possible happiness at once). But it turns out that a housing plan based on this scheme is actually pretty competitive!
  • Desert A: Cyborg (85%), Steampunker (75%)
  • Desert B: Arms Dealer (75%), Nurse (80%)
  • Forest: Witch Doctor (90%), Zoologist (75%)
  • Hallow A: Golfer (90%), Wizard (75%)
  • Hallow B: Party Girl (85%)
  • Jungle: Dryad (85%), Painter (75%)
  • Mushroom: Guide (90%), Truffle (75%)
  • Ocean A: Angler (85%), Pirate (75%)
  • Ocean B: Dye Trader (90%), Stylist (75%)
  • Snow A: Goblin Tinkerer (80%), Mechanic (75%)
  • Snow B: Merchant (95%), Tax Collector (75%)
  • Underground A: Demolitionist (75%), Tavernkeep (80%)
  • Underground B: Clothier (85%)
(Moving the Witch Doctor to the Jungle, and moving the Zoologist in with the Party Girl, just redistributes the 75%, 85%, 90% among those three, while leaving the Forest uninhabited. The Arms Dealer/Nurse and Demolitionist/Tavernkeep pairs can both be moved to the Hallow, swapping around their percentages… but the Hallow is already pretty full. And while moving the Goblin Tinkerer and Mechanic to the Underground makes the ever-expensive Goblin Tinkerer happier, it makes the Mechanic’s happiness 85% for a worse average, not to mention displacing someone else.)

Using this scheme as a starting point for new searches, I got an even better result:
  • Desert A: Cyborg (85%), Steampunker (75%)
  • Desert B: Dye Trader (85%), Stylist (80%)
  • Forest: Golfer (80%), Zoologist (80%)
  • Hallow A: Arms Dealer (80%), Nurse (75%)
  • Hallow B: Party Girl (75%), Wizard (85%)
  • Jungle A: Witch Doctor (85%)
  • Jungle B: Dryad (85%), Painter (75%)
  • Mushroom: Guide (90%), Truffle (75%)
  • Ocean: Angler (85%), Pirate (75%)
  • Snow A: Goblin Tinkerer (80%), Mechanic (75%)
  • Snow B: Merchant (95%), Tax Collector (75%)
  • Underground A: Demolitionist (75%), Tavernkeep (80%)
  • Underground B: Clothier (85%)

This is better than the previous best, even after rounding. And yet the only difference of any significance is that the Cyborg and Steam Punker move to the Desert, displacing the Arms Dealer and Nurse who move to the Hallow. Just goes to show how easily the random search program I wrote can miss small improvements…

PS As before, if you’d rather minimise the cost of the Goblin Tinkerer’s reforges rather than the Mechanic’s wares, move the two of them to the Underground and put the Clothier somewhere else (say, in the Snow).
 
Last edited:
What i've done is setup some extra houses nearby certain NPC pairs to change them out before buying. For example, in the Jungle I have the Dryad and Witch Doctor next to each other, then more than 25 tiles away i have another 2 homes, 1 containing the painter and the other is empty. When i buy from painter, i just assign the dryad to the empty room (you don't have to wait for NPCs to physically move, just as long as their flag is there), make the purchase, then move her back.

Another example is for the Zoologist: I have an empty house next to her to transfer the Witch Doctor (his flag) to if I am about to spend money on the Zoologist's shop.

Also, to get both the Mechanic and Goblin Tinkerer at a 75% happiness modifier, have them both underground, but have some snow blocks off to the side. The snow blocks are at the correct distance so that when standing above the Goblin Tinkerer, the snow biome isn't formed, but walking just a few tiles over to the Mechanic, it turns into snow and gives Mechanic the 75% modifier.

I've done/am doing this for all the NPCs that i feel make sense to do it for. There are a few though that i don't care about and don't plan to set up artificial biomes for.
 
  • Like
Reactions: MrP
What i've done is setup some extra houses nearby certain NPC pairs to change them out before buying. For example, in the Jungle I have the Dryad and Witch Doctor next to each other, then more than 25 tiles away i have another 2 homes, 1 containing the painter and the other is empty. When i buy from painter, i just assign the dryad to the empty room (you don't have to wait for NPCs to physically move, just as long as their flag is there), make the purchase, then move her back.
I’d thought about that, but decided that this kind of shuffling is out of scope for this whole project… except to point out what the best arrangements are for each NPC so that players can shuffle to their hearts’ content. But yeah, if I’m ever actually determined to really optimise everything in a game, I’ll do that.

Also, to get both the Mechanic and Goblin Tinkerer at a 75% happiness modifier, have them both underground, but have some snow blocks off to the side. The snow blocks are at the correct distance so that when standing above the Goblin Tinkerer, the snow biome isn't formed, but walking just a few tiles over to the Mechanic, it turns into snow and gives Mechanic the 75% modifier.
Early on, I tried using hybrid biomes, but was disappointed to discover that only one of them applies. But the Terraria wiki has been updated since I made that discovery, with a list of biome priorities, pointing out that (for instance) Snow takes priority over Underground (which is how your Tinkerer/Mechanic arrangement works). So coming up with a set of on-the-edge housing arrangements would be an interesting direction for experimentation!

EDIT: …so that’s exactly what I did. And in the process I looked at how the shuffling process could be made efficient too. So much for ‘out of scope’…
  • Angler, 80%: Ocean with Party Girl, Tax Collector, or Demolitionist
  • Arms Dealer, 75%: Desert with Nurse
  • Clothier, 80%: Underground with Tax Collector
  • Cyborg, 80%: Snow with Pirate, Steampunker, or Stylist
  • Demolitionist, 75%: Underground with Tavernkeep
  • Dryad, 80%: Jungle with Witch Doctor
  • Dye Trader, 80%: Desert with Arms Dealer
  • Goblin Tinkerer, 75%: Underground with Mechanic
  • Golfer, 75%: Forest with Angler
  • Guide, 80%: Forest with Clothier or Zoologist
  • Mechanic, 75%: Snow with Goblin Tinkerer
  • Merchant, 80%: Forest with Nurse or Golfer
  • Nurse, 75%: Hallow with Arms Dealer
  • Painter, 75%: Jungle with Dryad
  • Party Girl, 75%: Hallow with Wizard or Zoologist
  • Pirate, 75%: Ocean with Angler
  • Santa Claus, 80%: Snow, alone or with any neighbour except the Tax Collector
  • Steampunker, 75%: Desert with Cyborg
  • Stylist, 75%: Ocean with Dye Trader
  • Tavernkeep, 75%: Hallow with Demolitionist
  • Tax Collector, 75%: Snow with Merchant
  • Truffle, 75%: Mushroom with Guide
  • Witch Doctor, 75%: Jungle with Dryad or Guide
  • Wizard, 75%: Hallow with Golfer
  • Zoologist, 75%: Forest with Witch Doctor

And here’s a possible layout to get the best prices from everyone. I don’t do a lot of artificial biome wrangling, so I’m not sure how practical this is!
  • Desert: There are two houses. The Steampunker’s house has an underground ‘cold room’ where the Cyborg lives, close enough to just enough snow blocks (1500 according to the wiki) to count as the Snow biome when you go down there—but it needs to be out of range when you’re at the surface talking with the Steampunker. The Arms Dealer lives with the Nurse, but her room is within range of a chunk of Hallow (125 blocks of it), while his isn’t. He also has room for the Dye Trader to come and stay when you want to buy dyes; move the Nurse away briefly while doing this.
  • Forest: There are two houses. The Zoologist lives in one, and has a guest room where you can place the Witch Doctor temporarily, when you want to buy from the Zoologist. You can also bring the Guide to visit, on the off chance that a future update (or your guilty conscience!!) makes it worthwhile to make him happy. The Golfer lives in the other house, and he, too, has a guest room. The Angler happens to drop buy whenever you want to buy stuff from the Golfer. The Merchant stays here when you want to buy from the Merchant.
  • Hallow: The Wizard lives alone, but has room for the Golfer when you want to buy from the Wizard. The Party Girl’s house straddles the 25-tile boundary counted from the Wizard’s room. She normally stays on the far side of the house, but you can move her to the side nearest the Wizard when you want to buy from her.
  • Jungle: There are three houses, for the Witch Doctor, the Dryad, and the Painter, in that order. The first and last houses are about 50 tiles apart, with the Dryad’s house in the middle straddling the 25-tile boundary. When the Dryad is on the side nearer the Witch Doctor, the two of them are cheapest. Move her to the side nearer the Painter when you want him to be cheapest.
  • Mushroom: The Truffle lives here, of course. The Guide lives with him, except when he’s away visiting the Forest (or temporarily dead in a voodoo-related accident).
  • Ocean: The Pirate lives out on a ship. He’s alone, but the Angler’s shack straddles that 25-tile boundary. When you want to buy from the Pirate, move the Angler to the closer side. When you want to hand in quest fish, move the Angler away from the Pirate, and bring the Party Girl or Demolitionist to stay temporarily. Meanwhile, the Stylist lives a little bit (more than 25 tiles) further inland, and the Dye Trader stays with her except when he’s gone to the Desert to sell you stuff.
  • Snow: This is an underground town. The Mechanic lives right on the edge of the Underground Snow, and the Goblin Tinkerer lives just outside it—close enough to be in range of the Mechanic, but far enough that you aren’t counted as being in the Snow when you visit him. A little way away, the Merchant and Tax Collector live together. The Merchant doesn’t like it, which is why he visits the Golfer in the Forest when you want to deal with him… but the rest of the time, this maximises the Tax Collector’s cash flow. Oh, and Santa’s temporary dwelling is here, too, well away from the Tax Collector!
  • Underground: In a different part of the Underground, the Demolitionist and Tavernkeep live together. If you want, you can have a chunk of Hallow near the Tavernkeep (but not the Demolitionist) to bring his prices down; but since his happiness doesn’t affect items bought with Defender Medals, you might choose not to bother. The Clothier lives some distance away, with room for the Tax Collector to stay when you want to buy from the Clothier.
And to ensure that pylons remain usable even when shuffling NPCs around (or killing the Guide), place one pet in the Forest, one in the Hallow, and one in the Mushroom.

Phew! That sounds like a lot of work to save a few coins. :eek:
 
Last edited:
May I suggest Toggleable housing?

By changing the solid block in the floor (and having the rest be platform) you can force an npc to stay at a particular location during the night/events.

Say you have two blocks for them, one actuated and one not.

When wanting to change up the npcs who are close, just change the two with a switch to make him go farther away and another come nearer.



The next thing to consider is to have perfectly controlled mini-biomes so that the biome is only active in the location of a particular npc. Say you have two npcs who like differenf biomes but like each other. Just make sure the biomes change somewhere between the 2 npcs.
 
I’d thought about that, but decided that this kind of shuffling is out of scope for this whole project… except to point out what the best arrangements are for each NPC so that players can shuffle to their hearts’ content. But yeah, if I’m ever actually determined to really optimise everything in a game, I’ll do that.


Early on, I tried using hybrid biomes, but was disappointed to discover that only one of them applies. But the Terraria wiki has been updated since I made that discovery, with a list of biome priorities, pointing out that (for instance) Snow takes priority over Underground (which is how your Tinkerer/Mechanic arrangement works). So coming up with a set of on-the-edge housing arrangements would be an interesting direction for experimentation!

EDIT: …so that’s exactly what I did. And in the process I looked at how the shuffling process could be made efficient too. So much for ‘out of scope’…
  • Angler, 80%: Ocean with Party Girl, Tax Collector, or Demolitionist
  • Arms Dealer, 75%: Desert with Nurse
  • Clothier, 80%: Underground with Tax Collector
  • Cyborg, 80%: Snow with Pirate, Steampunker, or Stylist
  • Demolitionist, 75%: Underground with Tavernkeep
  • Dryad, 80%: Jungle with Witch Doctor
  • Dye Trader, 80%: Desert with Arms Dealer
  • Goblin Tinkerer, 75%: Underground with Mechanic
  • Golfer, 75%: Forest with Angler
  • Guide, 80%: Forest with Clothier or Zoologist
  • Mechanic, 75%: Snow with Goblin Tinkerer
  • Merchant, 80%: Forest with Nurse or Golfer
  • Nurse, 75%: Hallow with Arms Dealer
  • Painter, 75%: Jungle with Dryad
  • Party Girl, 75%: Hallow with Wizard or Zoologist
  • Pirate, 75%: Ocean with Angler
  • Santa Claus, 80%: Snow, alone or with any neighbour except the Tax Collector
  • Steampunker, 75%: Desert with Cyborg
  • Stylist, 75%: Ocean with Dye Trader
  • Tavernkeep, 75%: Hallow with Demolitionist
  • Tax Collector, 75%: Snow with Merchant
  • Truffle, 75%: Mushroom with Guide
  • Witch Doctor, 75%: Jungle with Dryad or Guide
  • Wizard, 75%: Hallow with Golfer
  • Zoologist, 75%: Forest with Witch Doctor

And here’s a possible layout to get the best prices from everyone. I don’t do a lot of artificial biome wrangling, so I’m not sure how practical this is!

And to ensure that pylons remain usable even when shuffling NPCs around (or killing the Guide), place one pet in the Forest, one in the Hallow, and one in the Mushroom.

Phew! That sounds like a lot of work to save a few coins. :eek:
Nice man, at a glance, it seems pretty close or exactly to what i've done. I actually made an excel sheet a while back with my plans for pairings when I was figuring it all out. I basically looked through the NPCs shops on the wiki and if there was one that sold things i don't really care about or if they're just cheap and 1 time purchases, i put the npc at low priority to make he/she just a servant to another NPC's happiness lol. But that's nice of you to post your findings for other people to decide for themselves.
But yes, i kept thinking to myself while dinking with it "this is so unnecessary", but it's just the way I am, i do things that annoy myself :/

EDIT: This is the excel sheet I made a while back. I made it for myself, so obviously it probably won't apply to some ppl. I also made notes to "myself", so it may sound kinda weird reading it as any1 else. Note that the cell colors correlate to biome.
NPC Happiness Pairings

May I suggest Toggleable housing?

By changing the solid block in the floor (and having the rest be platform) you can force an npc to stay at a particular location during the night/events.

Say you have two blocks for them, one actuated and one not.

When wanting to change up the npcs who are close, just change the two with a switch to make him go farther away and another come nearer.



The next thing to consider is to have perfectly controlled mini-biomes so that the biome is only active in the location of a particular npc. Say you have two npcs who like differenf biomes but like each other. Just make sure the biomes change somewhere between the 2 npcs.

If I am understanding you correctly, it wouldn't work to get happiness modifiers to apply based on NPC location. It instead works off of the NPC's house flag icon (visible when in the housing interface). Though, IIRC, NPC's location is used instead of flag only when they either don't have a house, or when at a certain distance away from their house. Would need to look back at the wiki at that info to know for sure tho.
 
Last edited:
The house flag is placed on a solid block which is where the npc stands at night. Change the state of said block and the location of the flag changes to another solid block floor.
 
The house flag is placed on a solid block which is where the npc stands at night. Change the state of said block and the location of the flag changes to another solid block floor.
Oh i see what you mean. Sweet. I was actually asking someone in another thread a while back how the flag placement works cuz was wanting to be able to force it's position. I've been resorting to furniture placement to influence the flag position but has been somewhat trial and error/guess work. And ofc, not able to be toggled.
So with what you're saying, do you still have to re-assign the NPC in order for the flag to update? Is what I have to do when using furniture to move it around.
 
Flag updates automatically when the block below it becomes non-solid but theres still another available in the same room.

If there arent any other available, it waits a couple of seconds before searching for another empty viable house.
 
Great, I literally just spent the last few months building a base which had a good sized portion designed specifically for happy NPCs. It's taken so long mainly cuz it's my first time attempting to make things look good (wish i never saw videos made by master builders lol), but now 1.4.1 has totally nullified about half of my work involving distances and stuff. I'm also noticing at least 1 bug for sure where NPCs aren't moving into new homes at night. Think there are other bugs too but haven't tested fully.

I think i'm done giving NPCs any consideration towards whether or not they're happy. They're too picky and high maintenance lol.
 
Great, I literally just spent the last few months building a base which had a good sized portion designed specifically for happy NPCs. It's taken so long mainly cuz it's my first time attempting to make things look good (wish i never saw videos made by master builders lol), but now 1.4.1 has totally nullified about half of my work involving distances and stuff. I'm also noticing at least 1 bug for sure where NPCs aren't moving into new homes at night. Think there are other bugs too but haven't tested fully.

I think i'm done giving NPCs any consideration towards whether or not they're happy. They're too picky and high maintenance lol.


Hehehe, yeah. The biome detection changes brought some pain last time as well. The designs of fishing complexes had to be revised.
 
Hehehe, yeah. The biome detection changes brought some pain last time as well. The designs of fishing complexes had to be revised.
yeah, i also built a new fishing complex for 1.4, but have piggy-backed some NPCs off of it for hybrid happiness pairings (i.e., mechanic and tinkerer). Guess the silver lining here is that they didn't change the biome detection radius/block counts again. That'd rly suck
 
Back
Top Bottom