Modding - Modifiers

## Modifiers

Many entities in Dream Engines can have modifiers attached to them. These modifiers can be used to modify the gameplay balance in various ways. The main methods in which modifiers affect the game are through stat modifiers (changing values, like a damage multiplier, or production multiplier), by unlocking things (research for example), by increasing global capacity, and so on.

In this page we will explain how to configure modifiers and how they work. You will find the places that can have modifiers in their own pages, for example, you'll see how to add modifiers to equipment in the Items page.

## Format

The JSON that defines the modifiers consists of a parent "modifiers" object, and within it one or more children for each type of modifier.

```
modifiers: {
	skill-points: 1
	stats: {
		prod-outputamount: 0.2
		~spec: "prodgroup-research"
		~global: true
	}
}

```

You will find the different types of modifiers and the format for each type below.

## Types of Modifiers

### Stat Modifiers

The main function of stat modifiers are to affect numbers. For example, an armor that increases Tiny's movement speed will have a speed stat modifier. An infrastructure upgrade that increases flux production will have a flux modifier.

Stat modifiers are a bit more complex so they have their own page in the wiki, see Modding - Stat Modifiers.

### Skill Points

```
modifiers: {
	skill-points: 1
}

```

Put this inside the modifier entry to grant free infrastructure upgrade points. This type of modifier is more suited for entities that are granted permanently, such as research, population levels, and tribes. If you do happen to put this modifier in an entity that can later be removed (such as equipment), the player will get the free upgrade point, and will lose it when removing the item. They can then have a negative balance of upgrade points, but will not lose an acquired upgrade.

### Free Constructions

```
modifiers: {
	free-construction: {
		citytile: 1
	}
}

```

This type of modifier grants free constructions. You can grant free constructions even if the construction itself is not unlocked (for example, you can get free city expansions before you unlock the city expansion construction by increasing your population). Like Skill Points, this type of modifier is more suited for entities that are granted permanently, such as research, population levels, and tribes.

### Maximum Buildings

```
modifiers: {
	max-building: {
		materializer: 2
	}
}

```

Some buildings are limited in that you can only have a few of them at one time. This modifier increases the amount of times you can build those buildings. For example, the Dream Weavers tribe allow building more than 3 Materializers through this modifier.

### Global Storage Capacity

```
modifiers: {
	global-capacity: {
		funds: 500
	}
}

```

This modifier will increase the global storage capacity of the resources defined in it. For example, Dream Weavers tribe have a modifier that increases their maximum Flux storage (funds is the item ID for Flux).

### Unlocks

This modifier will unlock entities that have "requires-unlock" set to true. This is mainly used in research, most of which unlock some kind of construction blueprint, production recipe or crafting recipe. It's also used in infrastructure upgrades that unlock abilities (like the City Core Teleport abilitiy), and city population upgrades that unlock new buildings early on.

Within the unlocks JSON object, you need to add an entry per unlock type - ConstructionType, CraftingType, etc. The type you need to use is listed in the page that describes the entity that is being unlocked (for example, the Construction Blueprints wiki page will tell you that you need to use the "ConstructionType" unlock type). Within the type JSON object, you can add multiple entities that you want to unlock, giving each of them the value "true".

```
"modifiers": {
	"unlocks": {
		"ConstructionType": {
			"crystalharvester": true
		},
		"ProductionType": {
			"crystalharvester": true,
			"feathercrystal": true
		},
		"CraftingType": {
			"feathercrystaldowngrade": true
		}
	}
}

```

The example above unlocks the construction blueprint "crystalharvester", two production recipes - "crystalharvester" and "feathercrystal", and one crafting recipe - "feathercrystaldowngrade"