Planet modding

From Stellaris Wiki
Jump to navigation Jump to search

Version

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

This article is for the PC version of Stellaris only.

This guide is for adding and modifying Celestial bodies to the game. For guidelines on how to use them in solar systems, including adding modifiers and inhabitants, see System modding.

Overview[edit]

Planet and star classes can be found in common/planet_classes. Note that "stars" and "star classes" are two different things: individual stars are considered the same as planets in the game code, while star classes (found in common/star_classes) refer to the classification of a solar system as a whole and will determine lighting, the system's icon in the galaxy map, and number of individual stars in a solar system. Information about modding star classes can be found here.

Creating a new planet class is easy: one simply chooses an internal name (ex: "pc_volcanic") and defines how the planet will work in the context of the game. Is it a colonizable world? A star? An inhabitable megastructure? Etc. The internal name doesn't need to reflect the planet's "real" name; using localisation, the name visible to players can be whatever you want it to be.

Planet variables[edit]

Variable Name Default Value Description
@planet_standard_scale 11 Ambiguous, determines visual size of planet?
@habitable_planet_max_size 25 Maximum tile count for planets
@habitable_planet_min_size 12 Minimum tile count for planets
@habitable_moon_max_size 15 Maximum tile count for moons
@habitable_moon_min_size 10 Minimum tile count for moons
@habitable_min_distance 60 Minimum altitude above body (orbit height)
@habitable_max_distance 100 Maximum altitude above body (orbit height)
@habitable_spawn_odds 1 Rational spawn chances (n/1?)

Planet rules[edit]

The following is a list of the different rules you can apply to a planet. The planet will not randomly spawn if these rules are not met, though they can sometimes be bypassed through system modding.

Rule Name Description Notes
atmosphere_color The color of your planet's atmosphere. In the form hsv { 0.0 0.5 1.0 }; numbers must be between 0.0 and 1.0.
atmosphere_intensity The saturation of your planet's atmosphere. Between 0.0 and 1.0.
atmosphere_width The thickness of your planet's atmosphere. Between 0.0 and 1.0.
can_be_moon If no, this planet class will never be used for moons orbiting planets. Defaults to yes.
chance_of_ring The probability that this planet will spawn with a ring system.
city_color_lut A transparent filter that is applied to cities (if habitable) to make it better blend with the background. Must specify the location of the filter. Only necessary on habitable worlds with visible cities.
climate The planet's climate type. Either "dry", "wet", "cold", a modded climate, or none specified.
colonizable Can this planet be colonized or otherwise inhabited, by players and the AI?
enable_tilt If no, disables planet tilt for this planet class. Defaults to yes. Planet tilt is defined in defines.
entity The planet entities your planet will use by default. You can create a custom set of entities (such as "volcanic_planet") or use an existing one (such as "arctic_planet").
entity_scale The size of this planet model compared to others. @planet_standard_scale by default.
extra_orbit_size If higher than 0, will increase the size of the planet's orbit. Gas giants are the only "normal" planet with a value higher than 0 at present.
extra_planet_count If higher than 0, will increase the number of planets this planet counts as. Gas giants are the only "normal" planet with a value higher than 0 at present.
fixed_city_level Permanently applies a fixed amount of infrastructure to this planet's backdrop. Example: fixed_city_level = 6
fixed_entity_scale If yes, this planet's visible size will always be the same regardless of its actual size. Defaults to no.
has_colonization_influence_cost If yes, players/AI will have to spend Influence.png Influence to colonize this planet class. Appears to be an obsolete feature as of Patch 2.0.
icon_frame The icon your planet uses. See Planet icons below.
ideal If yes, this planet will always be 100% habitable to all species. Defaults to no.
max_distance_from_sun The maximum orbital distance at which this planet can randomly spawn. Probably the distance from the center of the system, not the sun itself. How this works in binary or trinary systems is still unclear.
min_distance_from_sun The minimum orbital distance at which this planet can randomly spawn. Probably the distance from the center of the system, not the sun itself. How this works in binary or trinary systems is still unclear.
modifier Applies a permanent modifier to this planet, adjusting resource production, pop growth speed, etc. modifier = { <effect > }
moon_size The range of sizes that this planet will use if it is a moon. moon_size = { min = <value> max = <value> }
orbit_lines If no, disabled orbit lines for this planet class. Defaults to yes.
picture Applies an existing planet's backdrop instead of a custom one. Example: picture = pc_gaia.
planet_size The range of sizes that this planet will use if it is not a moon. planet_size = { min = <value> max = <value> }
production_spawn_chance ? ? ?
show_city If no, any cities on this planet will not be visible in the backdrop. Defaults to yes.
spawn_odds The likelihood that this planet will randomly spawn if all conditions are met.
star Is this planet class a star? Defaults to no.
star_gfx Does this star glow brightly? Defaults to yes if it is a star.
starting_planet Can players/AI start on this planet class?
tile_set Determines the appearance of this planet's tiles. Only necessary if using tiles that don't match your planet class's name (ex: using "pc_gaia" for a planet called "pc_volcanic").
uses_alternative_skies_for_moons If yes, this planet (when it spawns as a moon) will have an alternative backdrop in which a ringless or ringed planet is visible in the sky.

Examples[edit]

A desert world:

pc_desert = {
    entity = "desert_planet"
    icon_frame = 1

    climate = "dry"

    entity_scale = @planet_standard_scale

    atmosphere_color 		= hsv { 0.50 0.2 0.8 }
    atmosphere_intensity 	= 1.0
    atmosphere_width 		= 0.5

    min_distance_from_sun = @habitable_min_distance
    max_distance_from_sun = @habitable_max_distance
    spawn_odds = @habitable_spawn_odds

    city_color_lut = "gfx/portraits/misc/colorcorrection_desert.dds"

    extra_orbit_size = 0
    extra_planet_count = 0

    chance_of_ring = 0.2

    planet_size = { min = @habitable_planet_min_size max = @habitable_planet_max_size }
    moon_size = { min = @habitable_moon_min_size max = @habitable_moon_max_size }

    production_spawn_chance = 0.4

    colonizable = yes
    uses_alternative_skies_for_moons = no
}

A toxic world:

pc_toxic = {
    entity = "toxic_planet"
    entity_scale = @planet_standard_scale
    icon_frame = 11

    atmosphere_color 		= hsv { 0.19 0.45 0.9 }
    atmosphere_intensity 	= 0.1
    atmosphere_width 		= 1.2

    min_distance_from_sun = 60
    max_distance_from_sun = 110

    spawn_odds = 10

    extra_orbit_size = 0
    extra_planet_count = 0

    chance_of_ring = 0.2

    planet_size = { min = 12 max = 25 }
    moon_size = { min = 6 max = 10 }

    colonizable = no
}

A ringworld (habitable section):

pc_ringworld_habitable = {
    ringworld = yes
    entity = "ringworld_habitable_entity"
    picture = pc_ringworld
    tile_set = pc_gaia
    icon_frame = 21
    entity_scale = 1.0
    enable_tilt = no
    fixed_entity_scale = yes
    atmosphere_color 		= hsv { 0.0 0.0 1.0 }
    atmosphere_intensity 	= 1.0
    atmosphere_width 		= 0.5
    show_city = yes
    city_color_lut = "gfx/portraits/misc/colorcorrection_continental.dds"
    extra_orbit_size = 0
    extra_planet_count = 0
    chance_of_ring = 0.0
    planet_size = 5
    moon_size = 1
    colonizable = yes
    ideal = yes
    starting_planet = no
    orbit_lines = no
    has_colonization_influence_cost = no
    modifier = {
        planet_housing_add = 20
    }
}

A class-F star:

pc_f_star = {
    entity = "f_star_class_star_entity"
    entity_scale = 20.0
    picture = "pc_f_star"
    icon_frame = 27

    atmosphere_color 		= hsv { 0.6 0.3 0.6 }
    atmosphere_intensity 	= 1.0
    atmosphere_width 		= 0.5	

    star = yes

    min_distance_from_sun = 0
    max_distance_from_sun = 0
    spawn_odds = 0

    extra_orbit_size = 0
    extra_planet_count = 0

    chance_of_ring = 0

    planet_size = { min = 20 max = 35 }

    colonizable = no
}

Planet icons[edit]

Planet icons can be found in gfx/interface/icons/planet_type_icons.txt. For reference, here is a list of which values to use for which icon:

Icon #
Planet desert.png 1
Planet arid.png 2
Planet tundra.png 3
Planet continental.png 4
Planet tropical.png 5
Planet ocean.png 6
Planet arctic.png 7
Planet gaia.png 8
Planet barren cold.png 9
Planet barren.png 10
Planet toxic.png 11
Planet molten.png 12
Planet frozen.png 13
Planet gas giant.png 14
Planet ai.png 15
Planet infested.png 16
Planet nuked.png 17
Planet asteroid.png 18
Planet alpine.png 19
Planet savannah.png 20
Planet ringworld.png 21
Planet habitat.png 22
Planet shroud.png 23
Planet city.png 25
Planet m star.png 26
Planet f star.png 27
Planet k star.png 28
Planet b star.png 29
Planet pulsar.png 30
Planet neutron star.png 31
Planet black hole.png 32

Terraforming[edit]

Terraforming is defined separately from planets in files found in common/terraform. These are relatively straightforward definitions, but do need to be defined for each individual link between two planet types. That means, for example, if a modder wishes to add a new planet type that can be terraformed into anything and have anything terraformed into it they will have to define two links for each existing planet type, one to transform a given type into the new one, and one to transform the new one into each existing type. A basic example of a terraforming link definition can be seen below:

   terraform_link = {
       from = "pc_continental"
       to = "pc_tropical"
   
       energy = 2000
       duration = 1800
   
       condition = {
           has_technology = "tech_terrestrial_sculpting"
       }
   
       ai_weight = {
           weight = 0
       }
   }

Each link definition starts with the header terraform_link and then is followed by arguments determining the starting and ending planet classes for the terraforming operation. After that it is followed by the cost of the terraforming operation as well as how long the operation will take to complete. Afterwards the link has a condition block. This is used to determine what requirements are needed before a terraforming operation can be performed, and is used to lock certain transformations behind technology or ascension perks. Lastly a terraforming link definition includes an ai_weight entry, which is used to determine whether or not an AI will perform a terraforming.

If desired there are some slightly modifications that can be performed on the basic format. One is to use a potential block. When used this will cause the terraforming option to only appear if the listed requirements are met. For example this terraforming link definition

   terraform_link = {
       from = "pc_barren_cold"
       to = "pc_arctic"
       
       energy = 5000
       duration = 3600
       
       potential = {
           from = { has_modifier = terraforming_candidate }
       }
       condition = {
           has_technology = "tech_climate_restoration"
       }
       
       effect = {
           from = { remove_modifier = terraforming_candidate }
       }
       
       ai_weight = {
           weight = 5
       }
   }

Will only show up in the menu if the pc_barren_cold planet also has the terraforming_candidate modifier, and will not be available otherwise.

A final note is that terraform_link's also support effect blocks as well. These are operations that are performed immediately upon completion of the terraforming operation. For example adding this block:

   effect = {
       from = { remove_modifier = terraforming_candidate }
   }

Will cause the "terraforming_candidate" modifier to be removed from the terraformed planet upon completion.

Empire EmpireEthicsGovernments • Civics • OriginsMandatesAgendasTraditions • Ascension PerksEdictsPoliciesRelicsTechnologiesCustom Empires
Pops JobsFactions
Leaders LeadersLeader Traits
Species SpeciesSpecies Traits
Planets PlanetsPlanetary Feature • Orbital DepositBuildings • DistrictsPlanetary Decisions
Systems SystemsStarbasesMegastructuresBypassesMap
Fleets FleetsShips • Components
Land Warfare ArmiesBombardment Stance
Diplomacy Diplomacy • Federations • Galactic CommunityOpinion ModifiersCasus Belli • War Goals
Events EventsAnomaliesSpecial projectsArchaeological Sites
Gameplay GameplayDefinesResources • Economy
Dynamic modding Dynamic moddingEffectsConditionsScopesModifiersVariablesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop