# Adding Constructions

Let's learn how to add brand-new constructions like new houses, roads or even trains!

## Useful links

* Checkout the Data category for the In-Game name with English Names relation
* [Temperate biome rules](https://href.li/?http://atakovat.com/urbek/reglasBioma_0.txt)

## 3D Model

Let's first make an appearance for our building, for that you'll require to first create a 3D model via MagicaVoxel, for that you just need to follow this simple guide:

{% content-ref url="../getting-started/make-a-3d-model" %}
[make-a-3d-model](https://worive.gitbook.io/urbek-modding/getting-started/make-a-3d-model)
{% endcontent-ref %}

## File Structure

You'll need to create a text file starting by `newBuildings` at the end it's going to look like that:\
`newBuilding_someName.txt`.

{% hint style="info" %}
The file is in a format named **JSON**, it's a common file format to store data in files, it may be easier if you have a JSON editor to avoid mistakes and make it easier to read.
{% endhint %}

The file start with a main attribute called `construs` which will contain every construction we wish to add.

An empty template would look like this:

```json
{
    "construs": []
}
```

### Our First Building

Let's add the minimum needed to make a building

```json
{
    "construs": [
        {
            "name": "Potato Farm",
            "codeName": "potatofarm",
            "category": "campo",
            "models": ["potato farm,1,1"]
        }
    ]
}
```

Let's review what's written there:

**Name:** The name of the building

**Code Name:** The unique ID of our building, it cannot be the same as another one.

**Category:** The building's category, it defines in which building tab we'll be able to find it.

**Models:** The visual model of our building, in this case we are selecting the model named `potato farm` and it's sized `1` x `1` tiles. But a same building could have multiples models for more variety or for specifics edges, for example (multi-tile buildings).

{% hint style="info" %}
More information about the model's format can be found there:
{% endhint %}

{% content-ref url="../in-depth-knowledge/structure-model-format" %}
[structure-model-format](https://worive.gitbook.io/urbek-modding/in-depth-knowledge/structure-model-format)
{% endcontent-ref %}

## Adding Functionality

For now, our building is just pure decoration and does nothing, but we can add plenty of characteristics.

### Production

Let's define so our building will produce some food:

```json5
{
    "construs": [
        {
            "name": "Potato Farm",
            "codeName": "potatofarm",
            "category": "campo",
            "models": ["potato farm,1,1"], // do not forget the ',' !
            // New lines starting there
            "produces": [
                {
                    "rec": "comida",
                    "q": 2
                }
            ]
            // New lines ending there
        }
    ]
}
```
