Skip to content

Instantly share code, notes, and snippets.

@EmmaEwert
Created February 19, 2020 18:15
Show Gist options
  • Save EmmaEwert/f5513ccb8c618bb22b55927067f638f9 to your computer and use it in GitHub Desktop.
Save EmmaEwert/f5513ccb8c618bb22b55927067f638f9 to your computer and use it in GitHub Desktop.

StarCat Signal

StarCat Signal seeks to emulate a universe as we expect it to be 7.4 billion years from now, enabling you and me to discover its secrets.

This document describes the technical approaches in StarCat Signal

Apple Pie

A procedure for generating the vast variability in the structure of space -- which gives rise to an entire universe -- is elusive.

Application of such a procedure in a technically feasible way is doubly elusive. Computers, while unbelievably efficient, are not able to simulate even the number of galaxies (~1 trillion) in our universe, much less the hundreds of billions of individual stars and planets in each of those galaxies.

Nevertheless, if we restrict the universe we keep in memory at any given time to just the visible part; a few thousand stars, the odd nebulae, rare supernovae, and extremely near celestial bodies (planets and moons, mainly), we have a much more feasible goal. So feasible, in fact, that we have plenty of memory and processing power (CPU and GPU) to spare. We just have to write our procedure in a way that enables it to generate only the visible parts of the universe, from a given vantage point. Procedural generation.

Requirements

There are myriads of ways to visally represent planets, stars, systems, galaxies, and beyond.

Most space-faring games simulate one star system at a time, with all its stars, planets, moons, and other celestials.

Some use a very limited set of stars -- EVE Online (2003) has less than 10'000 stars in its galaxy -- and generate a pretty but ultimately static backdrop for each system, and then "warp" you directly from one system to another when you go somewhere else in space.

The galaxy in Elite Dangerous (2014) is based faithfully on the Milky Way; it features billions of stars, but the path from one star system to another happens through warping as well, taking you directly to your destination system with a beautiful warp cutscene which doubles as a loading screen.

Noctis (2003) manages to deterministically generate an effectively boundless galaxy on the fly, and lets you travel continuously from one system to another, but space is everywhere homogenous, and only stars within hundreds of light years are visible at a time.

StarCat Signal requires continuity of travel and heterogeny of space, ideally based on fairly accurate models of the universe.

Continuity of travel

To facilitate continuity of travel in a potentially boundless universe, I generate space to lower levels of detail and greater levels of scale, in 3D space; specifically, a sparse octree populated around the player.

Heterogeny of space

Space is vast and varied, but the formation of everything follows patterns; paragalactic superstructures, galaxies, globular clusters, star systems.

Building hierarchical generators for these structures would make it possible to ensure variance in space at every level of detail.

Generators

Each generator is responsible for generating every element in the next layer, consisting of a position and an age

Concept Age range Diameter range Contents
Universe 21.2 Gyr 32 Gpc Galaxy filaments, large quasar groups
Large quasar group 2 Gpc
Galaxy Filament Supercluster complexes, filaments, galaxy walls and sheets
Filament 128 Mpc
Galaxy wall 4 Gpc Galaxy Clusters
Galaxy sheet Galaxy Clusters
Supercluster complex Superclusters
Supercluster Galaxy Clusters
Galaxy Cluster Galaxy groups
Galaxy group Galaxies
Galaxy 0 to group age 64 Kpc H I clouds, H II clouds, Molecular clouds
Molecular cloud 256? pc Globular clusters
Globular cluster 0 to starburst age 128 pc Star systems
Star system ~cluster age ~$\frac{1}{32}$ pc, 8192 AU Stars
Star ~cluster age 8 AU Planets
Planet ~star age $-$ 500 Myr ~0.002 AU, 64 $R_\oplus$ Moons
Moon ~star age $-$ 500 Myr

Functions

Selected functions for generating stellar populations.

Initial Mass Function

An empirical function that describes the distribution of initial masses for a population of stars.

$L_3$ IMF

StarCat uses the $L_3$ IMF:

$$p_{L_3}(m) \propto \frac{\left(\frac{m}{\mu}\right)^2}{\left(1 + \left(\frac{m}{\mu}\right)^{1-\alpha}\right)^{\beta}}$$

Specifically, StarCat makes use of the derived quantile function -- by supplying random numbers $u$ uniformly distributed between 0 and 1, any number of stars can be generated:

$$m(u) = \mu \left(\left(u\left(G\left(m_u\right) - G\left(m_l\right)\right) + G\left(m_l\right)\right)^{\frac{1}{1 - \beta}}-1\right)^{\frac{1}{1 - \alpha}}$$

Where $G(m)$ is the auxiliary function:

$$G(m) = \left(1+\left(\frac{m}{\mu}\right)^{1-\alpha}\right)^{1-\beta}$$

The canonical values for $L_3$ are

Quantity Symbol Star System
High-mass exponent $\alpha$ $2.3$ $2.3$
Low-mass exponent $\beta$ $1.4$ $2.0$
Scale parameter $\mu$ $0.20 M_\odot$ $0.20 M_\odot$
Lower mass limit $m_l$ $0.01 M_\odot$ $0.01 M_\odot$
Upper mass limit $m_u$ $150.00 M_\odot$ $150.00 M_\odot$

$B_4$ IMF

A more accurate Initial Mass Function, especially for lower-mass stars, would be the $B_4$ IMF:

$$p_{B_4}(m) = \frac{\left(\frac{m}{\mu}\right)^\beta}{\left(1 + \left(\frac{m}{\mu}\right)^{\frac{1}{\sigma}}\right)^{\sigma\left(\alpha+\beta\right)}}$$

The canonical values for $B_4$ are

Quantity Symbol Star System
High-mass exponent $\alpha$ $2.30$ $2.30$
Low-mass exponent $\beta$ $-0.15$ $0.40$
Location parameter $\mu$ $0.15 M_\odot$ $0.20 M_\odot$
Scale parameter $\sigma$ $0.85$ $0.80$
Lower mass limit $m_l$ $0.01 M_\odot$ $0.01 M_\odot$
Upper mass limit $m_u$ $150.00 M_\odot$ $150.00 M_\odot$

References

On the function describing the stellar initial mass function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment