Modifiers

Version

Please help with verifying or updating older sections of this article. At least some were last verified for version 3.2.

This article is for the PC version of Stellaris only.

A **modifier** influences a scope's gameplay state, be it a country, planet, etc.

## Modifier fields

Modifiers are applied to a scope in a modifier or triggered\_modifier field. Some objects can apply modifiers to other scopes, in which case the field includes the scope applying to. All the following Objects have modifier fields:

### Modifier Effects

There are three types of modifiers.

* *add* modifiers add/substracts a set amount of a resource or attribute to a scope
* *mult* modifiers increase or decrease the amount of a resource or attribute by a percentage
* *reduction* modifiers divide an amount of a resource or attribute by a set amount

These affect the resource or attribute amounts in different ways. For example, if the cost, production, or upkeep of a certain resource is *x*, then the actual amount of that resource will be:

*((x + (Sum of all* **add** *modifiers)) \* (1 + (Sum of all* **mult** *modifiers))) \* (1 -* **reduction***)*

Example:

*planet\_buildings\_minerals\_cost\_mult = 1* would make all the buildings cost twice as much minerals. So a **Research Lab** that normally costs 400 minerals would cost *400 \* (1 + **1**) = 400 \* 2 = 800* minerals.

*planet\_buildings\_minerals\_cost\_add = 1* would make all the buildings cost one mineral more. So a **Research Lab** that normally costs 400 minerals would cost *400 + **1** = 401* minerals

*pop\_growth\_speed\_reduction = 0.5* would make a species grow half as fast. If a species on planet has a base growth speed of 4, their final growth speed would be: 4 \* (-1 \* 0.5) = 4 \* -0.5 = 2

There can be multiple modifiers effecting a single resource cost, production, or upkeep. For instance, if the empire has a civic that applies *planet\_buildings\_minerals\_cost\_mult = -0.1*, but the planet has a modifer that applies *planet\_buildings\_minerals\_cost\_mult = 0.20*, then the buildings on that planet will cost 10% more: *(400 \* (1 + **0.20** + **-0.1**) = 400 \* (1.1) = 440* minerals.

*Reduction* modifiers have a larger effect than *mult* modifiers. Let's say a species has a base growth speed of 3. They have a trait with *pop\_growth\_speed = 0.25* increasing growth speed by 25%. Their habitability on the planet gives them *pop\_growth\_speed = -0.10* The empire has a temporary modifier giving them *pop\_growth\_speed\_reduction = 0.25* There final growth speed is: *(3 \* (1 + 0.25 + -0.1)) \* (1 - 0.25) = (3 \* 1.15) \* 0.75 = 3.45 \* 0.75 = 2.5875*
A *Reduction* modifier of 1 will always result in 0, no matter what *add* or *mult* modifers are applied as well.

There could also be other modifiers in the hierarchy. For instance, if the modifer on the planet was *planet\_structures\_minerals\_cost\_mult = 0.20*, then districts on that planet would cost 20% more *(500 \* (1 + **0.20**) = 500 \* 1.2 = 600* minerals, while the buildings would only be 10% more. Since *planet\_structures* is the parent of *planet\_buildings*, the buildings would be effected by both modifiers, but *planet\_districts* would only be effected by the *planet\_structures\_xxxx* modifier on the planet. Which modifiers gets applied to a resource depends on where it is in the Economic Category hierarchy, as well as where it is being applied.

## Modifiers list

Current list of modifiers (included those modded in using Economic Categories) can be found in an ***effects.log*** file in your local data folder's script\_documentation (defaults to "%USERPROFILE%\Documents\Paradox Interactive\Stellaris\**logs\script\_documentation\**")

## Auto-Generated modifiers

The game auto-generates modifiers for the following elements:

1. species\_archetypes

```
<archetype name>_species_trait_points_add - country scope

```

2. ethics

```
pop_ethic_[fanatic_]<ethic name>_attraction_mult - country scope, even ethics without attraction generate attraction modifiers

```

3. tech\_categories

```
category_<category name>_research_speed_mult - country scope

```

4. ship\_sizes

```
shipsize_<shipsize name>_build_speed_mult - country scope
shipsize_<shipsize name>_build_cost_mult - country scope
shipsize_<shipsize name>_hull_mult - country scope
shipsize_<shipsize name>_hull_add - country scope

```

5. ship\_classes - only buildable ships have classes

```
shipclass_<class name>_build_cost_mult - country scope
shipclass_<class name>_build_speed_mult - country scope
shipclass_<class name>_hull_mult - country scope
shipclass_<class name>_damage_mult - country scope
shipclass_<class name>_evasion_add - country scope
shipclass_<class name>_disengage_mult - country scope

```

6. building\_tags - build\_speed\_mult type modifier doesn't have any effect in game except being displayed (obviously not fully implemented.)

```
<building name>_construction_speed_mult - planet/country/sector scopes/leader (i believe)
<building name>_build_cost_mult - planet/country/sector scopes/leader (i believe)

```

7. component\_tags - each component tag auto generates three modifiers. Only those that are defined for weapon type actually have an effect, but the game auto generates modifiers for all component tags.

```
<component name>_weapon_damage_mult - modifier/ship modifier on ship sizes and ship modifier applied through events
<component name>_weapon_fire_rate_mult - modifier/ship modifier on ship sizes and ship modifier applied through events
<component name>_speed_mult - modifier/ship modifier on ship sizes and ship modifier applied through events

```

8. special\_projects - country/leader scope

```
<project name>_1_cat_research_speed_mult
<project name>_2_cat_research_speed_mult
<project name>_3_cat_research_speed_mult
...

```

9. planet\_classes habitability - pop/trait/planet scopes - do not require GFX.

```
pc_<class name>_habitability

```

Other modifiers are generated basec on Economic Categories.

## Economic Categories

Modifiers effecting resource costs, production and upkeeps are created using Economic Categories. Economic Categories are defined in "common\economic\_categories". Every *resource = { ... }* block in the script is assigned one of these categories. For each category, modifiers can be created that multiply or add to the resource cost, upkeep or production of game objects.

### Hierarchy

Most Economic Categories are assigned a *parent*. This forms a hierarchical tree out of the modifiers. Any modifier created for that category or any of its parent categories will then effect the resource cost/production/upkeep of any resources in that block. For instance, *planetary buildings* are usually assigned to the resource category *planet\_buildings*, which is a child of *planet\_structures* > *planets* > *country*. So any modifier that starts with *planet\_buildings\_xxxx*, *planet\_structures\_xxxx*, *planets\_xxx*, or *country\_xxxx* will effect that building.

### Economic Type

Each category can effect the *cost*, *production*, and *upkeep* of a resource.

**Cost** is the initial cost for that object. The cost to build a building, the cost to start the terraforming, etc.

**Production** is the monthly resource production of the object. The monthly production of the pop job, the monthly production of the building, etc.

**Upkeep** is the monthly upkeep cost for that object. The monthly upkeep cost of the pop job, the monthly upkeep cost of the building, etc.

### Resource Type

A single modifier will either effect a single type of resource, or will apply to all of the resources of that Economic Type. *planet\_buildings\_cost\_mult* will effect all the resource costs of buildings, while *planet\_buildings\_minerals\_cost\_mult* will only effect the mineral costs of buildings. So, if a building cost 400 minerals and 100 food to build, *planet\_buildings\_cost\_mult* would effect the cost of both the minerals and food, while *planet\_buildings\_minerals\_cost\_mult* would only effect the minerals cost, leaving the food cost at 100.

### Modifier Type

There are two types of modifiers created: *mult* and *add*.

### Triggered Economic Units

Sometimes you'll want more specific modifiers without actually creating a child category. For instance, *planet\_jobs* breaks jobs into smaller categories, such as planet\_farmers. So farmer jobs will assign *planet\_farmers* as their category in their resource block. Now any *planet\_jobs\_xxxx* as well as any *planet\_farmers\_xxxx* modifiers will effect the farmers. But sometimes you want modifiers to only effect a job if some condition is met, or you might want a job to have more than one parent that effects it. These are both accomplished with *triggered economic units*

What if you want a modifier that specifically only effects the resource production when a slave is working the job? Then you use *triggered\_produces\_modifier* blocks to trigger that modifier only when the trigger conditions are met.

```
 planet_jobs = {
 	parent = planets

 	triggered_produces_modifier = {
 		key = planet_jobs_slave
 		modifier_types = {
 			mult
 		}
 		trigger = {
 			is_pop_category = slave
 		}
 	}
 }

```

What if you want a modifier that acts as if it is effected by more than one parent? For instance, Vanilla defines *planet\_districts\_hab\_industrial* and *planet\_districts\_industrial*. You decide you want to create a civic that makes all industrial districts 10% cheaper, so you have *planet\_districts\_industrial* generate *mult* modifiers for *produces*, and in the civic use *planet\_districts\_industrial\_costs\_mult = -0.10*. But, Habitat industrial districts are assigned to *planet\_districts\_hab\_industrial* instead, so they aren't affected. Change their parent to *planet\_districts\_industrial* instead of *planet\_districts*, and the modifier now applies to them. But now you want to make the Voidborne Ascension Perk make all Habitat districts 10% cheaper. You could make a new Economic Category *planet\_districts\_hab* and assign all the *planet\_districts\_hab\_xxxx* categories to it, but you already have assigned *planet\_districts\_hab\_industrial* to *planet\_districts\_industrial*. What you can do instead, is make *planet\_districts\_hab* a triggered econmic unit of *planet\_districts*, and *planet\_districts\_hab\_costs\_mult = -0.10* will now make all the districts on Habitats 10% cheaper, while maintaining the hierarchy of your habitat industrial districts.

```
 planet_districts = {
 	parent = planet_structures

 	triggered_cost_modifier = {
 		key = planet_districts_hab
 		modifier_types = {
 			mult
 		}
 		trigger = {
 			uses_district_set = habitat
 		}
 	}
 }

```

### Localisation and Icons

Each new modifier you have generated and is used requires localisation and most also require an icon (stored in gfx/interface/icons/modifiers) with an identical key. But not all modifiers require an icon - and those that do require an icon require it only if they are used in code somewhere that applies them as a planet or country modifier (example: on buildings, a planet\_class, an ethic etc.). The key for generated modifiers is *mod\_* appended to the front of the modifier. So for our new *planet\_districts\_hab*, you'd need to define the localisation for *mod\_planet\_districts\_hab\_costs\_mult: "Habitat District Cost"* and create the icon in "gfx\interface\icons\modifiers\mod\_planet\_districts\_hab\_costs\_mult.dds".

### Data Structure

* **<key> = {...}** - The name of this category that will be used in the *category* entry of a *resources = {...}* block.

* **parent = <key>** - The parent category of this category. Most Economic Categories have the ultimate parent of *country*
* **hidden = yes** - Use parent category for display. Resources used by this category are merged into parent category in tooltips
* **generate\_mult\_modifiers = {...}** - Specify *produces*, *upkeep*, and/or *cost* to create *<key>(\_<resource>)\_produces\_mult*, *<key>(\_<resource>)\_upkeep\_mult* and/or *<key>(\_<resource>)\_cost\_mult* modifiers
* **generate\_add\_modifiers = {...}** - Specify *produces*, *upkeep*, and/or *cost* to create *<key>(\_<resource>)\_produces\_add*, *<key>(\_<resource>)\_upkeep\_add* and/or *<key>(\_<resource>)\_cost\_add* modifiers
* **use\_for\_ai\_budget = yes** - This category has it's own entry in "common\ai\_budget\" files
* **ai\_use\_parent\_for\_resources\_upkeep = {...}** - Specify resource(s) that the AI uses the parent to manage upkeep for in the parent category in *common\ai\_budget\*. For instance, *ships* alloy upkeep is managed directly (*alloys\_upkeep\_ships* in "ai\_budget\00\_alloys\_budget.txt"), but *ships* energy upkeep is managed via *ships* parent *country* (*energy\_upkeep\_country* in "ai\_budget\00\_energy\_budget.txt"), as *ships* economic category has *ai\_use\_parent\_for\_resources\_upkeep = { energy }*
* **triggered\_(cost/produces/upkeep)\_modifier = {...}** - Generate a *cost*, *produces* or *upkeep* modifier that only applies to a subset of this category.

* **key = <key>** - The <key> for this generated modifier category
* **use\_parent\_icon = yes** - This triggered modifier won't have it's own icon set, so use the category's icon for it
* '*modifyer\_types* - *mult* and/or *add*, depending on which you want generated
* **trigger = {...}** - The trigger conditions to form this subset. The scope depends on the resource block it is assigned to.

## Static modifiers

Static modifiers are game objects defined at "common/static\_modifiers/xxx.txt".

Static modifiers consist of modifier statements and additional fields.

* **icon** - A direct reference to a "xxx.dds" file. planetary static modifiers and some empire static modifiers have this field. If not specified the static modifier icon will be displayed as the icon of the first modifier statement of this static modifier.
* **icon\_frame = 1/2/3** - Applies a green/yellow/red circle frame for the icon of this static modifier. Usually used by planetary static modifiers.
* **custom\_tooltip = <localisation key>** - A tooltip in addition to the generated modifier tooltip.
* **show\_only\_custom\_tooltip = yes/no** - If custom tooltip is specified, setting this to no will hide the generated modifier tooltip.
* **apply\_modifier\_to\_other\_planets = <static modifier key>** - If this Static Modifier is added to a planet, the later Static Modifier will apply to each planet you own without the former. Resort Colony and Penal Colony use this to apply a non-duplicatable empire bonus.

Despite of some static modifiers being exclusively added to specific scopes, static modifiers themselves do not rely on scopes. They can be added to almost any scope: country, planet, pop, ship, federation...

Some static modifiers are hard-coded to be called by the engine. Removing them causes unexpected issues.

### Static modifier integration

Any modifier block can call a static modifier. The engine will find that static modifier and integrate its modifier statements into this block.

Given the following static modifier:

```
example_sm = {
	planet_stability_add = 10
}

```

Then anything that require Modifiers can use `example_sm = <float>` as a Modifier entry. For example, `example_sm = 1.5` is technically equivalent to `planet_stability_add = 15`.

Only modifier statements will be integrated. Custom tooltips and anything else will be ignored.

Unlike scripted triggers and scripted effects, static modifiers can't integrate other static modifiers.

### Notification modifiers

A special variation of static modifiers, except all they have is an icon. They are assigned to country scopes. Use notification modifiers instead of static modifiers if your modifier do not have any modifiers anyway, because modifier updating is performance intensive.

They are defined at "common/notification\_modifiers/xxx.txt".

### How to change vanilla static modifiers?

Place a changed static modifier from any of the core files in "common/static\_modifiers" in a new file that comes *before* asciibetically.

## References

1. ↑ This is a limited field that only accepts a few special modifiers. See Ship Modding for more information
2. ↑ This is a limited field that only accepts a few special modifiers. See Ship Modding for more information

**Modding**