We have in default/python/universe_generation/universe_tables.py the tables BASE_STAR_TYPE_DIST and UNIVERSE_AGE_MOD_TO_STAR_TYPE_DIST:
Code: Select all
BASE_STAR_TYPE_DIST = {
fo.starType.blue: 15,
fo.starType.white: 20,
fo.starType.yellow: 25,
fo.starType.orange: 20,
fo.starType.red: 15,
fo.starType.neutron: 0,
fo.starType.blackHole: -5,
fo.starType.noStar: 10,
}
UNIVERSE_AGE_MOD_TO_STAR_TYPE_DIST = {
# blue white yellow orange red neutron blackHole noStar
fo.galaxySetupOption.low: ( 10, 20, 0, 0, 0, 0, 0, 60), // Young galaxy
fo.galaxySetupOption.medium:( -5, 0, 10, 20, 0, 10, 10, 40), // Mature
fo.galaxySetupOption.high: (-20, -10, 0, 10, 20, 20, 20, 20), // Ancient
}
Code: Select all
max_roll = 0
for candidate in star_types:
roll = random.randint(1, 100) \
+ universe_tables.UNIVERSE_AGE_MOD_TO_STAR_TYPE_DIST[galaxy_age][candidate] \
+ universe_tables.BASE_STAR_TYPE_DIST[candidate]
if max_roll < roll:
max_roll = roll
star_type = candidate
Looking at the values in the mentioned tables you don't know the probabilities.
I've run (in a spreadsheet) those calculations for 1000 systems and I get for young galaxies 601 empty stars, 172 white starts... 1 neutron and 1 black. But when I did the same for 100 sytems I got 2 neutrons and 1 black, so 1000 systems isn't enough to get the real probabilities.
I know that using geometric probability I could calculate what I need directly from the star type bonus tables, but I don't know how to do it.
Any statistician in the room with knowledge on how to solve this?