Technology modding

Version

This article has been verified for the current PC version (3.1) of the game.

The technology game data can be found in these files/folders:

* **Stellaris/common/technology**

It is possible to mod in new technologies, or "erase" old ones.

# These are simply constants that can be used to assign technologies to right cost for each tier easily. You can add your own as well.
@example\_cost = 1000
@tier1cost1 = 500
@tier1weight1 = 100

technology\_name = {
 # Code name of the technology. This is referred to in other files that unlock things via technology, such as 00\_spaceport\_modules.txt.

 cost = @tier1cost1
 # This sets the cost of the technology in research points.
 # Parameters: constant, integer

 area = society
 # The area of technology this belongs to.
 # Parameters: physics, society, engineering

 tier = 1
 # Each technology is split into tiers.
 # You need to have researched 5 technologies within one tier to see any technologies of the next tier above. There are five tiers.
 # Parameters: 0, 1, 2, 3, 4, 5, found in 00\_tiers.txt

 category = { biology }
 # The category of technology. Scientists with modifiers for this category will research this technology quicker/slower.
 # Parameters: category\_name found in 00\_category.txt

 levels = -1
 # Controls the number of levels this technology has. -1 means it is repeatable.
 # Parameters: integer, -1

 cost\_per\_level = @repeatableTechLevelCost
 # Controls the cost per level of this technology.
 # Parameters: constant, integer

 prerequisites = { "prerequisite\_technology" }
 # This technology requires "tech\_eco\_simulation" to have been researched before it will appear as an option
 # Parameters: technology\_name

 weight = @tier1weight1
 # This is the initial weighting of the technology used to determine whether or not the technology should appear as an option.
 # Parameters: constant, integer

 gateway = biological
 # a flavor-text-only entry that shows what kind of technology is behind this tech.

 ai\_update\_type = military
 # controls AI auto-updating, ai\_update\_type will make the AI to update existing military ship designs and starbases,
 # and if update type is all, civilian ships and stations will also be updated.
 # Parameters: military, all

 start\_tech = yes/no
 # Defines this technology as a starting technology

 modifier = { }
 # Contains any modifiers this technology directly changes.

 feature\_flags = { my\_tech\_flag }
 # flavor-text-only entries that tells the player what does this tech do.
 # the localisation key "my\_tech\_flag" is used for this and "my\_tech\_flag\_desc" is used for the tooltip.
 # All feature\_flags are hardcoded, you cannot create new ones.

 prereqfor\_desc = {
 ship = {
 title = "EXAMPLE\_TECH\_TITLE"
 desc = "EXAMPLE\_TECH\_DESC"
 }
 }
 # This is used to add localisation telling the player that this technology is a prerequisite for another important technology

 potential = {
 }
 # If this block is evaluated false, this tech can't be drawn as an option.
 # DLC exclusive techs are hidden this way.

 weight\_modifier = {
 modifier = {
 factor = 1.5
 has\_ethic = ethic\_pacifist
 }
 }
 # These are the weighting modifier used to determine how likely this technology is drawn as an option.
 # If weight is multiplied by 0, this tech can't be drawn as an option, but can still be given by scripts and console commands.

 ai\_weight = {
 factor = 1.5
 modifier = {
 factor = 2
 has\_ethic = ethic\_pacifist
 }
 }
 # These are the ai weighting modifiers used to by the AI to determine how likely it will research this technology.

 weight\_groups = {
 repeatable
 }
 # This is a weight group to be used later

 mod\_weight\_if\_group\_picked = {
 repeatable = 0.01
 }
 # Weight of this technology is multiplied by each value if another technology from respective weight group have already been drawn as an option
 # In this case, if there is already a repeatable tech drawn as an option, this tech is 0.01 times likely to be drawn.
}

```

## List of standard techs

Here are lists for all standard Techs with key, name and tier:

## Adding Techs

If you are new to modding Stellaris, the best way to understand how to create new technologies is to use the vanilla techs as examples.

```
tech_nutrient_replication = {
	cost = @tier3cost3
	area = society
	tier = 3
	category = { biology }
	prerequisites = { "tech_nano_vitality_crops" }
	weight = @tier3weight3

	potential = {
	}

	modifier = {
		planet_jobs_food_produces_mult = 0.15
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 1.25
			research_leader = {
				area = society
				has_trait = "leader_trait_expertise_biology"
			}
		}
	}
}

```

### ID Name

The first line, `tech_nutrient_replication = {` declares the ID Name for the technology. This is not the name that will display in-game, rather, the unique ID that other files, including language files, will reference the tech as. It is best to name it similarly to the technology's planned name, so a tech named "Better Farms" would be `tech_better_farms`. Of course, this is not required. ID Names do not support spaces, and should be replaced with underscore ( \_ )

### Cost

Here is a list of the variables Stellaris uses for most of its technologies. The cost determines how long it will take to research the technology.

```
@tier1cost1 = 2000
@tier1cost2 = 2500
@tier1cost3 = 3000

@tier2cost1 = 4000
@tier2cost2 = 5000
@tier2cost3 = 6000

@tier3cost1 = 8000
@tier3cost2 = 10000
@tier3cost3 = 12000

@tier4cost1 = 16000
@tier4cost2 = 20000
@tier4cost3 = 24000

@tier5cost1 = 32000
@tier5cost2 = 40000
@tier5cost3 = 48000

```

Cost can be set to any number within the 32bit integer limit.

```

# Using a custom weight
weight = 9000

```

### Weight

Weight controls how likely a tech is to be "drawn", the higher the number, the higher the likelihood of it appearing compared to other techs.

Here is a list of the weights Stellaris uses for most of its techs.

```
@tier1weight1 = 100
@tier1weight2 = 95
@tier1weight3 = 90

@tier2weight1 = 85
@tier2weight2 = 75
@tier2weight3 = 70

@tier3weight1 = 65
@tier3weight2 = 60
@tier3weight3 = 50

@tier4weight1 = 45
@tier4weight2 = 40
@tier4weight3 = 35

@tier5weight1 = 30
@tier5weight2 = 25
@tier5weight3 = 20

```

The syntax and usage of a tech's weight is the same as tech cost. A tech with low weight (i.e. 5) will have a much lower chance to be "drawn" than other techs. These are not definitive values however, and are compared to every other valid tech in the game.

```

# Using a custom weight
weight = 15

```

### Tier

The '`tier`' of a technology, while not shown ingame, does determine how many techs of a previous tier have to be researched for the next tier to become unlocked.
I.e. a Tier 3 technology cannot be "drawn" until the country owns at least six Tier 2 technologies.
These are also easily moddable via its file, see *#Tiers*.

```
Tier 0 is used for starting technologies.
Tier 1 – 3 are typically unlocked near the earlygame to the midgame
Tier 4 – 5 typically near to after endgame.

```

### Area

This determines the technology's research area, as seen in the research panel.

```
area = society

### Category

This determines the category of a technology, used with the Expertise scientist traits to increase speed in a specific area of research.

```
# Note the Curly brackets / Braces {}
category = { biology }

```

Despite the curly brackets, this is not an array; as there can only be one category for each tech.

```

# Society
psionics, new_worlds, statecraft, biology, military_theory

# Engineering
materials, rocketry, voidcraft, industry

```

For adding new categories, see *#Categories*.

### Potential

"Potential" determines whether the specific country is allowed to "draw" the technology.

```
potential = {
	has_authority = auth_democratic
}

```

A tech with this potential is accessible only to Democratic countries.
More logic explanation in the weight section.

### AI Update Type

```
ai_update_type = military
# Remove if not used

```

Techs with this variable set will update ship designs upon researching. If this field is all, civilian ships will be upgraded. Used for component-unlocking technologies.

### Prerequisites

Prerequisites (careful on the spelling) determine required technologies for the tech.

```
prerequisites = { "tech_droid_workers" }

```

A technology with this prerequisite will require researching Droid Workers first.
In this case, prerequisites works as an "array", or a list of items, and can have multiple or many required techs.

```
prerequisites = { "tech_droid_workers" "tech_colonial_centralization" }

```

This will make the tech require "Droids" and "Colonial Centralisation" in order to research.

### Tech tags

There are a few other tags:

* `is_reverse_engineerable = yes/no` – Reverse engineerable tech, allows to reverse engineer from debris – only supports ship component technologies, such as Dark Matter Power or Railguns (etc.), as the game checks against the requirements for said components.
* `start_tech = yes/no` – Starting tech, given at the start of the game – determines whether valid empires start with the technology. Valid empires are determined by a tech's Potential.
* `is_rare = yes/no` – Rare tech, marks as purple – see *Advanced Tech Modding* for more.
* `is_dangerous = yes/no` – Dangerous Tech, marks as red – see *Advanced Tech Modding* for more.

### Weight Modifiers

Now we enter logic gate territory with Weight Modifiers and add/factor. These change how likely the tech is to appear in any given tech "card draw", after each completed research. An example:

```
weight_modifier = {
	factor = 4 # weight × 4
	modifier = {
		factor = 0.75 # weight × 0.75
		NOR = {
			has_ethic = ethic_pacifist
			has_ethic = ethic_fanatic_pacifist
		} # Is not pacifist
	}
	modifier = {
		add = 2 # +2 to original weight amount
		OR = {
			has_ethic = ethic_militarist
			has_ethic = ethic_fanatic_militarist
		} # Is militarist
	}
}

```

This would reduce the weight of a technology if the researcher does not have either pacifist ethics, and increase it if militarist.

#### Weight Modifier

This will contain all of the modifiers that would affect the technology's chance to draw.

```
weight_modifier = { … }

```

Remember to count your braces.

#### Add & Factor

This is how the condition affects the likelihood of the tech appearing. "Factor" means multiply in this case.

```
modifier = {
	factor = 0.75
	has_ethic = ethic_fanatic_pacifist
}

```

This will multiply the base weight by 0.75 for countries that are fanatic pacifist.

```
modifier = {
	add = 3
	has_ethic = ethic_fanatic_militarist
}

```

This will increase the base weight by 3 for countries that are fanatic militarist.

#### Logic Gates

*Main article: Conditions*

Paradox text files use several logic gates that are found in traditional computer programming: AND (all values must be true), OR (any value must be true), NOT (all values must be false, reverses output), and NOR (no values can be true).

```
	factor = 0.01
	OR = {
		has_ethic = ethic_pacifist
		has_ethic = ethic_fanatic_pacifist
	}

```

In an OR logic gate at least one value within must return true, else the OR returns false. For this example, empires that are not pacifist are far less likely to draw this technology.

```
	factor = 1.5
	AND = {
		has_authority = "auth_imperial"
		has_civic = "civic_imperial_cult"
	}

```

In the AND gate, all values within must return true, else the AND returns false. This example will increase a tech's weight by 50% if the country has the Imperial authority AND has the Imperial Cult civic.

```
	factor = 0.01
	NOT = {
		has_ethic = "ethic_spiritualist"
	}

```

```
	factor = 0.01
	NOR = {
		has_ethic = "ethic_spiritualist"
		has_ethic = "ethic_fanatic_spiritualist"
	}

```

NOT is a reversed logic gate. If the values within a "NOT" return true, then the NOT returns false. It should be noted that "NOT" and "NOR" have similar use.

Logic gates can only be nested limited times;

```
	factor = 0
	OR = {
		NOT = { is_country_type = default }
		AND = {
			has_civic = civic_fanatic_purifiers
			has_ethic = ethic_spiritualist
		}
		AND = {
			has_civic = civic_death_cult
			has_ethic = ethic_fanatic_militarist
		}
	}
	NOR = {
		has_ethic = ethic_xenophile
		has_ethic = ethic_fanatic_xenophile
	}

```

(Note: This block of code does not appear anywhere in Stellaris.)
#### Research Leader

The weight can be affected by who's in charge of research, and here's how to do it. First, open with `research_leader = {`. Now, here is where you make your decision. First, area, meaning which department your scientist is in. It really is just a coding convention, since it will only appear in that category anyways. (So I think it's supposed to increase the chance is there is a leader.) Next is "has\_trait", which is self-explanatory. It is used to increase or decrease the likelihood of a tech appearing if a certain trait exists or is missing. Here is a list of all traits that can be used with it (for scientists):

```

# Sentient AI Assistant (+10% Research Speed (All Techs), +20% Survey Speed, +30% Anomaly Research Speed)
"leader\_trait\_sentient\_AI\_assistant"

# Expertise: Field Manipulation (+15% Research Speed (Field Manipulation))
"leader\_trait\_expertise\_field\_manipulation"

# Expertise: Military Theory (+15% Military Theory)
"leader\_trait\_expertise\_military\_theory"

```

Please note, this only includes base game, no DLCs are included.

#### Has Level

This tag, "`has\_level`", uses inequality signs (< and >), to boost or lower the chance based on the level. Currently, it goes up to level 5, and here is an example of its usage in game:

```
modifier = {
	factor = 1.25
	research_leader = {
		area = physics
		has_trait = "leader_trait_expertise_voidcraft"
		has_level > 2
	}
}
modifier = {
	factor = 1.50
	research_leader = {
		area = physics
		has_trait = "leader_trait_expertise_voidcraft"
		has_level > 3
	}
}

```

Here, the "`has\_level`" tag is used to check is the leading scientist is higher than level 3, and if so, increase the likelihood of the tech by \*1.5.

#### Years Passed

Self-Explanatory. Increases the chance if the years past since the start of the game is greater than or less than a certain year. Like this:

```
years_passed < 20

#### Scopes and Triggers

The most important part of weight modifiers. Scopes are used to determine what the following statements apply to. Please note, only a few scopes matter, such as '`research\_leader`'. Triggers are the most important part of the entire weight modifier section. Triggers create the main thing that allows for specific cases where certain factors can affect the chance either positively or negatively.

##### Example #1: Locking to certain ethics

Using triggers, you can create a tech that can only be used by egalitarians or xenophiles, and it is more likely to appear if you are an egalitarian, and less likely to appear if you only have one of the two. It is even less likely to appear if the fanatic one is xenophile.

```
weight_modifier = {
	factor = 0.5   # Sets the base chance of the tech appearing
	modifier = {
		factor = 0   # Sets chance to 0 if the empire does not have any of the following ethics.
		NOR = {
			has_ethic = ethic_egalitarian
			has_ethic = ethic_fanatic_egalitarian
			has_ethic = ethic_xenophile
			has_ethic = ethic_fanatic_xenophile
		}
	}
	modifier = {
		factor = 1.5   # Increases the chance if the empire has both egalitarian and xenophile ethics.
		AND = {
			OR = {
				has_ethic = ethic_egalitarian
				has_ethic = ethic_fanatic_egalitarian
			}
			OR = {
				has_ethic = ethic_xenophile
				has_ethic = ethic_fanatic_xenophile
			}
		}
	}
	modifier = {
		factor = 1.5   # Increases the chance if the empire is fanatic egalitarian.
		has_ethic = ethic_fanatic_egalitarian
	}
	modifier = {
		factor = 1.25   # Slightly increases the chance if the empire is fanatic xenophile.
		has_ethic = ethic_fanatic_xenophile
	}
}

```

##### Example #2: Traits

In this example, the triggers will use the traits of the leader in research and the ruler of the empire. Namely:

* If the leader is maniacal, then the chance should be increased.
* If the leader has an expertise, the chance should be reduced.
* If the leader is spark of genius, increase the chances even more.
* If the leader has a modifier that affects the age of the leader, then decrease the chance. Decrease the chance even more if the age went down.
* If the leader has arrested development, but no expertise, then increase the chance.

## Advanced Tech Modding

**NOTE: All of these can crash your game on launch!**

### Tiers

It is possible to add and modify tiers in the game, the game requires them to be in order (you cannot go from 5 to 7, etc.) meaning that they are semi-hardcoded and require careful handling. If you load a game with a missing tier; your game will crash on load.

From: Stellaris/common/technology/tier/00\_tiers.txt

```
####
#	Technology tiers
#
#	weight_modifier = {
#		factor = 1
#		modifier = {
#			add = 10
#			OR = {
#				has_government = "military_dictatorship"
#				has_government = "martial_empire"
#			}
#		}
#	}
####

# The previously_unlocked-value decides how many techs in the previous tier has to be researched before the tier is unlocked

0 = { # Tier 0
}

1 = { # Tier 1
	previously_unlocked = 0
	weight_modifier = {
		base = 1
		complex_trigger_modifier = {
			trigger = num_researched_techs_of_tier
			parameters = {
				tier = 3
			}
			mode = add
			mult = 0.2
		}
	}
}

2 = { # Tier 2
	previously_unlocked = 6
	weight_modifier = {
		base = 1
		complex_trigger_modifier = {
			trigger = num_researched_techs_of_tier
			parameters = {
				tier = 4
			}
			mode = add
			mult = 0.2
		}
	}
}

3 = { # Tier 3
	previously_unlocked = 6
	weight_modifier = {
		base = 1
		complex_trigger_modifier = {
			trigger = num_researched_techs_of_tier
			parameters = {
				tier = 5
			}
			mode = add
			mult = 0.2
		}
	}
}

4 = { # Tier 4
	previously_unlocked = 6
	weight_modifier = {
		base = 1
		complex_trigger_modifier = {
			trigger = num_repeatable_techs
			mode = add
			mult = 0.2
		}
	}
}

5 = { # Tier 5
	previously_unlocked = 6
	#weight multiplier is always 1
}

```

### Categories

It is possible to modify categories in the game, however as of now it is impossible to add new ones, meaning that only their icon can be edited.

From: Stellaris/common/technology/category/00\_category.txt

```
materials = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_materials.dds"
}

propulsion = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_propulsion.dds"
}

voidcraft = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_voidcraft.dds"
}

industry = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_industry.dds"
}

field_manipulation = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_field_manipulation.dds"
}

particles = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_particles.dds"
}

computing = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_computing.dds"
}

psionics = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_psionics.dds"
}

new_worlds = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_new_worlds.dds"
}

statecraft = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_statecraft.dds"
}

biology = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_biology.dds"
}

military_theory = {
	icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_military_theory.dds"
}

```

### Tech tags

As already mentioned above tech tags `is_rare` and `is_dangerous` are only cosmetic and do not effect the game.
"`is\_rare`" (changing the tech's graphics to purple) does not inherently reduce the chance of rolling it, nor does "`is\_dangerous`" (changing the tech's graphics to red) create danger on its own.

#### Rare Technologies

To make a rare technology "rare", you will need to add the following lines of code to the weight\_modifier.

```
modifier = {
	factor = @ap_technological_ascendancy_rare_tech
	has_ascension_perk = ap_technological_ascendancy
}

```

#### Dangerous Technologies

Dangerous technologies are more complicated and require event modding to work.
For more see Event modding or alternatively direct at Stellaris/events/crisis\_trigger\_events.txt.

## References

1. ↑ 1.0 1.1 If not defined in the file itself there are from: Stellaris/common/scripted\_variables/00\_scripted\_variables.txt
2. ↑ If you do not use mods, like "Tech Tiers Revealed".

**Modding**