Planet Generation modding

Version

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

This article is for the PC version of Stellaris only.

This page is about modding Deposits and Planet Modifiers.

## Deposits

Deposits are objects on Planets that can have its own resource production and upkeep and Modifiers to the planet.

There are two types of Deposits, one being the planetary features for the colonizable planets that can be inspected by the player, and another being the orbital deposits for the uncolonizable planets that usually can't be inspected by the player.

There are two types of planetary features, one being normally pure-beneficial and unremovable and another being normally pure-harmful and can be removed by spending resources, called blockers. Some blockers spawn with an additional planetary feature behind it, but the seemingly "blocked" planetary feature isn't actually added to the planet before the blocker to be cleared. Although vanilla unused, a blocker can also block a blocker behind it.

They are defined at "common/deposits/xxx.txt".

### Deposit Categories

Planetary features are grouped by Deposit Categories defined at "common/deposit\_categories/xxx.txt". They are so simple that they have only two properties. This is used to diverse planetary features to make the planet have relatively less "extreme" maximum district distribution.0

```
deposit_cat_food = { }
deposit_cat_energy = {}
deposit_cat_minerals = {}
deposit_cat_blockers = {
	blocker = yes # Counts as blockers
}
deposit_cat_rare = {
	important = yes	# Shows up as rare deposits in planetview
}
deposit_cat_rare_blocker = {
	blocker = yes # Counts as blockers
	important = yes	# Shows up as rare deposits in planetview
}

```

### The Null Orbital Deposit

There is a null orbital deposit present. It generates no resources and doesn't support any kind of orbital stations, functioanlly play as a placeholder for the uncolonizable planets devoid of deposits. An uncolonizable planet that doesn't meet the `potential` of the null deposit will always have an orbital deposit.0

```
d_null_deposit = {
	is_null = yes

	potential = {
		is_primary_star = no
		NOR = {
			is_planet_class = pc_ringworld_habitable_damaged
			is_planet_class = pc_ringworld_tech_damaged
		}
	}

	drop_weight = {
		weight = 100
	}
}

```

### Examples

**Planetary Feature: Hot Springs (+1 Max Generator Districts)**0

```
d_hot_springs = {
	is_for_colonizeable = yes
	use_for_min_max_adjustments = yes

	category = deposit_cat_energy

	use_weights_for_terraforming_swap_types = yes
	should_swap_deposit_on_terraforming = yes
	terraforming_swap_types = {
		d_arid_highlands
		d_buzzing_plains # gaia
	}

	planet_modifier = {
		district_generator_max = 1
	}

	potential = {
		OR = {
			is_cold = yes
			is_wet = yes
			is_planet_class = pc_nuked
		}
	}

	drop_weight = {
		weight = @high
		modifier = {
			factor = @planet_type_bonus
			is_dry = yes
		}
	}
}

```

**Blocker: Dangerous Wildlife**0

```
d_dangerous_wildlife_blocker = {
	time = 270

	is_for_colonizeable = yes
	category = deposit_cat_blockers

	resources = {
		category = deposit_blockers
		cost = {
			energy = 500
		}
	}

	potential = {
		planet_size >= 10
	}

	planet_modifier = {
		planet_max_districts_add = -2
	}

	on_cleared = {
		hidden_effect = {
			if = {
				limit = {
					exists = owner
					owner = {
						has_civic = civic_hive_devouring_swarm
					}
				}
				owner = { add_resource = { food = 200 } }
			}
		}
	}

	drop_weight = {
		weight = @blocker_low
		modifier = {
			factor = 0.5
			planet_size < 15
		}
		modifier = {
			factor = 0
			num_free_districts = {
				type = district_city
				value < 2
			}
		}
	}

	prerequisites = { "tech_dangerous_wildlife" }
}

```

**Orbital Deposit: 1 Society Research**0

```
d_society_1 = {
	resources = {
		category = orbital_research_deposits
		produces = {
			society_research = 1
		}
	}
	station = shipclass_research_station
	is_for_colonizeable = no

	potential = {
		is_planet_class = pc_toxic
	}

	drop_weight = {
		weight = 0
	}
}

```

## Planet modifiers

Planet modifiers are additional modifiers given to planet objects upon planet generation. They are linked to static modifiers but not equivalent to them. They are defined by files in the Stellaris/common/planet\_modifiers/ folder. Static modifiers added directly to a planet by an effect or anomaly don't need to have a planet modifier defined here.

**Planet modifier data structure**
	+ **base = <int>**
	+ **modifier = {**
		- **add = <int>**
		- **<conditions>**
	+ **}**
	+ **modifier = {**
		- **factor = <float>**
		- **<conditions>**
	+ **}**
* **}**
 **modifier = "<static modifier>"** | Key of the static modifier to be added to the planet.

### The null planet modifier

There is a null planet modifier defined in the Stellaris/common/planet\_modifiers/00\_planet\_modifiers.txt file that has no linked static modifier. It's purpose is to control how common other modifiers are; it has a base weight of 275 (most vanilla planet modifiers have a weight of 10 before spawn chance weight modifiers), which gets multiplied by 3 for each modifier the planet already has in order to make planets with multiple modifiers increasingly rare.

**pm\_null = {**0
is\_null = yes

spawn\_chance = {
base = 275
modifier = {
factor = 3
num\_modifiers > 2
}
modifier = {
factor = 3
num\_modifiers > 1
}
modifier = {
factor = 3
num\_modifiers > 0
}
}0**}**

**Modding**