Sun Gear

From Elite Wiki
Revision as of 04:31, 29 February 2024 by Phkb (talk | contribs) (Updating BB links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Advanced System Data MFD: Sun data
Solar wind flux currently reads as 0 due to occlusion from the nearby planet's magnetosphere


This OXP aims to make the suns in the solar systems more realistic. It also implements dynamic solar flares - and also a solar wind model allowing refueling with fuel scoops in space reasonably close to the sun (without needing to skim the sun)!

Current OXZ - Version 4.4.0 Uploaded 06 July 2020

History of Development

This project was initially inspired by Distant Suns (author Wildblood). The main reason to develop this alternative project was the rebalancing of the sun population and using the potential of more complex color spaces instead simple named colors for a more accurate simulation of solar spectra.

Another similar project is Distant Stars (author Rustem). It was presented later and had no such influence on my work with one exception (discussed later).

Let’s omit the long story of iterations such as “hot yellow suns for agricultural systems, red and orange dwarves for industrial ones” and outline the present state of project.

Sun population and spectra

If you’ll inspect star population in Sun proximity (quite common region of Galaxy in terms of star population) and apply statistical data to Ooniverse, typical distribution of suns on regional map will be approximately:

  • 5...10 hot white stars (spectral class A) – like Sirius
  • 10...15 yellow stars (spectral class G) – like our Sun or Alpha Centauri A or bit cooler like Tau Ceti
  • 25 orange dwarves (spectral class K) – like Epsilon Eridani or 61 Cygni
  • 200 red dwarves (spectral class M) – like Proxima Centauri

And the rest of total 256 systems – 15...25 of brown dwarves (“failed” stars with mass too low to maintain ignition of thermonuclear synthesis in core). This is reality. Most of Galaxy star population belongs to low mass, relatively cold, dim red dwarves with extremely long life span. Well, now take statistical data for distribution of stars with confirmed exoplanets. This is rapidly expanding database and data for March 2015 are outdated, but tendency as whole remains actual. For Oolite 256 system map approximately:

  • A + B – 4 systems
  • F – 36 systems
  • G – 128 systems
  • K – 72 systems
  • M – 16 systems

Observation bias, of course. Searching exoplanets is shifted to suns like our Sun because Sun twins seems most suitable suns for habitable planets. But is seems for the same reasons that distribution of colonized worlds will be shifted to suns like our Sun too.

Distribution of suns in Distant Suns reflects predominance of red dwarves in Galaxy:

  • B – 4 systems
  • A – 12 systems
  • F – 16 systems
  • G – 32 systems
  • K – 64 systems
  • M – 128 systems

Six spectral classes and seven named colors: blue, cyan, white, yellow, orange, red, magenta (red and magenta are both used for M class red dwarves).

Distant Stars uses more complex RGB color space and has potential to simulate wide range of spectral subclasses, but there are only six spectral subclasses in database:

  • A2 – 7 systems
  • A7 – 21 system
  • F2 – 40 systems
  • G2 – 118 systems
  • K2 – 30 systems
  • K8 – 40 systems

Red dwarves are completely excluded from Rustem’s Ooniverse and remaining suns reflects above mentioned distribution of stars with exoplanets.

Sun Gear covers only four spectral classes, not six as in Distant Suns, but every spectral class is subdivided into spectral subclasses with unique color signatures. Spectral class G (yellow stars) for example is subdivided onto subclasses from G0 to G9. Moreover, every subclass is subdivided onto two steps with unique color too. Spectral subclass G2 for example is subdivided onto two steps – G2 and G2.5. This nomenclature is sometimes used in astronomy for more precise classification (star of spectral class G2.5 is a bit cooler than G2 but a bit hotter than G3). In total 28 spectral subclasses and 56 unique spectral signatures from F6 to M3. All suns in Sun Gear belongs to main sequence (luminosity class V), so you can see sun designations as G2V or K7V. Distribution of suns in Sun Gear is shifted to yellow suns of spectral class G – not for reasons based on real astronomy data, but for considerations of visual pleasure. Wildeblood’s Ooniverse with predominance of red suns seems a bit too biased to red. Nice for space battles, but I prefer more frequent yellow and white for illumination of planet textures. Color distribution of sun population for Sun Gear 4.3 for all eight sectors (total 2048 systems):

  • F6V...F9V (white stars) – 214
  • G0V...G9V (yellow stars) – 1102
  • K0V...K9V (orange dwarves) – 433
  • M0V...M3V (red dwarves) – 299

Hot B and A stars with bluish-white tint are completely excluded from my Ooniverse. It seems that life span of F5V star or hotter is too limited for planets with multicellular life and advanced biomes. Red dwarves cooler than M5V is another case: these suns has extremely long life span, but extremely violent solar flares too.

Since Sun Gear 4.0 I'm using RGB color space for sun colors instead HSB. In theory RGB colors based on real astrometric data can be simulated, but there are technical limitations in game, preventing such accurate simulation. Color of sun in Oolite is blended with 50% white, so you have no possibility to get saturated color. Moreover, real color space in Oolite is too restricted to simulate colors of real stars. M0V red dwarf, for example, has RGB color #ffcd90 or 255, 205, 144 in decimal notation, but you have no possibility to get value below 170 in any channel. Overriding this limitation needs some skill in redefining blending rules. So sun colors in Sun Gear enhanced to provide more visual diversity to game world.

Sun properties

Sun mass and chemical composition are initial parameters in theory of star evolution. Having sun mass and chemical composition you’ll predict sun radius and temperature. Having sun radius and temperature you’ll calculate sun luminosity. Having sun luminosity you’ll calculate inner and outer radius of sun habitable zone. And having radius of main planet orbit in centre of habitable zone you’ll calculate main planet orbital period (local year). This is how matters stand in theoretical astrophysics and celestial mechanics.

In astronomy we usually know star magnitude and color. Well, star color and temperature are strongly correlated parameters (black body radiation approximation), so knowing star color you’ll know star temperature. For nearest stars you’ll also have distance measured directly with some error margins. Based on magnitude and distance you’ll calculate star luminosity. Based on star luminosity and temperature you’ll calculate star radius. In case of nearest binary stars with measurable orbital periods like Alpha Centauri you can estimate masses of components. In case of distant star you have only directly measured star magnitude and color, maybe sometimes distance with more wide error margins. You can estimate missing parameters based on known mean properties of stars of the same spectral class. This is how matters stand in real astronomy.

And this is how matters stand in Ooniverse: we have only sun radius in planetinfo.plist, not sun mass nor temperature per se. But we can estimate missing parameters based on known properties of stars of the same radius.

Just for historical reasons I am not using Sun analog as standard candle, but sun of spectral class G0V (temperature 6000 K).

  • If you have sun with radius 0.96 of standard candle – this is our Sun twin: spectral class G2V, temperature 5800 K, luminosity 0.80, mean radius of habitable zone 0.90.
  • If you have sun with radius 0.8 of standard candle – this is orange dwarf: spectral class K0V, temperature 5000 K, luminosity 0.31, mean radius of habitable zone 0.56.
  • If you have sun with radius 0.6 of standard candle – this is red dwarf: spectral class M0V, temperature 4000 K, luminosity 0.07, mean radius of habitable zone 0.27.

And so on.

This is simplified and slightly shifted data – you’ll see in astronomy handbooks temperature of M0V red dwarf color 3750 K, not 4000 K, and temperature of K0V orange dwarf 5240 K, not 5000 K. Sun Gear is not intended for generating publications in Astrophysical Journal. :-)

  • Radius of standard candle is 1,000,000 m in game units. So sun radii covers range from 460,000 m (M3.5V red dwarf) to 1,120,000 m (F6 white star). Sun analog (G2V) has radius 960,000 m in game units (radius of our Sun in real reality is 696,000 km).
  • Sun radii, temperatures and masses distribution is pseudo-randomly smoothed to avoid discrete gaps in data. Every sun has unique radius, temperature and mass.

Sun distances and habitable zones

Sun Gear large suns (5x of vanilla suns) needs really vast solar systems, of course. In vanilla Ooniverse distance between Earth twin (radius approx. 6400 km) is 64,000 * 20 = 1,280,000 m in game units. In Sun Gear distance between Earth and Sun twins is approx. 43,500,000 m – 34 times farther (approx. 680 planet radii).

Distances between system sun and main planet are set to provide standard insolation level (the same insolation that Earth receives from Sun) with pseudo-random distance bias ± 5%, so Sun Gear simulates real proportions of habitable zones. M0V red dwarf has luminosity only 0.09 of our Sun, so in such system distance between sun and main planet will be approx. 0.3 of distance between Sun and Earth twins – approx. 12,900,000 m in game units. Based on mass of red dwarf 0.55 solar mass and main planet orbit radius 0.3 AU in accordance with Third Kepler’s Law we’ll have main planet orbital period approx. 81 days, and Sun Gear really calculates local year for main planet of every visited system.

Large planets – large suns

Search for logically motivated sun population distribution was maybe most informal part of project, and after experimenting I came to simple rule: Sun radius is proportional to main planet radius.

Seems too oversimplified – we have evidence of numerous super-Earths, discovered in systems of red dwarves. Sometimes there are more than one planet similar with Earth in terms of mass and radius in systems of red dwarves, like in TRAPPIST-1. Observation bias again maybe – combination of large and massive planet(s) with low mass red dwarf is optimal for planet detection. But definitely there are no any reasons to prevent formation of large planets in system of red dwarves and vice versa, small planets in systems of yellow and white suns.

This project was started in epoch of Oolite 1.77, when sun_distance_modifier – parameter, measured in planet radius – was the only way to construct custom solar systems. Correlation between planet radius and sun radius is simplest way to generate population of systems with main planets near habitable zone – having large planet, you have large sun too, but more distant. All my systems has sun_distance_modifier in range from 450 to 700. Since Oolite 1.81 we have direct parameter sun_distance and above mentioned reason is obsolete. Sun Gear now using sun_distance parameter. But there are some reasons to maintain this rule “large planet – large sun”.

First, we have nav charts with large and small colored circles. Having large planets associated with large suns we have also cool sky chart with really looking color-coded stars! Just aesthetic reason, of course. But aesthetics is a vital component of good game. Second, function planet radius vs sun radius is a good reason to limit spectral class range to above mentioned values. Look, if your Earth twin (6400 km for simplicity) has sun with radius 960,000 km (15 planet radii in game units), small planet with radius 2800 km will have sun 420,000 km. This is M3V red dwarf in my scale. Again, planet radius 6900 km gives sun radius 1,035,000 km – this is F8V white star. Pure coincidence, honestly, but such fortunately! Third reason will be discussed a bit later.

Just one remark. I have another OXP – Habitable Main Planets (HMP). It redefines vanilla planet radii to more realistic values. Details are in relevant topic. Sun radii in Sun Gear are correlated with planet radii redefined in HMP, not in vanilla ones. It is not the case if you are using Sun Gear as pure ambience, but without HMP part of vanilla planet population vill be outside of habitable zones. So since Sun Gear 4.3 I decided to declare HMP as obligatory condition for Sun Gear.

A little more about habitable zones

Sun Gear calculates equilibrium temperature of main planet, providing this information for my other OXPs. System Makeup OXP, for example, uses this calculated main planet temperature to select planet texture. In the previous Sun Gear iterations I was using simple formula for such calculation, with no account taken of greenhouse effect. To generate various climate conditions I was using rule “large planets in systems of hot suns a bit closer to inner edge of habitable zone, small planets in systems of cold red dwarves – a bit closer to outer edge” in combination with pseudo-random distance offsets. Now Sun Gear taking greenhouse effect into account. Just rough formula, of course, based on estimation of atmosphere mass as function of planet radius. So large main planets in systems of white and yellow stars has more warm climate as compared with small main planets in systems of orange and red dwarves not due to more hot sun per se but due to more dense atmospheres providing more evident greenhouse effect.

Solar flares and solar wind

Rustem’s Distant Stars has nice custom feature – dynamic solar flares. I borrowed this idea for Sun Gear (with my own realization of course).

Corona flare is controlled dynamically by script. Most of time sun of system is in quiet state (corona_flare random value in range 0.1…0.2), but sometimes solar flares occurs and corona_flare rises randomly up to 0.5 (yes, I know, in reality it is NOT linear correlation between solar corona size and solar flares!). As a rule flare frequency increases from yellow to red stars. Peculiar suns with "solar activity" in system description has more frequent flares with higher magnitudes (corona_flare rises up to 1.0 in case of "deadly solar activity").

Solar wind model is implemented. Solar wind allows to refuel ship without sunskimming (in some cases refuelling is possible en route from witchpoint to main planet). More detailed description of this feature will be found in the Hard Way OXP.

Magnetospheres of celestial bodies are simulated. Solar wind density is dropped to zero level near planets and moons.


AstroLibrary is a library, providing astronomic (oostronomic may be?) functions to calculate sun spectrum, main planet temperature (used in System Makeup OXP to set planet texture), main planet orbital period & planet and moon parameters (used in Planetary Systems OXP), solar wind density (used in Hard Way OXP to collect fuel) etc.

Advanced System Data MFD

Advanced System Data MFD provides custom system info on two pages.

Advanced System Data MFD: Planetary system data

Sun Data info page

Sun catalog number (galaxy sector and system ID)
Sun spectral class
Sun radius
Sun mass
Sun luminosity
Solar activity
Main planet period in days
Sun distance
Solar wind flux: important for Hard Way

Planetary System Data info page

This provides list of additional planets in solar system. It displays only planet orbit radii in OU and planet class:

Dwarf terra - planet like Pluto or Ceres
Miniterra - planet like Mercury
Subterra - planet like Mars
Terra - planet like Earth or Venus
Superterra - planet like ... hmm, we have no such example in our Solar System. Gliese 667 Cc maybe?
Ice giant - planet like Uranus or Neptune
Gas giant - planet like Jupiter or Saturn
System Data Sheet (Docked F4 screen)

System Data Sheet

This is accessed while docked through the Informational section on the F4 page (ship and system interfaces). It gives the above information.

"Planet Data" / "Lunar Data" Interface

These data interfaces are only seen on landing and are generated by other oxp's in this suite. They are not MFDs and are accessed through the F4 screen.


Problem: positions of solar stations

The coding used to move the sun further from the main planet can lead to conflicts with some of the other methods for placing stations near the sun - or other such. This is especially problematic for Commies OXP (SLAPUs & CZGFs) as well as Hathor Trade Stations and a few others. See Bizarre locations of Stranger's World Stations for more on this.


Phkb has crafted an AddOn for Sun Gear & Commies which fixes the issue for them: CommiesOrbitUpdate.oxz - just add this in to your regular cocktail mix of oxps, shake and enjoy!


  • Wildblood - Distant Suns OXP/OXZ: initial concept of custom sun population & spectroscope script.
  • Tch - Tch_Russian_Systems OXP: idea of using RGB model for sun color instead simple named colors.
  • Rustem - Distant Stars OXP/OXZ: idea of dynamic coronae.
  • Damocles Edge, phkb and another_commander - detecting OXP incompatibility with DH ANC OXP, formulation issue with HSB colors and invaluable help to solve this issue.