# Improving a Galaxy generation algorithm

## Improving a Galaxy generation algorithm

Hello everyone!
First of all I'm glad of having found the new home of this forum! Does anyone remember the "Accrete" algorithm? I'm sure that the name should be familiar here. I'm developing a 4x Space Opera game a-la Master of Orion that I hope that someday will see the light.

Anyway, I'm basing the galaxy generation algorithm on Accrete and its various incarnations, like "Stargen". The problem, as you may know, is that the Accrete algorithm was developed during the sixties and while it creates very accurate star systems it does not account for the recent findings, such as Hot Jupiters. It also does not work very well when generating moons and satellites. My systems then proceeds to calculate almost every kind of detail imaginable about the planet in order to derive from those values more "game-ish" values.

What I would like to ask the collective wisdom of the forum is for some suggestions to the aspects that are missing from the original implementation. Right now for each "jovian" gas giant (at least 0.7 Jupiter Masses) there's a 25% chance that the gas giant may "migrate inward" and become an epistellar jovian (with an orbital radius of circa 0.05 AUs) and a 10% chance that it may become an "eccentric" jovian, where its orbit will be placed inside the snowline. There's also a 25% that "superearths" formed outside the snowline that didn't become gas giants may migrate inward and become panthalassic planets ("wet" greenhouses).

For the moons I have a complicated "matrix" of values, that detail for each gas giant (and planet) size the maximum number of moons that they could have, the maximum mass of the satellite, and how likely it is for that particular gas giant to have a satellite. For example, if it can have a maximum of 4 satellites at 60% probability, then it will have 4 "chances" to have a satellite. There are three "categories" of maximum masses at different probabilities. This is to allow a rara occurrence of a more massive planet orbiting a gas giant. The last category is to allow the formation of "twin planets". Insteaad of expressing a maximum mass for this last category I'm just expressing it as a fraction of the mass of the primary body. For smaller planet sizes this fraction is 1.0 for the above reason. For exceptionally massive superjovians this fraction is set in such a way as to allow for a potential smaller jovian to orbit around the bigger gas giant. This last possibility is something that we have not yet detected as far as I know but would not surprise me if it were reported.

So what do you think about the above solution? I'm willing to discuss it in more detail but first I'd like to gauge how much all of this is of any interest to all of you.

For completeness I'm attaching you a sample report of a planetary system generated by the algorithm. First the data for each celestial body is written then the values are "translated" into the values the game will finally use. Also this last process is something that I'd be very interested to discuss with you. I assure you that it was not easy to classify each and every kind of planet into discrete categories, without having actually been there

Anyway here it is:
Code:
`MaiaYellow SubGiantG6 IV: Age:9,37 GYA: 0,00 AU - B: 0,00 AU - E: 0,000M: 0,94 D:834,75 Kg/Km3 T:0,000 YrsL: 1,29 MBol: 4,48Teff: 5701 °KR: 1,16Maia IA:0,34 AU E:0,02 To:0,21 Yrs Td: 28,85 HoursM:0,029 EM G:0,28 EG D: 4,79 g/cc AT:22,00°R:2060,46 Km EV:3,37 Km/sec Al:0,06 OZ:SnowlineP:0,00 mB EA MWR:1543,80T:500,95 °K ExoT:14081,33 °K WBP: 0,00mT:402,33 °K MT:594,89 °K NT:437,80 °K DT:561,38 °KH:0,00% K:0,00% I:0,00%Climate: AreanSize: Small Density: RockyCoreGravity: Low AtmDensity: NoneTemperature: ExtremeComposition: Vacuum---------Maia IIA:0,41 AU E:0,00 To:0,27 Yrs Td: 27,35 HoursM:0,041 EM G:0,31 EG D: 4,77 g/cc AT:15,00°R:2302,82 Km EV:3,76 Km/sec Al:0,07 OZ:SnowlineP:0,00 mB EA MWR:863,25T:455,92 °K ExoT:9793,73 °K WBP: 0,00mT:366,85 °K MT:541,76 °K NT:401,08 °K DT:508,97 °KH:0,00% K:0,00% I:0,00%Climate: AreanSize: Small Density: RockyCoreGravity: Low AtmDensity: NoneTemperature: ExtremeComposition: Vacuum---------Maia IIIA:0,50 AU E:0,00 To:0,37 Yrs Td: 18,22 HoursM:0,311 EM G:0,71 EG D: 5,85 g/cc AT:16,00°R:4234,50 Km EV:7,66 Km/sec Al:0,09 OZ:SnowlineP:0,00 mB EA MWR:138,95T:410,35 °K ExoT:6531,13 °K WBP: 0,00mT:342,75 °K MT:476,29 °K NT:376,09 °K DT:444,01 °KH:0,00% K:0,00% I:0,00%Climate: AreanSize: Medium Density: RockyCoreGravity: Low AtmDensity: NoneTemperature: ExtremeComposition: Vacuum---------Maia IVA:0,90 AU E:0,06 To:0,88 Yrs Td: 16,83 HoursM:0,576 EM G:0,83 EG D: 5,46 g/cc AT:22,00°R:5319,36 Km EV:9,29 Km/sec Al:0,07 OZ:SnowlineP:427,01 mB EA MWR:29,29T:323,16 °K ExoT:2027,01 °K WBP: 350,94mT:287,50 °K MT:357,00 °K NT:314,81 °K DT:331,03 °KH:0,00% K:0,00% I:0,00%Climate: DesertSize: Large Density: RockyCoreGravity: Average AtmDensity: ThinTemperature: VeryHotComposition: Oxygen---------Maia VA:1,43 AU E:0,13 To:1,76 Yrs Td: 14,61 HoursM:1,368 EM G:1,10 EG D: 5,41 g/cc AT:17,00°R:7115,45 Km EV:12,38 Km/sec Al:0,19 OZ:SnowlineP:2231,86 mB EA MWR:6,54T:278,12 °K ExoT:803,27 °K WBP: 396,51mT:256,83 °K MT:298,26 °K NT:275,23 °K DT:280,83 °KH:0,51% K:0,25% I:0,13%Climate: TerranSize: Large Density: RockyCoreGravity: Average AtmDensity: DenseTemperature: TemperateComposition: Oxygen---------Maia VIA:2,11 AU E:0,03 To:3,16 Yrs Td: 11,75 HoursM:24,245 EM G:0,76 EG D: 1,53 g/cc AT:18,00°R:28267,77 Km EV:26,15 Km/sec Al:0,47 OZ:SnowlineP:Non un numero reale mB EA MWR:0,00T:174,73 °K ExoT:368,08 °K WBP: Non un numero realemT:0,00 °K MT:0,00 °K NT:0,00 °K DT:0,00 °KH:Non un numero reale% K:0,00% I:0,00%Climate: HydroJovianSize: Neptunian Density: GasGiantGravity: Average AtmDensity: SuperdenseTemperature: IcyComposition: Hydrogen---------(1) Maia VIa: Tiny Cerean world - M: 0,008 - None(2) Maia VIb: Tiny Cerean world - M: 0,006 - None(3) Maia VIc: Small Arean world - M: 0,018 - None---------Maia VIIA:4,29 AU E:0,05 To:9,20 Yrs Td: 8,28 HoursM:172,895 EM G:0,23 EG D: 1,64 g/cc AT:35,00°R:53195,82 Km EV:50,90 Km/sec Al:0,45 OZ:SnowlineP:Non un numero reale mB EA MWR:0,00T:123,32 °K ExoT:88,71 °K WBP: Non un numero realemT:0,00 °K MT:0,00 °K NT:0,00 °K DT:0,00 °KH:Non un numero reale% K:0,00% I:0,00%Climate: JovianSize: SubJovian Density: GasGiantGravity: VeryLow AtmDensity: SuperdenseTemperature: FrozenComposition: Hydrogen---------(1) Maia VIIa: Tiny Cerean world - M: 0,007 - None(2) Maia VIIb: Small Hadean world - M: 0,013 - None(3) Maia VIIc: Small Hadean world - M: 0,008 - None(4) Maia VIId: Tiny Cerean world - M: 0,006 - None---------Maia VIIIA:8,08 AU E:0,02 To:23,72 Yrs Td: 10,50 HoursM:71,382 EM G:0,27 EG D: 1,25 g/cc AT:47,00°R:43318,88 Km EV:36,25 Km/sec Al:0,48 OZ:OuterP:Non un numero reale mB EA MWR:0,00T:88,79 °K ExoT:25,09 °K WBP: Non un numero realemT:0,00 °K MT:0,00 °K NT:0,00 °K DT:0,00 °KH:Non un numero reale% K:0,00% I:0,00%Climate: JovianSize: SubJovian Density: GasGiantGravity: Low AtmDensity: SuperdenseTemperature: FrozenComposition: Hydrogen---------(1) Maia VIIIa: Small Hadean world - M: 0,010 - None(2) Maia VIIIb: Medium Hadean world - M: 0,048 - None(3) Maia VIIIc: Medium Hadean world - M: 0,029 - None(4) Maia VIIId: Small Hadean world - M: 0,015 - None---------Maia IXA:13,96 AU E:0,05 To:53,91 Yrs Td: 7,82 HoursM:364,560 EM G:0,10 EG D: 1,34 g/cc AT:39,00°R:72953,83 Km EV:63,12 Km/sec Al:0,49 OZ:OuterP:Non un numero reale mB EA MWR:0,00T:67,21 °K ExoT:8,39 °K WBP: Non un numero realemT:0,00 °K MT:0,00 °K NT:0,00 °K DT:0,00 °KH:Non un numero reale% K:0,00% I:0,00%Climate: JovianSize: Jovian Density: GasGiantGravity: VeryLow AtmDensity: SuperdenseTemperature: FrozenComposition: Hydrogen---------(1) Maia IXa: Small Hadean world - M: 0,008 - None(2) Maia IXb: Small Hadean world - M: 0,013 - None(3) Maia IXc: Large Arean world - M: 0,597 - Thin(4) Maia IXd: Small Hadean world - M: 0,008 - None---------Maia XA:29,04 AU E:0,02 To:161,73 Yrs Td: 18,16 HoursM:8,581 EM G:0,41 EG D: 0,70 g/cc AT:42,00°R:25980,22 Km EV:16,23 Km/sec Al:0,54 OZ:ExternalP:Non un numero reale mB EA MWR:0,00T:45,34 °K ExoT:1,94 °K WBP: Non un numero realemT:0,00 °K MT:0,00 °K NT:0,00 °K DT:0,00 °KH:Non un numero reale% K:0,00% I:0,00%Climate: CryoJovianSize: Neptunian Density: GasGiantGravity: Low AtmDensity: SuperdenseTemperature: FrozenComposition: Hydrogen---------(1) Maia Xa: Small Volcanic world - M: 0,009 - None(2) Maia Xb: Small Hadean world - M: 0,012 - None---------Maia XIA:44,65 AU E:0,32 To:308,43 Yrs Td: 30,01 HoursM:0,171 EM G:0,26 EG D: 1,77 g/cc AT:54,00°R:5168,56 Km EV:5,13 Km/sec Al:0,07 OZ:ExternalP:0,05 mB EA MWR:0,02T:44,17 °K ExoT:0,82 °K WBP: 214,81mT:21,77 °K MT:66,82 °K NT:38,51 °K DT:49,93 °KH:0,00% K:0,00% I:0,00%Climate: HadeanSize: Large Density: IcyCoreGravity: Low AtmDensity: NoneTemperature: FrozenComposition: Vacuum---------Maia XIIA:43,95 AU E:0,03 To:301,23 Yrs Td: 28,03 HoursM:0,236 EM G:0,30 EG D: 1,84 g/cc AT:40,00°R:5669,07 Km EV:5,76 Km/sec Al:0,07 OZ:ExternalP:0,12 mB EA MWR:0,02T:44,70 °K ExoT:0,85 °K WBP: 223,68mT:24,08 °K MT:65,13 °K NT:39,31 °K DT:50,19 °KH:0,00% K:0,00% I:0,00%Climate: HadeanSize: Large Density: IcyCoreGravity: Low AtmDensity: NoneTemperature: FrozenComposition: Vacuum---------(1) Maia XIIa: Small Hadean world - M: 0,006 - None---------Maia XIIIA:48,01 AU E:0,04 To:343,84 Yrs Td: 47,52 HoursM:0,019 EM G:0,10 EG D: 1,32 g/cc AT:70,00°R:2755,80 Km EV:2,37 Km/sec Al:0,08 OZ:ExternalP:0,00 mB EA MWR:0,08T:42,19 °K ExoT:0,71 °K WBP: 181,43mT:24,59 °K MT:59,87 °K NT:34,27 °K DT:50,29 °KH:0,00% K:0,00% I:0,00%Climate: HadeanSize: Medium Density: IcyCoreGravity: VeryLow AtmDensity: NoneTemperature: FrozenComposition: Vacuum`

A remarkable system for the presence of two habitable planets: an "Arrakis" type world and a Terran world, amidst anonymous rocky and ice planets.

Well let me know what you think! thanks for the attention!

Last edited by AvengerDr on 8th August 2008, 10:07 pm; edited 1 time in total

AvengerDr
Hydrogen Atom

Number of posts : 2
Registration date : 2008-08-08

## Re: Improving a Galaxy generation algorithm

Hmm, very interesting. I've done some work making a sort of similar thing before for Celestia, to generate random star systems. I think yours is probably more effective. Like you wrote, it's necessary to consider the new discoveries we've got out there. Here's some statistics that have been floating around about the frequency of various types of planets.

Hot Jupiter statistic:
Astrobiology Magazene wrote:Since the discovery in 1995 of a planet around the star 51 Pegasi by Mayor and Didier Queloz, more than 270 exoplanets have been found, mostly around solar-like stars. Most of these planets are giants, such as Jupiter or Saturn, and current statistics show that about 1 out of 14 stars harbors this kind of planet.
From here.

General planet statistic:
The Tech Herald wrote:Using the HARPS (High Accuracy Radial Velocity Planet Searcher) spectrograph at La Scilla Observatory in Chile, the team were able to estimate that around one third of stars in the galaxy were orbited by planets.
From here.

What Fraction of Sun-like Stars have Planets?
http://arxiv.org/abs/astro-ph/0306524

A paper wrote:The radial velocities of ~1800 nearby Sun-like stars are currently being monitored by eight high-sensitivity Doppler exoplanet surveys. Approximately 90 of these stars have been found to host exoplanets massive enough to be detectable. Thus at least ~5% of target stars possess planets. If we limit our analysis to target stars that have been monitored the longest (~15 years), ~11% possess planets. If we limit our analysis to stars monitored the longest and whose low surface activity allow the most precise velocity measurements, ~25% possess planets. By identifying trends of the exoplanet mass and period distributions in a sub-sample of exoplanets less-biased by selection effects, and linearly extrapolating these trends into regions of parameter space that have not yet been completely sampled, we find at least ~9% of Sun-like stars have planets in the mass and orbital period ranges Msin(i) > 0.3 M_Jupiter and P < 13 years, and at least ~22% have planets in the larger range Msin(i) > 0.1 M_Jupiter and P < 60 years. Even this larger area of the mass-period plane is less than 20% of the area occupied by our planetary system, suggesting that this estimate is still a lower limit to the true fraction of Sun-like stars with planets, which may be as large as ~100%.

It's really hard to say for sure, for example, what percent of gas planets migrate in, or what percent of them become eccentric, as we're still working on "filling in the gaps" in our knowledge of extrasolar systems. Our census is far too incomplete to be able to generalise planet formation and typical solar system appearance.

AvengerDr wrote:For exceptionally massive superjovians this fraction is set in such a
way as to allow for a potential smaller jovian to orbit around the
bigger gas giant. This last possibility is something that we have not
yet detected as far as I know but would not surprise me if it were
reported.
With systems such as 2M1207 and UScoCTIO 108, I'm sure there's a few.

Perhaps hierarchal tripple star systems are as statistically indinstinguishable from superjovian systems as extrasolar systems are from binary star systems.

As for extrasolar moons, I vaguely remember hearing that gas planets form moons with total masses being ~0.01% of the mass of the planet. I can't remember where that's from though. Neptune would appear to be a counterexample, but Triton was captured.

_________________
Caps Lock: Cruise control for 'Cool'!

Sirius_Alpha

Number of posts : 3816
Location : Earth
Registration date : 2008-04-06

## Re: Improving a Galaxy generation algorithm

Sirius_Alpha wrote:As for extrasolar moons, I vaguely remember hearing that gas planets form moons with total masses being ~0.01% of the mass of the planet. I can't remember where that's from though. Neptune would appear to be a counterexample, but Triton was captured.
The paper in question was this one, which is unfortunately stuck behind the Nature paywall.

The limit is a few times 0.01%, so Triton does not provide a counterexample being 0.02% of the mass of Neptune (similarly Titan is about 0.02% of the mass of Saturn).

Because you need to exchange momentum with something to get captured into orbit around a planet, it may be that captured satellites still follow this rule as they need to exchange momentum with something of similar mass...

Lazarus
dF star

Number of posts : 3074
Registration date : 2008-06-12

## Re: Improving a Galaxy generation algorithm

The original algorithm works by simulating the accretion of dust and gas particles around the protoplanetary disk. I tried to let it run in order to accrete matter around a gas giant but it either produces very small moonlets (which are not useful in game terms) or (after tweaking a bit the parameters involved) produces too often satellite gas giants. So I had to resort to that kind of solution in order to easily generate the satellites. I even tried to run a N-Body simulation with the generated system to see whether some planets would automatically capture some smaller ones. But more often than not, the planets would spiral inward to the sun so it was not feasible.

Thanks for the suggestions too. Is there also some study available on the possibility of epistellar jovians having satellites so close to the sun?

Another thing that I'm unsure of is the algorithm used to generate stars. I have an xml file that describes the distribution of star types. For example in a "realistic" galaxy, 50% of the stars would be red dwarfs, with 20% maybe being yellow dwarfs. Each star type has a minimum and maximum mass, so a random mass is chosen among those limits. Having a mass I can now use it to interpolate on a table that associates mass to bolometric magnitude and effective tempereature. Knowing mass, bolometric magnitude and temperature I can then compute all the other values such as luminosity, density, star radius, lifespan, etc.

A random age is then selected depending on the age of the galaxy. For a galaxy like our own, the age ranges from 0 to 10 billion years on average, although the probability of the stars of having from 4 to 6 are much higher. For younger or older galaxies this random age of course varies.

Anyway the age is useful to determine whether the star is still on the mainsequence or has entered its subgiant or giant phase (or possibily ended it!). The problem is that I was not able to find any meaningful information about how these stellar parameters would vary when in those circumstances. I had to base myself on the system that GURPS Space had. A star's subgiant lifespan is 20% of its total lifespan, while a star's giant lifespan is half of the previous value.

For example, for stars still on the main sequence I interpolate the values of "minimum" and "maximum" luminosity for a star of that given mass (as in GURPS). The final luminosity is then varied to account for the age of the star. The closer it will be to the end of this lifespan the more luminous it will be. For subgiant stars I set the luminosity of the star to a value close to the "maxium" luminosity that it had on the main sequence. I also modify the temperature so that it will become:

temperature - (((age - lifespan) / subGiantLifespan) * (temperature - 4800))

and then recompute all the other values.

For giant stars the GURPS system basically just multiplied the previous luminosity as a subgiant star for a factor of 25 and rerolled the temperature in a range of 3000 to 5000 °K. According to some calculations that I did, if our sun's luminosity would just become 25 LSol, then its radius would not stretch as far as the orbit of Earth. According to a paper that I found, the luminosity would have to increase to ~4500 LSol in order for the radius to stretch that far. What do you think?

Another question that I have is on planet classifications. The following is the list of "planet types" that I intend to include in the game. Some of them are based on the Planetary Classification List:

* Hadean (barren planet, whose atmosphere was completely frozen over - <80 °K surface Temp)
* Cerean (small planetoidal - similar to Ceres)
* Kuiperian (small planetoidal - Pluto)
* Selenian (rocky planet with low density)
* Ferrinian (planet with a very large iron core)
* Glacial (rocky planet completely frozen with possibly some atmosphere, 80°K < surface Temp < 230°K)
* Ammonia (rare terrestrial planet with ammonia based lifeforms)
* Volcanic (europa like planet)
* Arean (mars like planet with possibily a thin atmosphere)
* Tundra (really cold terrestrial planet, Hoth?)
* Terran
* Ocean (planets with <20-30% of land)
* Arid (less "green" version of Earth, with smaller oceans)
* Desert (Arrakis!)
* Hephaestian (planets whose surface is complteley molten)
* Cytherean (Venus-like planets, with superdense atmosphere)
* Pelagic ("wet" greenhouse planets, like Venus, but whose atmosphere and temperature allow for vast oceans)
* Titanian (gas giant moons with a sizeable atmosphere that are somehow geologically active)
* Cataclismic ("special" category for planets that are dying or that are sufferying some sort of catastrophe. For example, how the earth would look from space, in the movie Matrix or Terminator)
* Gas Giants (various GasGiants textures)

If you look at the planetary system that I posted above, you'll see that the first planets are of the "Arean" type. An Arean planet in my system is a planet with none to traces atmosphere. The temperature can vary from very cold to very hot. As you can see the first arean planet has a temperature > 400°K. In order for a planet to be considered "Hephaestian" the average surface temperature (the first "T" value in the log, the other values are respectively exospheric, minimum, maximum, night and day temperatures) must be > 700°K. An Hephaestian planet is one that has its surface completely molten. What do you think about the 700°K value?

Another doubts is for the "Titanian" climate. In order to allow for a bit of variation among gas giant moons (the majority of which will be of either the "Hadean" type or "Glacial" type), I'm computing the tidal forces exerted by the gas giant on the moon in terms of the tidal forces exerted by Jupiter on Io. If this value is > 0.5 of the tidal forces on Io, then the planet is a "Volcanic" planet like Io. If these forces are > 0.1 of Io's TF then the planet is a "Titanian" one (this would mean that it has hydrocarbons seas). Even for that low value, Titanian planets seem to be very few among the majority of cold frozen planets So I was wondering how would you classify those, which parameters would you examine for this purpose.

For completeness, this is the list of parameters that I compute for each planet (more than I'd ever need!):

Code:
`        double albedo;        double axialTilt;        double dayLength;        double cloudCoverage;        double density;        double eccentricity;        double escapeVelocity;        double exosphericTemperature;        double iceCoverage;        double molecularWeightRetained;        double radius;        double nightTemp;        double dayTemp;        double mass;        double minTemp;        double maxTemp;        double surfaceGravity;        double surfacePressure;        double surfaceTemperature;        double waterBoilingPoint;        double hydrographicCoverage;        double orbitalPeriod;        double orbitalRadius;        double dustMass;        double gasMass;`

AvengerDr
Hydrogen Atom

Number of posts : 2
Registration date : 2008-08-08

## Re: Improving a Galaxy generation algorithm

AvengerDr wrote:Is there also some study available on the possibility of epistellar jovians having satellites so close to the sun?
Barnes & O'Brien (2002), "Stability of Satellites Around Close-in Extrasolar Giant Planets"
Domingos, Winter and Yokoyama (2006), "Stable satellites around extrasolar giant planets" (note this one is behind a paywall, fortunately the main results are in the abstract)

AvengerDr wrote:Anyway the age is useful to determine whether the star is still on
the mainsequence or has entered its subgiant or giant phase (or
possibily ended it!). The problem is that I was not able to find any
meaningful information about how these stellar parameters would vary
when in those circumstances.
Some models of stellar evolution are available online: check out for example the Geneva grids (Z represents metallicity, the Sun has Z=0.020)

Lazarus
dF star

Number of posts : 3074
Registration date : 2008-06-12