Random Dungeons & Dragons Scripts

I love D&D. I've made a bunch of random generators that aren't quite covered with other websites.

Star System Generator

Star System Generator

PLEASE NOTE: The sheer amount of information here makes it impossible to format the system generator for small screens. Please use this on a medium or higher screen for best display results.

I've been involved in star system generation code for quite a while. There was one in particular that offered everything I needed: Aina's Star Generator.

Unfortunately Aina stopped updating the code over twenty years ago and can no longer be reached. He published his code base online back in the day so others could use and improve it.

Here we are in the here and now. I've updated his code to work with php and have made quite a number of modifications. The goal is to make a few tweaks here and there and test out the random generator in a gravity simulator like Universe Sandbox 2 to see just how viable these star systems are.

temperatures: planet temperatures are seriously out of whack. I've left them in until I can figure out the problem.

System Summary

orbit description mass radius ecc inc moons
primaryK0V : Orange Dwarf (M-S)0.8353 sol1.756 sol
0.790 auGlacier2.27851 earth7,894 km0.05 4
1.974 auGas Giant2,648.02004 earth119,700 km0.01 13

Full System Details

Star 1: K0 V Orange Dwarf (M-S)

Mass 0.8353 sol
Diameter 1.756 sol
Temp 5,150°K (Lux: 0.4868 sol)
Age 9,609.411 Myears (MAX: 17,158.233 Myears)
Orbits min: 0.070 AU
inner max: 0.572 AU
life max: 0.837 AU
max: 33.412 AU

Planet 1 - Life Zone - Glacier - Rocky
Orbit dist: 0.790 AU
period: 386.70 earth days
Ecc: 0.05
Inc: 1°
Body rad: 7894 km
mass: 2.279 earth
grav: 1.487 earth
rot: 9,280.747 hours
tilt: 19°
Temperatures avg: -15.000°C
day: -12.622°C
night: -7.500°C
Water Type: Ice Sheets - 64%
Atmosphere type: Dense
pres: 1.859 atm
comp: Methane/Ammonia/Hydrogen
oxyg: 0.018833866255204
Mineral Resources Metal Ore: 49.728
Radioactive Ore: 45.3456
Precious Metals: 16.5456
Raw Crystals: 33.9456
Precious Gems: 15.9456

Moons
Moon 0: core: Rocky
orbit: 1736680 km
incline: 3°
ecc: 0.03
radius: 2299 km
mass: 0.037521978046111 earth
tilt: 28°
Moon 1: core: Rocky
orbit: 315760 km
incline: 10°
ecc: 0.01
radius: 1948.5 km
mass: 0.025699375146262 earth
tilt: 43°
Moon 2: core: Rocky
orbit: 1736680 km
incline: 10°
ecc: 0.1
radius: 3186.5 km
mass: 0.13737676265561 earth
tilt: 35°
Moon 3: core: Rocky
orbit: 947280 km
incline: 9°
ecc: 0.03
radius: 500 km
mass: 0.00038599246266001 earth
tilt: 35°



Planet 2 - Outer Zone - Gas Giant - Icy
Orbit dist: 1.974 AU
period: 52,109.46 earth days
Ecc: 0.01
Inc: 7°
Body rad: 119700 km
mass: 2,648.020 earth
grav: 7.515 earth
rot: 1,250,627.153 hours
tilt: 43°
Temperatures avg: -25.000°C
day: -24.812°C
night: -5.000°C
Water Type: Crystals - 1%
Atmosphere type: Massive
pres: 744.026 atm
comp: Hydrogen
oxyg: 0.0037667732510407
Mineral Resources Metal Ore: 77.2
Radioactive Ore: 47.4
Precious Metals: 20.4
Raw Crystals: 40.2
Precious Gems: 21.8

Moons
Moon 0: core: Icy
orbit: 19152000 km
incline: 18°
ecc: 0.03
radius: 500 km
mass: 0.0001447471734975 earth
tilt: 20°
Moon 1: core: Icy
orbit: 1915200 km
incline: 9°
ecc: 0.04
radius: 16.5 km
mass: 1.7339263913266E-9 earth
tilt: 35°
Moon 2: core: Rocky
orbit: 4788000 km
incline: 1°
ecc: 0.03
radius: 3134 km
mass: 0.15446111051369 earth
tilt: 17°
Moon 3: core: Icy
orbit: 7182000 km
incline: 7°
ecc: 0.03
radius: 2908.5 km
mass: 0.0094969910476545 earth
tilt: 30°
Moon 4: core: Icy
orbit: 2154600 km
incline: 2°
ecc: 0.01
radius: 205.5 km
mass: 2.0098588255973E-5 earth
tilt: 34°
Moon 5: core: Icy
orbit: 11970000 km
incline: 3°
ecc: 0.03
radius: 313 km
mass: 4.7344750059071E-5 earth
tilt: 22°
Moon 6: core: Icy
orbit: 10773000 km
incline: 6°
ecc: 0.04
radius: 797 km
mass: 0.0011724789078744 earth
tilt: 36°
Moon 7: core: Icy
orbit: 7182000 km
incline: 2°
ecc: 0.1
radius: 839 km
mass: 0.00091185272023396 earth
tilt: 30°
Moon 8: core: Icy
orbit: 21546000 km
incline: 0°
ecc: 0.14
radius: 500 km
mass: 0.0001447471734975 earth
tilt: 11°
Moon 9: core: Icy
orbit: 1436400 km
incline: 5°
ecc: 0.03
radius: 774 km
mass: 0.00017897884711383 earth
tilt: 29°
Moon 10: core: Icy
orbit: 13167000 km
incline: 4°
ecc: 0.05
radius: 1444.5 km
mass: 0.0058170321901015 earth
tilt: 17°
Moon 11: core: Rocky
orbit: 2394000 km
incline: 0°
ecc: 0.12
radius: 1247 km
mass: 0.0037423826322524 earth
tilt: 28°
Moon 12: core: Icy
orbit: 7182000 km
incline: 0°
ecc: 0.09
radius: 500 km
mass: 4.8249057832501E-5 earth
tilt: 33°