Searching for optimal NPC housing

MrP

Steampunker
Emote_Love.png
Emote_NPC_Mechanic.png
NPC Housing and the Quest for Optimality
Emote_Anger.png
Emote_Biome_Jungle.png

Since Journey’s End released, a lot of people have discussed and shared their ideas for the optimal NPC housing arrangements to keep everyone happy (and, not incidentally, keep their prices low). I… uh, may have gone full maths/computer nerd on the problem.

Results
Results first! Here are the best arrangements I’ve found so far:

One house with three inhabitants per biome
  • Desert: Dye Trader, Goblin Tinkerer, Mechanic
  • Forest: Golfer, Party Girl, Zoologist
  • Hallow: Arms Dealer, Nurse, Wizard
  • Jungle: Dryad, Painter, Witch Doctor
  • Mushroom: Clothier, Guide, Truffle
  • Ocean: Angler, Pirate, Stylist
  • Snow: Cyborg, Steampunker, Tax Collector
  • Underground: Demolitionist, Merchant, Tavernkeep
Here are the price modifiers from biome and neighbour selection, with and (without) rounding to the nearest 5%.
  • Angler: 100% (98.80%)
  • Arms Dealer: 95% (93.60%)
  • Clothier: 95% (93.60%)
  • Cyborg: 95% (93.86%)
  • Demolitionist: 90% (88.92%)
  • Dryad: 95% (93.86%)
  • Dye Trader: 100% (98.80%)
  • Goblin Tinkerer: 95% (93.60%)
  • Golfer: 95% (93.86%)
  • Guide: 100% (98.80%)
  • Mechanic: 95% (93.60%)
  • Merchant: 105% (104.00%)
  • Nurse: 90% (88.92%)
  • Painter: 90% (88.92%)
  • Party Girl: 95% (93.60%)
  • Pirate: 90% (88.92%)
  • Steampunker: 95% (93.60%)
  • Stylist: 95% (93.86%)
  • Tavernkeep: 95% (93.60%)
  • Tax Collector: 100% (98.80%)
  • Truffle: 90% (88.92%)
  • Witch Doctor: 95% (93.86%)
  • Wizard: 100% (98.80%)
  • Zoologist: 95% (93.86%)
Up to two houses with two inhabitants each per biome
  • Desert A: Cyborg, Steampunker
  • Desert B: Dye Trader, Stylist
  • Forest: Golfer, Zoologist
  • Hallow A: Arms Dealer, Nurse
  • Hallow B: Party Girl, Wizard
  • Jungle A: Witch Doctor
  • Jungle B: Dryad, Painter
  • Mushroom: Guide, Truffle
  • Ocean: Angler, Pirate
  • Snow A: Goblin Tinkerer, Mechanic
  • Snow B: Merchant, Tax Collector
  • Underground A: Demolitionist, Tavernkeep
  • Underground B: Clothier
Here are the price modifiers from biome and neighbour selection and the lack of crowding, with and (without) rounding to the nearest 5%.
  • Angler: 85% (85.50%)
  • Arms Dealer: 80% (81.00%)
  • Clothier: 85% (85.50%)
  • Cyborg: 85% (85.50%)
  • Demolitionist: 75% (76.95%)
  • Dryad: 85% (85.50%)
  • Dye Trader: 85% (85.50%)
  • Goblin Tinkerer: 80% (81.00%)
  • Golfer: 80% (81.22%)
  • Guide: 90% (90.00%)
  • Mechanic: 75% (76.95%)
  • Merchant: 95% (94.50%)
  • Nurse: 75% (76.95%)
  • Painter: 75% (76.95%)
  • Party Girl: 75% (76.95%)
  • Pirate: 75% (76.95%)
  • Steampunker: 75% (76.95%)
  • Stylist: 80% (81.00%)
  • Tavernkeep: 80% (81.00%)
  • Tax Collector: 75% (76.95%)
  • Truffle: 75% (76.95%)
  • Witch Doctor: 85% (85.50%)
  • Wizard: 85% (85.50%)
  • Zoologist: 80% (81.22%)

Assumptions
With twenty-five town NPCs to house, and eight biomes that affect their happiness, there are almost 38 thousand billion billion possible combinations. That’s a few too many to search through, so I made a few assumptions.
  1. Santa Claus will not be included. If you want to optimise his happiness, stick him in the snow and keep the Tax Collector far away for the weeks Santa’s around. I’ll focus on the rest of the year.
  2. Every other NPC will be included, spread across all biomes. This is essentially a late-game guide for when you have all the NPCs; early-game housing arrangements are out of scope. (However, I will be sticking to eight ‘towns’ with a pylon each, so the Universal Pylon is not accounted for.)
  3. With twenty-four NPCs in eight biomes, my first approach was to put three NPCs in each biome. This takes crowding out of the equation. There may be benefits to crowding some NPCs and giving others more room, but that won’t be explored here.
  4. Since having three NPCs in close proximity is happiness-neutral, but having two is a positive, I also looked at having up to four NPCs per biome, split into well-spaced households of up to two each.
  5. The Truffle has to go in the Mushroom biome. That’s less an assumption and more a requirement, although for all I know there are ways and means to get him to live elsewhere.
Method
Given those conditions, we’ve narrowed down the number of arrangements to ‘only’ 46 million billion for the first case (three to a biome). Even if I could check each one in a nanosecond, it’d take a year and a half to check them all. So I went and taught myself simulated annealing, a method of searching for optimal solutions in reasonable amounts of time. It doesn’t guarantee that the solution is the best possible, but it’s done a pretty good job, as far as I can tell.

I defined ‘optimal’ in this case as the lowest total percentage happiness modifier across all NPCs, calculated by multiplying the modifiers from the wiki together. (Essentially, I’m minimising the geometric mean, not the arithmetic mean.) Everything was programmed in Python. Preferences and housing assignments were represented using matrices, so that I could use Numpy to do the scoring faster. (I’m happy to share the code if anyone’s interested.)

Future Directions
One thing to do is to keep running the search, looking for even better arrangements than what I’ve got so far.

You may have noticed that I tried to make every NPC happy, without taking into account things like the Goblin Tinkerer being a huge money sink, while the Guide (as far as I can tell) has no benefits or penalties from happiness whatsoever. A more nuanced version would weight each NPC according to how beneficial their happiness is. (Which sounds awfully callous now that I put it like that…) I’d love to have some feedback from the community as to which NPCs you think should be prioritised!
 
Last edited:
I believe your maths are a bit off.

3 is a crowd, so there will be a blanket 104% penalty modifier if we simply stick 3 together everywhere. 1 of the 3 will have to be separated from the other 2 by at least 25 tiles, but if we're to do that, we can actually create 2 groups of 2 NPCs within the same biome and keep all 4 of them happy for a 90% bonus modifier instead. Yes, I know this greatly complicates things.

You can check this in game. They will say something along the lines of "love having so much room" when it's not crowded.

From the wiki:

Two or more other NPCs within 25 tiles (for each additional NPC)104%
No more than one other NPC within 25 tiles and no more than three other NPCs (not counting the NPCs within 25 tiles) within 120 tiles90%

E.g. putting Zoologist in a Forest together with Golfer and Party Girl without separation makes her modifier 100 * 1.04 (crowded) * 0.95 (likes forest) * 0.95 (likes golfer, neutral with party girl) = 93.86%. On the other hand, if we separate Party Girl from the other 2 by 25 tiles, we get the roomy bonus instead, and the modifier for Zoologist becomes 100 * 0.9 (roomy) * 0.95 (likes forest) * 0.95 (likes golfer, out of range with party girl) = 81.225%, which also unlocks the Pylon on her inventory.

Other than that, this is great. I love simulations like these.

We should get better results if we use the Guide, and maybe even the Angler and the Tax Collector, as wild cards and ignore their happiness. ;(
 
Last edited:
3 is a crowd, so there will be a blanket 104% penalty modifier if we simply stick 3 together everywhere.
As you say, this complicates things. By putting everyone in groups of three, I basically intended that ‘slightly crowded’ be everyone’s condition, so that I could say it’s the baseline and just ignore it. :)

I could factor it into the percentages, but as you point out, it’s possible to have two close and one slightly further away, thus negating the penalty. And if you do that everywhere, that becomes the new baseline, and so it once again doesn’t impact on the optimality calculations!

And yeah, putting four (in groups of two) in some places is out of scope for this little exercise. But maybe that’s another direction for future expansion…

We should get better results if we use the Guide, and maybe even the Angler and the Tax Collector, as wild cards and ignore their happiness. ;(
I’d thought that the Tax Collector would be one that people would want to keep happy! But I’m not actually sure how his trickle of income stacks up against the potential cost savings of, say, the Goblin Tinkerer.

Hmm. Maybe if I put up a survey or something for people to rank the NPCs they most want to keep happy?
 
I think the tinkerer is obviously the most important NPC. None of the rest are critical. I'd look to who sells expensive & useful stuff next. I mean the merchant is pretty useful but does not sell much that is really expensive. Maybe the zoologist actually sells expensive useful stuff. I tend to buy a lot of wire I suppose most people do so the mechanic.
 
So I went and made a new version that (as @Lana described) allows up to two ‘households’ of two NPCs per biome. To do this, I added eight dummy NPCs and split the resulting list of 32 into sixteen pairs, two per biome. As a result, sometimes biomes end up with only two people, in separate houses. That’s fine, because pylon range is longer than the 25-tile three’s-a-crowd range. (Sometimes, but rarely, a biome ends up with just one person… which is still workable if you put a pet with them.)

First, the obvious: this does reduce costs further than having ‘households’ of three. The problem is, the optimiser doesn’t seem to be doing a good job of optimising this scenario. I went and made my own housing table based on the best case from the three-lots-of-eight scenario, and the optimiser can’t seem to beat it. Investigation is ongoing. I figured it out. I reintroduced a bug in my new code that I’d already fixed in my old code. :confused: Note to everyone: x + 1 / y is not the same as (x + 1) / y.

(I should mention that my day job is high school maths teacher…)

After fixing that and another couple of bugs (in how it presented the results, not how it found them), it’s doing much better at finding results close to the above-mentioned table I made myself… but it still hasn’t beaten it!
 
Last edited:
just posting to say I am happily following/watching this thread
I think working out the math on this puzzle is super interesting ^_^
 
If your goal is to provide maximum overall happiness then it does look as though you've got a solid list. However, happiness is irrelevant for many NPCS (don't I sound evil?) for three reasons:

1 - Pylons don't need happy NPCs. They just need present NPCs in the area.
2 - Some NPCs gain no benefit from Happiness (this just keeps on getting worse):

- Angler, Guide, Nurse (not positive on this one), Tax Collector (although it is stated that his tax rate is based off of how many NPCs he is around, so he is counter-productive to the Happiness system)

3- While others usually only have one-time buys and make repeat customers not really worthwhile.


Personally I have divided the system in two parts. First, obtain all the Pylons. This requires specific combinations and happiness is extremely important. Second, obtain the best prices from my most used NPCs, like the Goblin Tinkerer, Mechanic, Wizard, or Arms Dealer. This involves putting them in specific biomes and sometimes even pairing them in a dilemma way. For example, do I want better mechanic prices or better tinkerer prices?

The end results pay off. The maximum price bonus that I've seen is a 35%, which is huge.

Best Price Combos, the Optimal being in Bold:

Goblin Tinkerer/Mechanic = 25% bonus: Underground Snow
Painter/Dryad = 35% bonus: Any Jungle <--- I use the painter as my pawn shop for selling things
Arms Dealer/Nurse = Any Desert
Wizard/Golfer = Surface Hallow
Demolitionist/Tavernkeeper = Underground or Cavern
Zoologist/Witch Doctor = Forest
Pirate/Angler = Ocean
Truffle/Guide = Surface Mushroom

The rest get stockpiled into an underground Mushroom cave so I can despawn HardMode creatures for easy mushroom farming and to get maximum Tax Collector benefits.
 
Thanks, Banmei. This is exactly the sort of feedback/opinion I wanted to get before I got into weighting NPCs by how useful their happiness is. (…that does sound awful, doesn’t it?)

- Angler, Guide, Nurse (not positive on this one), Tax Collector (although it is stated that his tax rate is based off of how many NPCs he is around, so he is counter-productive to the Happiness system)

I thought the wiki said that the Nurse’s healing costs were dependent on happiness, but I went back and couldn’t find it. So I checked in game, and yup, she charged me less to remove a debuff after I moved the Zoologist away from her (1 gold versus 1 gold 20 silver). So I think the nurse should be somewhere up the priority list a bit.

As for the Tax Collector, I thought it was that his collection rate depended on how many NPCs you had total, not just those near him? And then both his rate and the 10-gold cap get scaled based on his happiness.

Second, obtain the best prices from my most used NPCs, like the Goblin Tinkerer, Mechanic, Wizard, or Arms Dealer.
Tinkerer for reforges, Mechanic for wire/mechanisms. Wizard for… mana potions, I’m guessing? Arms Dealer for bullets and bullet parts.

How about Steampunker for Clentaminator supplies? Also logic gates and teleporters, though that depends on what you’re doing.

And for the others:
  • Angler: According to the wiki, keeping him happy is like having done more quests, in terms of probability to receive the better quest rewards.
  • Clothier: I think this goes under the ‘one-time buys’ group you mentioned.
  • Cyborg: Rockets, if that’s your thing.
  • Demolitionist: Explosives, if that’s your thing.
  • Dryad: Decorative/building items?
  • Dye Trader: One-time purchases again. Unless his quest rewards are also tied to happiness? Wiki doesn’t say so…
  • Golfer: One-time purchases, unless you’re building a lot of golf courses.
  • Guide: Absolutely no impact as far as I know.
  • Merchant: Only really early-game items.
  • Painter: Building supplies.
  • Party Girl: One-time purchases and a few building items. Unless maybe keeping her happy makes Pigronatas profitable!
  • Pirate: Sail for builders, cannonballs if you need them, and one-off items (but that parrot cracker is expensive).
  • Stylist: One-time purchases.
  • Tavernkeep: Happiness doesn’t affect anything bought with Defender Medals, so unless you buy a lot of ale, not much point. (Just stock up on Eternia Crystals early.)
  • Truffle: One-time purchases. Unless you need a lot of dark blue solution?
  • Witch Doctor: One-time stuff and decorative items.
  • Zoologist: One-time purchases, but some are pretty pricey.

The end results pay off. The maximum price bonus that I've seen is a 35%, which is huge.
Really? The wiki says the cap is 75% of prices—that is, a 25% bonus. This needs investigating too!
 
me too I noticed that 35% vs 25 % discrepancy from wiki, quickly hopping onto test world to check that Painter/Dryad in jungle combination
I very much hope that 35% is correct ^_^

awww shucks, pylon price set at 7.5 gold... let's see about selling stuff...
golden carp will be bought for 13 gold 33 silver 33 copper (o_O, how's that work o_O?)
that's not 10 gold x 1.25 which would be 12 gold 50...
ah... I see, it is 10 gold divided by 0.75 which gives 13.3 'périodique' (shoot, sorry I don't know the correct math terminology in english)

also MrP, you may like to make a priority list of NPCs for the builders (painter, bubble blocks, wiring, I can't think of other stuff off the top of my head as I'm just a fledgling on the building since journey mode was launched)
as you noted golf course builders would prioritize golfer shop
I know I would certainly like to see what a builder's npc list with max discounts looks like :D
 
Last edited:
ah... I see, it is 10 gold divided by 0.75 which gives 13.3 'périodique' (shoot, sorry I don't know the correct math terminology in english)
“Recurring”. :) (I did say I’m a maths teacher…)

I think, instead of trying to come up with a generally-accepted list of NPC priorities (if it’s even possible), I might just try and maximise the discount from each NPC in turn, and see where that gets me.

Not right now though. I need sleep.
 
35% is correct. One thing I do early on is sell dyes for profit since they doubled the raw material output. Base sell price for normal dye is 20 silver. I can sell them for 27 silver. 7/20 = 35%. I've noticed that this is not achievable with all combinations.

The Wizard I use to get Mythical enchantments on books. The reforge price on those eat up money real fast. It's much cheaper to buy the book and craft it then to reforge it. You can actually make a good profit just by making spellbooks. So I get good spellbooks plus make some nice money both at the same time!

Don't have much use for the Steampunker other than cogs, conveyor belts, and teleporters. I only use the Clentaminator when creating new biomes and even then using Ammo reduction buffs you don't need that much.
 
good call on the early profit Banmei, I've sold the raw material but never thought to do the extra step of doubling it with the vat
and you're right on the 35% though I think it's a consequence of their rounding up
20 silver / 0.75 = 26.6 recurring (^_^ learn something new :D) which gives us your 35% profit at 27 silver rounded up

I don't have much buying experience at end game as I have spent relatively little time in hardmode so far
explaining why I'm only piping up with vague ideas on npc goods' importance
 
I was confused, because while @Kisk is right and 27 silver is equal to a −25% bonus rounded to the nearest silver, the Golden Carp example was rounded to the nearest copper. So that didn’t seem to explain it.

But I did my own test (Demolitionist, Underground, with the Tavernkeep and nobody else = 75%) and he’ll buy dye items for 26 silver 66 copper, which is exactly what we’d expect*. @Banmei, were you rounding the number off? Or am I missing something that could make him happier?

(I even threw in the cat, because the wiki says town pets give an unspecified bonus to happiness. But the bonus stayed at 75%; he’ll sell the Pylon for 7 gold 50 silver, and will buy dyes for 26 silver 66 copper.)


* Well, it actually shows that rounding isn’t to the nearest copper, but down to the next copper. Otherwise it would be 26 silver 67 copper.
 
I was confused, because while @Kisk is right and 27 silver is equal to a −25% bonus rounded to the nearest silver, the Golden Carp example was rounded to the nearest copper. So that didn’t seem to explain it.

But I did my own test (Demolitionist, Underground, with the Tavernkeep and nobody else = 75%) and he’ll buy dye items for 26 silver 66 copper, which is exactly what we’d expect*. @Banmei, were you rounding the number off? Or am I missing something that could make him happier?

(I even threw in the cat, because the wiki says town pets give an unspecified bonus to happiness. But the bonus stayed at 75%; he’ll sell the Pylon for 7 gold 50 silver, and will buy dyes for 26 silver 66 copper.)


* Well, it actually shows that rounding isn’t to the nearest copper, but down to the next copper. Otherwise it would be 26 silver 67 copper.

No, I've made maybe 4 worlds in 1.4 so far and each one I pair the Dryad with the Painter. I can sell Dyes to the Painter for 27 silver. 27 silver as in exactly 27 silver.
 
This turned into a longer, more verbose post than I meant, so here’s the short version: After testing, I have established that…
  • I can’t replicate Banmei’s results.
  • Three to a house has no penalty.

No, I've made maybe 4 worlds in 1.4 so far and each one I pair the Dryad with the Painter. I can sell Dyes to the Painter for 27 silver. 27 silver as in exactly 27 silver.
That’s bizarre. I just tried it: Painter in the Jungle (× 0.95), with the Dryad (× 0.9) and the cat (× ??), and nobody else (× 0.9), and just like the Demolitionist, he’d pay 26 silver 66 copper. Unless someone can explain it, I’m going to chalk this one up to a glitch and assume that in general, the wiki is right and 75% is the best possible. :)

While I was there, I also tested out housing three people together. (For conciseness, I’m using “together” or “neighbours” to mean “within 25 tiles”.) Y’see, I’ve noticed that NPCs don’t complain about overcrowding if you have three of them together—they only complain when there’s four or more. And on closer inspection, the wiki actually says…

“Two or more other NPCs within 25 tiles (for each additional NPC) 104%”

(Emphasis added.)

What’s the “additional” counting from? Is it from two (so the third neighbour causes the penalty), or from one (so the second causes the penalty)? I read it the second way, and so did @Lana earlier in this thread. But there was still that niggling doubt because of the lack of complaints… not to mention, it seemed a bit weird that they would jump immediately from the 90% bonus for having just one neighbour to the 104% penalty for having two, with no neutral option in between.

I tested by putting the Zoologist in the Jungle with various NPCs to whom she’s neutral. With two neighbours, she gave me list prices on anything bought or sold—no bonus or penalty! So that’s going to change my housing arrangement search, if only a little bit.

I’m not sure how it works past that, though, because when I added a third, I got to 110% right away, not 105% as I’d expected (being the nearest multiple of 5% to the wiki-listed 104%). It stayed at 110% with four, went to 115% with five, 120% with six, and 125% with seven (that’s eight total in close proximity, counting the Zoologist herself). That’s as far as I tested.

This doesn’t seem to be consistent with any flat multiplier per additional person, so I think there’s something else going on behind the scenes.
 
That makes sense. The way I read it is:

2 NPCs. For each above 2, you get a penalty. Are you counting the pet? Also, there's seems to be rounding occurring outside of pure math.

Btw: I always make my Pylons in the Cavern layer of the Jungle for easy access to Spores, Variegated Lardfish and Chlorophyte. Maybe that has something to do with it. But it's always only the Dryad and Painter.
 
I vaguely remember it being mentioned that the crowding excluded the original first added neighbour, the one within the 25 tile area.... going to hunt that down now...
when you're adding your npcs MrP? are they all within that 25 tile besties range? are any beyond into the 120 tile range?
if you only have the one bestie and everybody else is in the 120 tile range then I think this wiki line takes precedence, and seems to indicate it excludes the original pair

No more than one other NPC within 25 tiles and no more than three other NPCs (not counting the NPCs within 25 tiles) within 120 tiles

which gives us the total 5 neighbours without crowding penalties becoming a factor as I understand it when I tested my happiness range ( Happiness Range Visual Guide ) a good few weeks ago

...could it instead just mean it discounts EVERY npc in the crowded 25 tile area full stop? >_o brain starting to hurt now
 
@MrP You're right. Apologies for the earlier misinterpretation. I tested it a bit more too.

It does appear that it's 2 NPCs = not crowded, 3 NPCs = neutral, and 4 or more NPCs = crowded. The jump between the 3rd and 4th NPCs seems to happen because it went from no penalty at 3 NPCs to double the penalty for 2 additional NPCs above 2 NPCs at 4 NPCs, i.e. it went from 0.9 to 1.0 to 1.04*1.04, if that makes sense.

(EDIT2: Actually, I'm not sure about all the maths anymore. I just woke up and the more I think about this, the more confused I get. :D I'll check back later when I'm more awake. I'll leave these here though in case anyone wants to double-check my numbers. I didn't take pictures for Party Girl or Hairstylist, but with the initial 4 + Party Girl, the Fairy Glowstick still sells for 75 copper, and with Party Girl + Hairstylist it sells for 79 copper.)

Zoologist + Golfer in a Forest
Likes Golfer = 0.95
Likes Forest = 0.95
Not Crowded = 0.90
=> Modifier = 100*0.95*0.95*0.90 = 81.225 ≈ 80%
Base price of Fairy Glowstick = 75
=> After modifier = 75*0.8 = 60

Zoologist + Golfer + Merchant in a Forest
Likes Golfer = 0.95
Neutral with Merchant = no effect
Likes Forest = 0.95
Neither Crowded nor not crowded = no effect
=> Modifier = 100*0.95*0.95 = 90.25 ≈ 90%
Base price of Fairy Glowstick = 75
=> After modifier = 75*0.9 = 67.5 ≈ 67 (should be 68? She's selling for 67 though.)

Zoologist + Golfer + Merchant + Guide in a Forest
Likes Golfer = 0.95
Neutral with Merchant = no effect
Neutral with Guide = no effect
Likes Forest = 0.95
Crowded #1 = 1.04
Crowded #2 = 1.04 (It has to count twice, otherwise the modifier doesn't jump high enough to explain the price change. The wiki says it's multiplicative, so I'm assuming it's multiplicative for each additional NPC too, but the numbers don't change much even if it's additive.)
=> Modifier = 100*0.95*0.95*1.04*1.04 = 97.6144 ≈ 100%
Base price of Fairy Glowstick = 75
=> After modifier = 75*1.0 = 75

Zoologist + Golfer + Merchant + Guide + Party Girl in a Forest
Likes Golfer = 0.95
Neutral with Merchant = no effect
Neutral with Guide = no effect
Neutral with Party Girl = no effect
Likes Forest = 0.95
Crowded #1 = 1.04
Crowded #2 = 1.04
Crowded #3 = 1.04
=> Modifier = 100*0.95*0.95*1.04*1.04*1.04 = 101.518976 ≈ 100%
Base price of Fairy Glowstick = 75
=> After modifier = 75*1.0 = 75

Zoologist + Golfer + Merchant + Guide + Party Girl + Hairstylist in a Forest
Likes Golfer = 0.95
Neutral with Merchant = no effect
Neutral with Guide = no effect
Neutral with Party Girl = no effect
Neutral with Hairstylist = no effect
Likes Forest = 0.95
Crowded #1 = 1.04
Crowded #2 = 1.04
Crowded #3 = 1.04
Crowded #4 = 1.04
=> Modifier = 100*0.95*0.95*1.04*1.04*1.04*1.04 = 105.57973504 ≈ 105%
Base price of Fairy Glowstick = 75
=> After modifier = 75*1.05 = 78.75 ≈ 79

I got lazy and didn't take pictures for Party Girl and Hairstylist, but the numbers check out.

npc2.png


npc3.png


npc4.png


(Edited some typos and copy-paste errors. Honestly we should just look at the source code and see how it works exactly. :p)
 
Last edited:
  • Like
Reactions: MrP
I previously mentioned a bug that I fixed that was, I think, the reason why my new two-to-a-house search wasn’t coming up with better results. Apparently I hadn’t fixed it. I have now, and so I’ve gotten a new, much better result, with a phenomenal six NPCs at the maximum modifer of 75%. I’ve updated the first post with this new arrangement, as well as a more recent best for the three-to-a-biome setup. Do note, however, that this new optimum has the downside of having nobody in the Underground!

when you're adding your npcs MrP? are they all within that 25 tile besties range?
Yes, I had them all crammed into good old wooden boxes, with the Zoologist right in the middle so that everyone was definitely within 25 tiles of her.

As for the 25-tile versus 120-tile counts… I have no idea.

It does appear that it's 2 NPCs = not crowded, 3 NPCs = neutral, and 4 or more NPCs = crowded. The jump between the 3rd and 4th NPCs seems to happen because it went from no penalty at 3 NPCs to double the penalty for 2 additional NPCs above 2 NPCs at 4 NPCs, i.e. it went from 0.9 to 1.0 to 1.04*1.04, if that makes sense.

(EDIT2: Actually, I'm not sure about all the maths anymore. I just woke up and the more I think about this, the more confused I get. :D I'll check back later when I'm more awake. I'll leave these here though in case anyone wants to double-check my numbers. I didn't take pictures for Party Girl or Hairstylist, but with the initial 4 + Party Girl, the Fairy Glowstick still sells for 75 copper, and with Party Girl + Hairstylist it sells for 79 copper.)

Your maths seems to check out, though I haven’t checked every line.

Most importantly, I think you’re right on the essential principle: someone with two close neighbours gets no penalty, but someone with three gets the 104% penalty applied twice, and then again for each additional close neighbour. But…

(Edited some typos and copy-paste errors. Honestly we should just look at the source code and see how it works exactly. :p)

…I think this is the only way to know for sure! (How do people look at the source code? Are they just disassembling the game, or what?)


PS Rounding 67.5 copper down to 67 is consistent with the “rounding down” rather than “rounding to nearest” behaviour that I noted earlier, by which 66.66… copper is rounded to 66.
 
The new "two houses" list is great! I'll take all the discounts I can get. :D

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.

This seems true for several other pairings too, where it's favouring the biome preference of one NPC over the other. Which is great, since it means there's flexibility even within this optimised setup.
 
  • Like
Reactions: MrP
Back
Top Bottom