Unftf
Terrarian
Hi there,
for those who are interested in building (small) flats for your NPC's. I will tell you how the game checks if a flat is valid or not.
It is part of the new update 1.3.5 but they haven't wrote it in changelog (for me it's the best game change since years ).
Before 1.3.5 it had some strange behavior, if you like to know how, here some old posts:
long story post and short story post
OK, lets start.
I will focus here at one valid NPC rest position (where the NPC stands e.g. at night). This need to be a solid block at ground with 3 blocks above which are neither a solid block or platform (but e.g. could also be torch there). At the left and right side there need to be 3 (| not _) blocks which arn't a solid block (but e.g. platform, torch possible). At ground there need be a solid block or platform. Furthermore there need to be at least on block which is not a platform or a block to the left and to the right of the rest position (so rest position can't be at he border of the total flat). From those positions it searches the NPC rest position with the highest score. If it can't find a position with a score greater than 0 the flat is invalid. How this score is computed will be the main topic of this post. There are also some more requirements, like available space or furniture which I won't address here (I may add later on).
So how the score is computed?
I will use this as a basic flat with only one possible NPC rest position (in mid at wood block);
The only regions which have impact at the score are the blue, green, and red area. Yellow area and the area above 4 blocks doesn't matter. You can build there whatever you want.
As already written above, in the lower 3 blocks of the red area no blocks or platforms are allowed. In lower 3 blocks of green no blocks allowed. On top and in blue you can place both.
Depending what and where you place some stuff it can have negative or positive impact at the score for the relating NPC rest position.
What ever you place in red has a negative impact. In green and blue it depends at what you place, if it is negative or positive. Each block in those areas has an individual impact (total 5*4 = 20 blocks).
if this block is (not empty and) (only one of the following, the first one):
-in mid(red) it has a negative impact of 15 (M)
-a part of a chest it has a negative impact of 30 (C)
-a part of a closed door, part of an open door (grasp side) or a part of a closed tall gate it has a negative impact of 20 (D)*
-a solid block or a platform it has negative impact of 5 (S)
-a non-solid block, like a torch or part of furniture, or (nearly?) anything else (except those on top) has a positive impact of 5 (N)
(-a free block without anything but wall has no influence)
The computation of the score is done in 3 steps:
You start with a score of 50 (**)
Step 1)
subtract/add points for all blocks which have doors (-20, (D)), solid-blocks(-5, (S)) and non-solid (+5, (N))
Step 2)
if the resulting score is less than 0, the flat is invalid (skip step 3)
else subtract 30 for each block which is part of a chest (C)
if the resulting score is less than 0, set it to 1
Step 3)
subtract 15 for each (not empty) block in mid(red) (M)
(torch, door, chest,.. all count as -15 here)
If the score is greater than 0 it is a valid flat!
(*) ...doors and tall gates can have a positive effect as well. it depends if open or close
The part with the grasp has negative impact -20 for each block (red in picture below). If the door is open the other part has positive effect: +5 for each block (green in picture below).
A tall gate has -20 for each block if closed and +5 if open.
Trap doors count -5 if closed and +5 if open for each block.
(**)...the start points reduce by 1 for each crimson or corruption block in near distance
Some example:
Step 1) 50 - 2 * 5 (S) + 5 * 5 (N) = 65 (-:1 solid block 1 platform, +: 3*tiki torch block, 2*workbench)
Step 2) 65 - 30 (C) = 35 (-: only one block of the chest is in blue -> -30)
Step 3) 35 - 2 * 15 (M) = 5 (-: 2 blocks of red banner in mid)
==> a valid flat with score 5
thanks for reading, I might update later, please write if you find something which don't work as described
-------
some hints:
-Keep in mind, that after reducing the score for each chest block the score can't be below 1. So even in case your score after Step 1 is only 5, you can place as many chests you like but with the condition the mid (red) is free from anything. This condition isn't fulfilled for flats with height 3. This will result in some restrictions in placement then.
-doors can be tricky. A room can be valid with open door but invalid with closed and vice versa.
-Try to avoid Bubble blocks for your home. These are still buggy. NPC leaves valid flats if bubble block is at border.
further notes:
-holes in wall are allowed, up to 4 tiles height and width
-suitable flats without walls exist but new NPC's don't move in by their own
for those who are interested in building (small) flats for your NPC's. I will tell you how the game checks if a flat is valid or not.
It is part of the new update 1.3.5 but they haven't wrote it in changelog (for me it's the best game change since years ).
Before 1.3.5 it had some strange behavior, if you like to know how, here some old posts:
long story post and short story post
OK, lets start.
I will focus here at one valid NPC rest position (where the NPC stands e.g. at night). This need to be a solid block at ground with 3 blocks above which are neither a solid block or platform (but e.g. could also be torch there). At the left and right side there need to be 3 (| not _) blocks which arn't a solid block (but e.g. platform, torch possible). At ground there need be a solid block or platform. Furthermore there need to be at least on block which is not a platform or a block to the left and to the right of the rest position (so rest position can't be at he border of the total flat). From those positions it searches the NPC rest position with the highest score. If it can't find a position with a score greater than 0 the flat is invalid. How this score is computed will be the main topic of this post. There are also some more requirements, like available space or furniture which I won't address here (I may add later on).
So how the score is computed?
I will use this as a basic flat with only one possible NPC rest position (in mid at wood block);
The only regions which have impact at the score are the blue, green, and red area. Yellow area and the area above 4 blocks doesn't matter. You can build there whatever you want.
As already written above, in the lower 3 blocks of the red area no blocks or platforms are allowed. In lower 3 blocks of green no blocks allowed. On top and in blue you can place both.
Depending what and where you place some stuff it can have negative or positive impact at the score for the relating NPC rest position.
What ever you place in red has a negative impact. In green and blue it depends at what you place, if it is negative or positive. Each block in those areas has an individual impact (total 5*4 = 20 blocks).
if this block is (not empty and) (only one of the following, the first one):
-in mid(red) it has a negative impact of 15 (M)
-a part of a chest it has a negative impact of 30 (C)
-a part of a closed door, part of an open door (grasp side) or a part of a closed tall gate it has a negative impact of 20 (D)*
-a solid block or a platform it has negative impact of 5 (S)
-a non-solid block, like a torch or part of furniture, or (nearly?) anything else (except those on top) has a positive impact of 5 (N)
(-a free block without anything but wall has no influence)
The computation of the score is done in 3 steps:
You start with a score of 50 (**)
Step 1)
subtract/add points for all blocks which have doors (-20, (D)), solid-blocks(-5, (S)) and non-solid (+5, (N))
Step 2)
if the resulting score is less than 0, the flat is invalid (skip step 3)
else subtract 30 for each block which is part of a chest (C)
if the resulting score is less than 0, set it to 1
Step 3)
subtract 15 for each (not empty) block in mid(red) (M)
(torch, door, chest,.. all count as -15 here)
If the score is greater than 0 it is a valid flat!
(*) ...doors and tall gates can have a positive effect as well. it depends if open or close
The part with the grasp has negative impact -20 for each block (red in picture below). If the door is open the other part has positive effect: +5 for each block (green in picture below).
A tall gate has -20 for each block if closed and +5 if open.
Trap doors count -5 if closed and +5 if open for each block.
(**)...the start points reduce by 1 for each crimson or corruption block in near distance
Some example:
Step 1) 50 - 2 * 5 (S) + 5 * 5 (N) = 65 (-:1 solid block 1 platform, +: 3*tiki torch block, 2*workbench)
Step 2) 65 - 30 (C) = 35 (-: only one block of the chest is in blue -> -30)
Step 3) 35 - 2 * 15 (M) = 5 (-: 2 blocks of red banner in mid)
==> a valid flat with score 5
thanks for reading, I might update later, please write if you find something which don't work as described
-------
some hints:
-Keep in mind, that after reducing the score for each chest block the score can't be below 1. So even in case your score after Step 1 is only 5, you can place as many chests you like but with the condition the mid (red) is free from anything. This condition isn't fulfilled for flats with height 3. This will result in some restrictions in placement then.
-doors can be tricky. A room can be valid with open door but invalid with closed and vice versa.
-Try to avoid Bubble blocks for your home. These are still buggy. NPC leaves valid flats if bubble block is at border.
further notes:
-holes in wall are allowed, up to 4 tiles height and width
-suitable flats without walls exist but new NPC's don't move in by their own
Last edited: