Government modding

Version

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

This article is for the PC version of Stellaris only.

The following guide contains information related to modding empire's government and things contained inside related folder.

## Governments

Governments are automatically picked based on various factors for a flavor. They have few actual effects on gameplay. Vanilla uses civics, authorities and ethics to determine it. Governments are defined at "common/governments/xxx.txt".

### Data Structure

 **election\_candidates*** **modifier**
	+ **add = <int>**
	+ Conditions (Leader scope)
Vanilla governments usually give the current ruler 100 weight and give weight to certain leader classes depending on the government itself, like Militarist governments usually allow only Admirals and Generals and Materialist governments usually allow only Scientists.

### Empire Random Names

All vanilla empire random names are directly linked to Government Types, meaning that new random names must be defined for the new government types, or the randomly generated AI empires using your new government will NOT receive a name and the game might crash.

Empire random names are defined at "common/random\_names/xxx.txt".

## Authorities

An Authority is how the empire distribute the internal political powers. An empire can only have one Authority. Authorities are defined at "common/governments/authorities/xxx.txt".

### Data Structure

Other effects an Authority might also have, such as immortal rulers, are heavily integrated into other vanilla files as well as events. Use `has_authority = auth_xxx` to check the Authority of an Empire.

## Civics and Origins

Civics are additional bonuses to the government of variable effects, some can even affect the playstyle. An empire can have any number of Civics (up to 3 if vanilla).

Origins are Civics with `is_origin = yes` statement. Since an empire can only have one origin and it can't be changed mid-game, some of the fields for civics are irrelevant to Origins. Also, they have additional fields.

They are defined at "common/governments/civics/xxx.txt".

### Data Structure

Implementions of other effects a Civic might also have, such as diplomatic restrictions, are integrated into other vanilla game files. Use **has\_valid\_civic** to check Civics.

Most of the other effects an Origin might also have (for example, starting conditions), are implemented through Events. Use **has\_origin** to check Origins.

### Examples

#### Civics

**Fanatic Purifiers**0

```
civic_fanatic_purifiers = {
	modification = no
	playable = { host_has_dlc = "Utopia" }
	potential = {
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
		authority = { NOT = { value = auth_corporate } }
	}
	possible = {
		ethics = {
			value = ethic_fanatic_xenophobe
			OR = {
				value = ethic_militarist
				value = ethic_spiritualist
			}
		}
		civics = {
			NOR = {
				value = civic_barbaric_despoilers
			}
		}
		origin = {
			NOR = {
				value = origin_syncretic_evolution
				value = origin_common_ground
				value = origin_hegemon
			}
		}
	}
	random_weight = {
		base = 1000
		modifier = {
			factor = 0
			NOT = { host_has_dlc = "Utopia" }
		}
	}

	description = "civic_tooltip_fanatic_purifiers_effects"
	modifier = {
		ship_fire_rate_mult = 0.33
		army_damage_mult = 0.33
		starbase_shipyard_build_cost_mult = -0.15
		country_naval_cap_mult = 0.33
	}
}

```

**Driven Assimilator**0

```
civic_machine_assimilator = {
	potential = { authority = { value = auth_machine_intelligence } }
	possible = {
		civics = {
			NOR = {
				value = civic_machine_servitor
				value = civic_machine_terminator
			}
		}
	}
	modification = no
	random_weight = {
		base = 5
		modifier = {
			factor = 0
			NOT = { host_has_dlc = "Synthetic Dawn Story Pack" }
		}
		modifier = {
			# civic has no effect after galaxy generation, disable for random generation
			factor = 0
			has_global_flag = game_started
		}
	}
	description = civic_tooltip_machine_assimilator_effects
	has_secondary_species = {	# see game_start.11
		title = civic_machine_assimilator_secondary_species
		traits = {
			trait = trait_cybernetic
		}
	}
}

```

**Devouring Swarm**0

```
civic_hive_devouring_swarm = {
	modification = no
	potential = {
		authority = { value = auth_hive_mind }
	}
	possible = {
		origin = {
			NOR = {
				value = origin_common_ground
				value = origin_hegemon
			}
		}
	}
	random_weight = { base = 5 }

	description = "civic_tooltip_devouring_swarm_effects"
	modifier = {
		country_starbase_influence_cost_mult = -0.5
		ship_hull_mult = 0.25
		ship_hull_regen_add_perc = 0.5
		ship_armor_regen_add_perc = 0.5
		army_damage_mult = 0.40
		category_biology_research_speed_mult = 0.20
		starbase_shipyard_build_cost_mult = -0.25
		country_naval_cap_mult = 0.33
	}

	swap_type = {
		name = civic_hive_devouring_swarm_lithoid
		description = "civic_tooltip_devouring_swarm_lithoid_effects"

		trigger = {
			local_human_species_class = LITHOID
		}
	}
}

```

#### Origins

**Syncretic Evolution**0

```
origin_syncretic_evolution = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/origins_syncretic_evolution.dds"
	picture = GFX_origin_syncretic_evolution

	playable = {
		host_has_dlc = "Utopia"
	}

	possible = {
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
		civics = { NOT = { value = civic_fanatic_purifiers } }
	}

	description = civic_tooltip_syncretic_evolution_effects

	has_secondary_species = {	# see game_start.11
		title = civic_syncretic_evolution_secondary_species
		traits = {
			trait = trait_syncretic_proles
		}
	}

	advanced_start = yes

	random_weight = {
		base = 10
	}
}

```

**Life Seeded**0

```
origin_life_seeded = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/origins_life_seeded.dds"
	picture = GFX_origin_life_seeded

	starting_colony = pc_gaia
	habitability_preference = pc_gaia
	preferred_planet_class_neighbor = no

	playable = {
		host_has_dlc = "Apocalypse"
	}

	possible = {
		authority = { NOT = { value = auth_machine_intelligence } }
	}

	description = "civic_tooltip_life_seeded_effects"

	random_weight = {
		base = 5
	}
}

```

## Special Requirement Syntax

The Civics use special requirement syntax and they don't accept regular Conditions. If it was implemented the other way, since incompatible Civics have no effect and a Civic can turn invalid literally anytime, it would be too performance intensive to check all empires for all civics everyday.

All they can check are civics, ethics, authorities, origins, country types and species archetypes. A single row of statement consist of "value = " and the relevant object key. Logical operators, namely NOT, AND, OR, and NOR, can be used to group one or more statements of the same category together, with an optional "text" entry which replaces the auto-generated tooltip for the entire logical block, but they cannot nest with each other and they cannot cross the category.

This is an example of this special syntax.

```
possible = {
	authority = {
		OR = {
			*# text specified here replaces auto-generated tooltips for this block*
			text = civic_tooltip_dem_oli_dic
			value = auth_democratic
			value = auth_oligarchic
			value = auth_dictatorial
		}
	}
	ethics = {
		value = ethic_fanatic_pacifist
		NOR = {
			text = civic_tooltip_not_authoritarian
			value = ethic_authoritarian
			value = ethic_fanatic_authoritarian
		}
	}
	origin = {
		NOR = {
			value = origin_common_ground
			value = origin_hegemon
		}
	}
	species_archetype = {
		*# Only species archetypes can be specified here*
		value = LITHOID
	}
}

```

Nested logic blocks **don't work**.

```
ethics = {
	OR = {
		AND = {
			value = ethic_fanatic_authoritarian
			value = ethic_militarist
		}
		AND = {
			value = ethic_authoritarian
			value = ethic_fanatic_militarist
		}
	}
}

```

Cross-category logic blocks **don't work** either.

```
OR = {
	ethics = {
		value = ethic_materialist
	}
	authority = {
		value = auth_imperial
	}
}

```

**Modding**