Houses

Houses
Houses are structures with special requirements. A house must be built to allow NPCs to move in. Building a valid house will give a message to the player with measurments of the house and the score.

Requirements are important to know when building houses. All of the following requirements must be met:

- The floor of the house cannot be less than one block below ground level.

- The house has to be 8-16 blocks long, 5-7 block high and 8-16 blocks wide. - The house has to consist of only one material allowed as a wall, but spots can consist of special wall materials (like glass). Note that walls cannot have holes.

- Houses cannot have touching walls/roofs/floors unless they are made of different materials.

- Every tile inside the house has to have a light level above 9.

- A house must contain a table/worbench, a chair, and a wooden door/hatch.

- The inside of a house cannot be filled with more than 25% interior blocks.

- There must be no invalid blocks inside the house.

The score is what houses are given to tell the player how attractive the house is to NPCs. Houses with higher scores are more likely to be populated by NPCs. The score is created and added like this:

- The length, height and width added together multiplied by the Point Value of the house material.

- Special wall material point value for every special wall block.

- The added point value of the interior.

House finding
House finding is triggered whenever a player places a block that is considered a legal wall material. The material of the block that is placed is the material that the house finder will navigate through to find the origin of the house. The origin is the area of the building that has the lowest x, y, and z value. When the origin has been found, the house finder will search for the length, height, and width of the house, then run a function to get the score the house. The house will be denied as soon as it finds a block which has been specified as illegal inside houses. If a block is missing in the wall, is not specified as a special wall material or is not equal to the house material will not allow it as a house. If there is too much content inside the house, the house will be invalid.