This commit is contained in:
BirDt_ 2025-12-16 00:12:35 +08:00
parent 5bd7a17166
commit 689c5fc720

View file

@ -198,11 +198,12 @@ We also determine the planet's elemental composition - for the surface, we only
- For Ice planets, we filter to solids only.
- For Gas planets, we filter to gasses only.
We then look in the system abundance, and copy all elements that pass the above filters, with their percentage abundance in the system. The only exception is Silicon - if the planet class is Terrestrial, we set the percent of Silicon in the planet to anywhere from 20% to 50%.
Now for the copied elements and percentages, sorted by their percentage, we randomly determined the composition. The first and most abundant element of Terrestrial planets is Silicon. Otherwise, we pick a random element from the 5 most abundant elements and push it to the crust composition with a random range between 0.4 and 0.8 (if this is the first element selected) or 0 and 1.0 - the sum total of all currently selected elements. We do this anywhere between 1 and 10 times, to get the major crust composition.
Now for the copied elements and percentages, sorted by their percentage, we randomly determined the composition. The first and most abundant element of Terrestrial planets is Silicon.
Otherwise, we pick the 10 most abundant elements, sort by ascending weight and take 3 from the result, shuffle, then take the first element, and push it to the crust composition with a random range between 0.4 and 0.8 (if this is the first element selected) or 0 and 1.0 - the sum total of all currently selected elements. We do this until we run out of elements or hit 100% composition.
If the atmosphere class is not None, we also need to determine the planet's atmospheric composition. For this we filter to natural elements, and only those that are gasses given the surface temperature.
Then we look in the system abundance, and copy all elements that pass the above filter. If the element is not a nonmetal and not a noble gas, we divide it's percent by it's atomic number * 10 - this makes it more unlikely for heavy elements to be part of the atmosphere.
Then, we pick a random element from the 5 most abundant elements and push it to the atmosphere composition composition with a random range between 0.5 and 0.9 (if this is the first element selected) or 0 and 1.0 - the sum total of all currently selected elements. We do this anywhere between 1 and 10 times, to get the major atmospheric composition.
Then, we pick a random element from the 5 most abundant elements and push it to the atmosphere composition composition with a random range between 0.5 and 0.9 (if this is the first element selected) or 0 and 1.0 - the sum total of all currently selected elements. We do this until we run out of elements to get the major atmospheric composition.
Terrestrial, Metallic, and Ice planets can have oceans or other, smaller liquid bodies. There is a 22% chance that a planet will attempt to generate liquid bodies. Instead of searching for individual elements, we have specific molecules that can form oceans each with their own feasible temperature range. These are:
- Water - 273.15 to 373.15 Kelvin
@ -218,7 +219,89 @@ With the composition determined, we can estimate the magnetic field strength, in
Colloquially known as having a fun time.
#+end_quote
Based off the various planet metadata calculated, we can create a chunk-based surface for each planet and populate it. If you know anything about spheres, or maps, you may know that it is very difficult to tesselate a spherical surface equally with the shapes one may usually consider for chunks (for gameplay purposes). Our chunks are triangular instead, because equilateral triangles can in fact tesselate a sphere equally.
Based off the various planet metadata calculated, we can create a chunk-based surface for each planet and populate it. If you know anything about spheres, or maps, you may know that it is very difficult to tesselate a spherical surface equally with the shapes one may usually consider for chunks (for gameplay purposes). Even though spheres can't be tesselated equally by squares, we generate square chunks - our planets are actually cubes!
Currently, gas planets have no surface generation.
Each chunk is <YET UNDEFINED> kilometres across, and has a number of procedurally generated attributes.
*** Geo-biomes
Minerology and surface feature generation are both driven by the planetary geology, which abstracted to "geo-biomes". Each chunk on a planet pulls a random geo-biome from the list of possible biomes given the environment. Biomes are weighted based on how probably their generation is given the environment.
When looking at the list of possible geo-biomes, we first consider whether the planet is dead or not. Dead worlds have no volcanism, and no atmosphere. For dead worlds, every geo-biome except for impact and primordial is weighted as 0.2.
**** Impact
The Impact geo-biome is formed by extraterrestrial impacts. This is possible when the atmospheric pressure is less than 20 atmospheres. For dead worlds, this is the most common geo-biome, with a weighting of 0.9. For non-dead worlds, the weighting for impact planets is calculated as ~1 / atmospheric_pressure~.
**** Primordial
This geo-biome represents unaltered crust material and is only present on dead worlds, with a weighting of 0.5.
**** Supergene
The Supergene geo-biome represents fluid chemical weathering. It can only exist on planets with a surface temperature greater than 0.1. It is weighted by the ~atmospheric pressure / 100~.
**** Metamorphic
The Metamorphic geo-biome represents recrystallization of rock in response to heat or pressure. It can generate on any terrestrial, metallic, or ice planet, and is weighted by the ~surface temperature / 700~ with a maximum of 0.8.
**** Sedimentary
The Sedimentary geo-biome represents physical transport and deposition of particles by a fluid. It can exist on any planet, however is weighted by the presence of liquid bodies. If there are currently liquid bodies present, the weighting is ~2*(atmospheric pressure / 100)~, with a maximum of 0.8. If there are no liquid bodies present, it is ~(atmospheric pressure / 200)~.
**** Fumarolic
The Fumarolic geo-biome represents sublimation or condensation from a gas phase to the surface. It can generate on any planet with an atmospheric pressure greater than 0.001. The weighting is based on volcanism level - 0.1 for None, 0.2 for Low, 0.4 for Medium, 0.7 for High, 0.8 for Extreme.
**** Hydrothermal
The Hydrothermal geo-biome represents fluid circulation driven by a heat gradient. There are two types of Hydrothermal biome - high and low temperature. In both cases, liquid bodies are required.
High temperature hydrothermal can only exist in high or extreme volcanism. Low temperature hydrothermal can exist in any volcanism class. The weighting of this geo-biome is 0.6.
**** Pegmatitic
The Pegmatitic geo-biome presents crystallization caused by a volatile-rich melt. It can only generate on terrestrial planets with volcanism between low and high, and with a crust composition that contains volatile elements. The level of volcanism dictates the weighting: low is 0.5, medium is 0.8, high is 1.1 This weighting is multiplied by the percent (1/x) of volatiles in the crust.
Volatile elements are any elements with a boiling point below 1200 Kelvin. The presence of liquid bodies also indicates the presence of volatiles, with a 60% hardcoded value.
**** Magmatic
The Magmatic geo-biome represents partial melting of the crust. It can only generate on terrestrial or metallic planets with medium to extreme volcanism. The level of volcanism dictates the weighting: medium is 0.4, high is 0.7, and extreme is 0.9
*** Minerals
Based on the chemical composition of the crust, we can determine what minerals should be present on any given planet, and then place them based on the geo-biomes available. We do this by generating plausible minerals using simplified valence chemistry.
The number of minerals generated is based on the "activity" of world, as well as it's class.
For terrestrial worlds, start with 10 minerals.
For metallic worlds, start with 14 minerals.
For ice worlds, start with 2 minerals.
For water worlds, start with 5 minerals.
Then if we have a light atmosphere, add 3 minerals to the count. If we have an earth-like atmosphere, add 6 minerals to the count. If we have an extreme atmosphere, add 9 minerals.
For volcanism, if we have low volcanism add 2 minerals. If we have medium volcanism, add 5 minerals. If we have high volcanism, add 10 minerals. If we have extreme volcanism, add 20 minerals.
We then divide the number of minerals into "categories" of minerals to generate.
Currently, we pre-filter the mineral list to only abiotic minerals.
1 third of the total minerals, rounded down, are dedicated to the non-negotiable rock-forming minerals of the planet. These can be any rock-forming minerals from the master list that are made up of elements present in the crust. These minerals are weighted by the abundance of their constituent elements, and we randomly select the amount required using this weighting.
Next we subtract a random number from the total mineral count, anywhere from 0 to 3. If this subtraction leaves 0 remaining minerals, skip this step. Otherwise, this selected amount becomes randomly selected native elements or gemstones that are capable of forming given the possible geo-biomes and composition.
And as for what minerals are capable of forming given each geo-biome, the remaining mineral count is divided by all possible geo-biomes on the planet and we determine a number of minerals that can occur per biome. These are based primarily off [[https://www.mindat.org/paragen.php][paragenetic modes]], and filtered to and weighted by the crust composition elements.
**** Impact
Modes 1-4, 29-30, 51 can generate in the Impact biome.
Additionally, though not included in the generator but as a note, modes 5-6 may be found as deposits in this biome.
**** Primordial
Modes 1-6 can generate in the Primordial biome.
**** Supergene
Modes 22-23, 28, 47-48 can generate in the Supergene biome.
**** Metamorphic
Modes 6, 9, 13, 31-33, 38-41, 43, 51 can generate in the Metamorphic biome.
**** Fumarolic
Modes 11 and 45, 27 can generate in the Fumarolic biome.
**** Hydrothermal
Modes 6, 10, 13-14, 16, 22, 32, 42, 44, 46 can generate in low temperature Hydrothermal biomes.
Modes 12, 15, 32-33, 41 can generate in high temperature Hydrothermal biomes.
**** Pegmatitic
Mode 34 and 27 can generate in Pegmatitic biomes.
**** Magmatic
Modes 7-9, 19-20, 27, 35-38 can generate in Magmatic biomes.
** Limitations
- Elemental abundances are fully random beyond the top 10.