I see there have been a few threads that deal with galaxies, but not one that specifically just focuses on the logic and syntax of the random galaxy generator scripts.
The question(s) I'm particularly interested in are: how can one influence the clumping of random spawns in any given galaxy. I'll generally refer to either "huge" or my own modded "enormous" galaxy script, but the idea is to arrive at some basic principles about how random galaxy generation works, and is thus moddable.
C:\Steam\steamapps\common\Stellaris\map\galaxy
Contains several files, most notably
The other four files there contain attributes that primarily seem to be concerned with the shape of the galaxies, not with the spawning of empires.
C:\Steam\steamapps\common\Stellaris\map\setup_scenarios
Contains five files, one for each of the vanilla galaxy sizes (tiny, small, medium, large, huge). Here is an example of the code for the vanilla huge
With that all said, I have created my own mod, that includes a new variant on galaxy size "enormous"
C:\Users\Anthropoid\Documents\Paradox Interactive\Stellaris\mod\anthropoid\map\setup_scenarios\enormous.txt
These were the initial values I used
To make a long story short, the exact functionality of the code from "cluster_count =" and "cluster_distance_from_core" remains a bit elusive.
Starting from the bottom of that set:
cluster_distance_from_core and cluster_radius : are fairly self-explanatory and function intuitively. However, the following may or may not work (I changed several assignment statements to this type of syntax, and have not yet pinned down which, if any, work this way and which do not)
Moving up to the other attributes: max = value = and method = are particularly puzzling. Based on repeatedly starting new games with various integers plugged in here, the only thing I've been able to com up with is:
1. "value = x" seems to do nothing. Changing this value to 0, 1, 2, 3, 4 and leaving everything else the same, does not appear to be having any effect (though I honestly have not tested that thoroughly)
2. "method = constant" (the default assignment) would presumably apply a constant value to all cluster initializations. I tried "method = random" and that works too, but it doesn't actually seem to make it more "random" in concert with differing values in "value = x" and "max = y"
3. "max = y" this seems to be what is determining how many clusters of empires are spawned, although apparently in int eraction with other variables, because low values here (3, 4, 5, 6, 7, 8) seem to produce the same number of clusters. A "max = 9" does seem to produce NINE clusters with the 22 empires (based on my narrowed range in my enormous.txt) divided roughly evenly (although some overlapping).
As you can see, this is all quite complicated, and I thought if anyone else has fiddled with it, it might be worth comparing notes.
The question(s) I'm particularly interested in are: how can one influence the clumping of random spawns in any given galaxy. I'll generally refer to either "huge" or my own modded "enormous" galaxy script, but the idea is to arrive at some basic principles about how random galaxy generation works, and is thus moddable.
C:\Steam\steamapps\common\Stellaris\map\galaxy
Contains several files, most notably
Code:
-- BASE VALUES FOR GALAXY GENERATION
core_radius_perc = 0.25 -- Core radius is 30% of the galaxy radius
num_stars_core_perc = 0 -- Number of stars in core
stars_min_dist = 10.0 -- Min distance between stars
countries = {
ideal_sq_dist_between = 75*75, -- Ideal square distance between countries
min_sq_dist_between = 50*50, -- Min square distance between countries
}
fallen_empires = {
num = 5, -- Number of fallen empires
ideal_sq_dist_between = 150*150,-- Ideal square distance between countries
min_sq_dist_between = 100*100, -- Min square distance between countries
max_military_fleet_count = 5, -- Number of military fleets the empire will start with
ships_per_fleet = 3,
--starting_tech
}
The other four files there contain attributes that primarily seem to be concerned with the shape of the galaxies, not with the spawning of empires.
C:\Steam\steamapps\common\Stellaris\map\setup_scenarios
Contains five files, one for each of the vanilla galaxy sizes (tiny, small, medium, large, huge). Here is an example of the code for the vanilla huge
setup_scenario = {
name = "huge"
priority = 4 #priority decides in which order the scenarios are listed
num_stars = 1000
radius = 450 #should be less than 500, preferably less than ~460
num_empires = { min = 1 max = 39 } #limits player customization
num_empire_default = 29
fallen_empire_default = 5
advanced_empire_default = 8
colonizable_planet_odds = 1.0
cluster_count = {
# method = one_every_x_empire
method = constant
value = 6
max = 10
}
cluster_radius = 150
cluster_distance_from_core = 300
num_nebulas = 10
nebula_size = 60
nebula_min_dist = 200
supports_shape = elliptical
supports_shape = spiral_2
supports_shape = spiral_4
supports_shape = ring
}
name = "huge"
priority = 4 #priority decides in which order the scenarios are listed
num_stars = 1000
radius = 450 #should be less than 500, preferably less than ~460
num_empires = { min = 1 max = 39 } #limits player customization
num_empire_default = 29
fallen_empire_default = 5
advanced_empire_default = 8
colonizable_planet_odds = 1.0
cluster_count = {
# method = one_every_x_empire
method = constant
value = 6
max = 10
}
cluster_radius = 150
cluster_distance_from_core = 300
num_nebulas = 10
nebula_size = 60
nebula_min_dist = 200
supports_shape = elliptical
supports_shape = spiral_2
supports_shape = spiral_4
supports_shape = ring
}
With that all said, I have created my own mod, that includes a new variant on galaxy size "enormous"
C:\Users\Anthropoid\Documents\Paradox Interactive\Stellaris\mod\anthropoid\map\setup_scenarios\enormous.txt
These were the initial values I used
Code:
setup_scenario = {
name = "enormous"
priority = 5 #priority decides in which order the scenarios are listed
num_stars = 1500
radius = 490 #should be less than 500, preferably less than ~460
num_empires = { min = 20 max = 22 } #limits player customization
num_empire_default = 21
fallen_empire_default = 7
advanced_empire_default = 0
colonizable_planet_odds = 0.05
cluster_count = {
# method = one_every_x_empire
method = constant
value = 2
max = 3
}
cluster_radius = 225
cluster_distance_from_core = 225
num_nebulas = 9
nebula_size = 50
nebula_min_dist = 200
supports_shape = elliptical
supports_shape = spiral_2
supports_shape = spiral_4
supports_shape = ring
}
To make a long story short, the exact functionality of the code from "cluster_count =" and "cluster_distance_from_core" remains a bit elusive.
Starting from the bottom of that set:
cluster_distance_from_core and cluster_radius : are fairly self-explanatory and function intuitively. However, the following may or may not work (I changed several assignment statements to this type of syntax, and have not yet pinned down which, if any, work this way and which do not)
Code:
cluster_radius = { min = 98 max = 196 } #min 1/5 of radius, max 2/5
cluster_distance_from_core = { min = 147 max = 343 } #min 3/10 of radius, max 7/10
Moving up to the other attributes: max = value = and method = are particularly puzzling. Based on repeatedly starting new games with various integers plugged in here, the only thing I've been able to com up with is:
1. "value = x" seems to do nothing. Changing this value to 0, 1, 2, 3, 4 and leaving everything else the same, does not appear to be having any effect (though I honestly have not tested that thoroughly)
2. "method = constant" (the default assignment) would presumably apply a constant value to all cluster initializations. I tried "method = random" and that works too, but it doesn't actually seem to make it more "random" in concert with differing values in "value = x" and "max = y"
3. "max = y" this seems to be what is determining how many clusters of empires are spawned, although apparently in int eraction with other variables, because low values here (3, 4, 5, 6, 7, 8) seem to produce the same number of clusters. A "max = 9" does seem to produce NINE clusters with the 22 empires (based on my narrowed range in my enormous.txt) divided roughly evenly (although some overlapping).
As you can see, this is all quite complicated, and I thought if anyone else has fiddled with it, it might be worth comparing notes.