Formatting & temperature fixes

This commit is contained in:
BirDt_ 2025-12-09 23:38:59 +08:00
parent fbb7e72390
commit 2a5cfc6443

View file

@ -93,8 +93,10 @@ Variability is important for modelling climate stability, and is calculated as ~
** Planet Generation
We always generate a minimum of 1 planetoid, which can be forced to be habitable. We continue generating planets up until all the system mass is used up - that being when only 0.05 Earth masses are remaining, which is considered as the mass for non-planet system features such as asteroids or comets.
*** Mass
Each time we generate a planet, we generate a mass for it (in Earth masses) and subtract that from the remaining system mass. If the planet should be forced as habitable, the mass is always between 0.107 and 9.44 Earth masses, otherwise it is either between 0.05 and 1000, or 0.05 and 15, where we select the former a third of the time. This prevents too many gas giants from showing up.
*** Radius
To determine the radius of the planet (in Earth radii), for most planets we sample the planet mass to radius curve (which is constructed based on real known planet mass and radius values), adding some normally distributed deviation (mean of 0, deviation of 0.15). For planets with forced habitable generation, we start with a random radius between 0.5 and 2.49. We then incrementally subtract and add from this radius until we can get an estimated surface gravity between 0.4 and 1.7. We calculate the density after the radius, similarly to the star density calculation:
1. We get a projected volume: ~(4.0/3.0) * PI * pow(planet_radius * 6378 * 1000, 3)~
2. We get the real mass in kilograms: ~mass * 5.98 * pow(10, 24)~
@ -102,24 +104,27 @@ To determine the radius of the planet (in Earth radii), for most planets we samp
Surface gravity is calculated from the kilogram mass (~mass * 5.98 * pow(10, 24)~) and meter radius (~planet_radius * 6378 * 1000~). This gives a gravity of ~G * (real_mass / pow(real_rad, 2))~ meters/second^2, and ~m/s^2 * 0.10197162129779~ g's.
*** Orbit
We calculate each planet's orbit. If the planet is forced habitable, we set the orbit distance to a random value within the star's habitable zone range. Otherwise, we calculate the roche limit based on the radius, mass, and density. If the parent body of this planet is a star (the system root) then we randomise the orbit between 0.05 AU + the roche limit and 50 AU + the outer habitable zone radius. If the parent body is a planet, we randomise it between the roche limit and 0.1 AU.
*** Orbit Speed
We calculate the orbit speed as ~sqrt((G * parent_mass)/distance_at_apoapsis_m) / 1000~, using real values, where the distance at apoapsis is ~(orbit_distance * 1.495979)*100000000~. The orbital period follows as ~(2 * PI * orbit_distance)/orbit_speed~, and we turn that into an "Earth days" measurement with ~abs(orbital_period / 0.211 * 365)~.
*** Rotation Period
We also calculate a rotation period - for forced habitable worlds, this value is a normal distribution with a mean of 1 day and a deviation of 0.2. For every other world, this is a normal distribution with a mean of 1 divided by the mass of the planet, and a deviation of 1. The rotation period has a 50% chance of being reversed. For forced habitable worlds, the axial tilt is random between 0 and 35 degrees, otherwise it's random between 0 and 90 degrees. If the rotation period and orbital period are approximately equal, we also keep track of the planet being tidally locked.
*** Moons and Rings
Each planetoid can also have moons, each of which being their own planetoid which is flagged as being unable to generate moons. The chance of generating a moon is based on the parent planetoid mass and is random - a moon is generated 20% of the time if the parent is less than 10 Earth masses, and 50% of the time otherwise. This chance is divided by the number of moons + 1, to progressively generate less and less moons.
Non-moon planetoids can also have rings. The chance of a ring generating is also based on the planetoid mass. We check if ~clampf(randf(), 0.0, 0.8)/mass~ is less than 0.0065, meaning that at a planet of Jupiter's mass we have a 65% chance of generating a ring.
:rings:
Rings, or more accurately ring systems, can have multiple segments. This is a normal random distribution with a mean of 4 and a deviation of 3, with a minimum of 1. There are three types of rings - Icy, Dusty, and Rocky. Dusty has a 50% chance chosen as the ring type, while Icy and Rocky both have a 25% chance.
We assign a mass to the ring, which is a random number between 0.000001 and 0.05 Earth masses. We also determine the rings inner and outer radius - the inner radius is a random number between the Roche limit for the chosen mass and 0.05 AU, while the outer radius is a random number between the inner radius and 0.1 AU.
We calculate the ring's composition by using the starting system abundances. As with everything else, rings can only be composed of natural elements. We select up to 10 elements from the system abundance (sorted by most to least abundant) to make up the composition of the ring. The first element chosen accounts for anywhere between 0 and 100% of the composition, and each subsequent element makes up a random percent between 0 and 100 minus the current sum total of elements in the system.
:end:
*** Planet, Atmosphere, and Volcanism Classes
Planets are generated based on a classification system, with possible planet classes being Terrestrial, Metallic, Water, Gas, and Ice. By default, every planet can be metallic or terrestrial, and not ice, gas, or water. This is modified by mass and a few other factors:
- If a planet is greater than 10 Earth masses and is not a moon, it could be a gas planet.
- If the mass is less than 15, it could be an ice or water planet.
@ -147,6 +152,7 @@ Gas planets always have no volcanism.
Planets that have no moons, or aren't moons, always have no volcanism.
If the planet is not a moon, we calculate the mass, radius, and orbit distance of the closest moon in SI units - if the planet is a moon, we calculate these values for the parent planet instead. We calculate the tidal force exerted as ~G * real_mass * ((2*real_radius)/pow(real_distance, 3))~. From this result: if it's approximately 0, the volcanism is None. If the force is less than 1.2, the volcanism is Low. If it's less than 5, the volcanism is Medium. If the force is less than 20, the volcanism is High. Otherwise, the volcanism is Extreme.
*** Surface Temperature
We now generate the atmospheric pressure (in Atmospheres) based off the class:
- A class of None has 0 pressure.
- A class of Light has any pressure between 0 and 0.6.
@ -175,6 +181,16 @@ We also generate a greenhouse effect component based on the Atmosphere class:
Now we can calculate the surface temperature. For this we need the SI values of the system's sun luminosity and the orbit distance of the planetary system. We also calculate the Stefan Boltzmann constant: ~5.67 * pow(10, -8)~.
This allows us to calculate the surface temperature like so: ~(pow((L/pow(d, 2)) * ((1-albedo)/(4*stefan_boltzmann)) * (1 + ((3.0/4.0)*greenhouse)), 1.0/4.0))/2~ Kelvin.
Based on the volcanism, we also add some additional variation:
- For no volcanism, we add nothing.
- For low volcanism, we add anywhere between 0 and 5 degrees.
- For medium volcanism, we add anywhere from 5 to 15.
- For high volcanism we add anywhere from 15 to 100.
- For extreme volcanism we add anywhere from 100 to 1000.
Finally, gas planets have their surface temperature multiplied by a random number between 100 and 500.
*** Elemental Composition
We also determine the planet's elemental composition - for the surface, we only look at the crust. We first filter to possible elements by looking at natural elements, and filtering based on the planet class.
- For Terrestrial planets, we only filter to elements which are solid given the surface temperature. We also remove heavy elements: any element with an atomic number greater than 34.
- For Metallic planets, we again filter to solids, and we also remove all non-metals, noble gasses, halogens, metalloids, alkali metals, and alkali earth metals.