# Is there anyway to control the dense of habitable planets in different location?

#### onlyplaystellaris

##### Recruit
Sorry, I'm quite new to modding, I wanna make a mod about galaxy generation. In my thoughts, the galaxy core should be much more denser than the outer, but there should also be less amount of habitable planets than the outer galaxy. In this way, the inner ring empires can control more systems, but they will eventually own the same amount of habitable planets as the outer ring countries.

Is there anyway to do this? Thanks.

Last edited:
Solution
Thank you, but how to define the distance between solar system and the galactic core?
I havent tested the below in game to make sure i've not made a mistake, but i'd do something like this.
See "every_system" and "distance to core"

#### onlyplaystellaris

##### Recruit
Okay, I successfully make the core denser than outer galaxy.

by editing these codes:
num_stars_core_perc = 0.25 # Number of stars in core

under map\galaxy\spiral_4.txt

Next step is to find out how to control the habitable planets generation.

#### Kolath

##### Corporal
Cool! Will be watching this mod.

#### Pancakelord

##### General
I wanna make a mod about galaxy generation. In my thoughts, the galaxy core should be much more denser than the outer, but there should also be less amount of habitable planets than the outer galaxy.
You could write a script that runs on game start and looks at all stars within 0 - 0.25 (to use your variable) distance from the core, for each star system, if it has a habitable planet, that is not a capital/owned, roll a value (random list 1 / 2 / 3 ) and if it lands on, say, 1, convert that planet (from any of the habitable types) to a barren one. Do nothing if its not rolling a #1. This would lower the number of habitable worlds around the core by some fraction (e.g. 33%).

You can also run a second script to do the opposite on star-systems that are 0.6-0.8 distance from the core [if I remember right a distance of "1" from the 0-1 % scale, is equivalent to "500", which is the max stellaris distance unit that galaxies can go to), and add extra habitable worlds to them, randomly. (though this is slightly more complex with randomly picking habitable world types, but not much more complex).

#### onlyplaystellaris

##### Recruit
You could write a script that runs on game start and looks at all stars within 0 - 0.25 (to use your variable) distance from the core, for each star system, if it has a habitable planet, that is not a capital/owned, roll a value (random list 1 / 2 / 3 ) and if it lands on, say, 1, convert that planet (from any of the habitable types) to a barren one. Do nothing if its not rolling a #1. This would lower the number of habitable worlds around the core by some fraction (e.g. 33%).

You can also run a second script to do the opposite on star-systems that are 0.6-0.8 distance from the core [if I remember right a distance of "1" from the 0-1 % scale, is equivalent to "500", which is the max stellaris distance unit that galaxies can go to), and add extra habitable worlds to them, randomly. (though this is slightly more complex with randomly picking habitable world types, but not much more complex).
Thank you, but how to define the distance between solar system and the galactic core?

#### Pancakelord

##### General
Thank you, but how to define the distance between solar system and the galactic core?
I havent tested the below in game to make sure i've not made a mistake, but i'd do something like this.
See "every_system" and "distance to core"

• 1