This is a python script designed to generate random planets, along with an animation of the planet in .gif format. The script currently uses the Python Imaging Library (PIL) and imageio libraries to create the gif, and math/random/numpy to generate the models. The end goal of this project is to create a script capable of generating a planet every day and posting it to a facebook page made specifically to display these planets.
Each planet is a subdivided icosahedron which has been normalised (pushed outwards) to the inside of a sphere. Terrain is generated and coloured randomly depending on planet type, but is done using 3D Perlin noise in order to create a 'natural' looking change between elevations and biomes.
I must give credit to the following sources for their explanation and implementation of perlin noise generation and biome generation, which I drew inspiration from when adding terrain and biome generation to this project:
- Making maps with noise functions by Red Blob Games,
- Polygonal Map Generation for Games also by Red Blob Games, and
- Procedural Planet Generation by Andy Gainey at Experilous.com
I'd also like give credit to Red Blob Games again for their adaptation of the Whittaker diagram, which I used for the biome colourings on the script's earth analog planets.
Furthermore, thanks to Hector Vazquez-Leal et al for this research article on various methods of accurately but simply approximating the normal distribution integral. I used the equation at section 4.4 in the article to map the gaussian distribution generated by perlin noise to a more uniform distribution.
-
Planet Types
- Earth Analog (Terrestrial planets with plant life and liquid water oceans)
- Silicate Planets (Terrestrial planet with a high concentration of iron or iron oxide on its surface)
-
General Features
- Terrain generation (mountains, valleys, islands, etc.)
- Biome assignment (colourings of different sections of each planet by moisture level and elevation)
- Clouds
- Random axis of rotation
-
Animation Generation
- One full rotation around the axis of rotation for the planet
- Stars (randomly generated and coloured stars are placed in the background)
- Lighting (generated using a 3d vector indicating the direction of exposure)
-
Planet Types
- Gas Planets
- Gas Dwarfs (essentially a smaller version of a gas giant)
- Gas Giants (e.g. Saturn, Jupiter)
- Ice Giants (e.g. Neptune, Uranus)
- Chthonian Planets (a gas planet with the gas largely removed due to close proximity to its star)
- Helium Planets (a gas planet with an atmosphere composed primarily of helium)
- Terrestrial Planets
- Ice Planet (A planet composed entirely of ice C02, O2, etc.)
- Carbon Planets (A planet with a crust/mantle primarily composed of carbon-based compounds)
- Desert Planets (Like Tattooine, Arrakis, a planet with a surface with extremely low amounts of liquid water)
- Iron Planets (Terrestrial planets with an iron-compound based crust/mantle)
- Other
- Lava Planet (A planet entirely covered in molten lava)
- Ocean Planet (A planet entirely covered in liquid water)
- Gas Planets
-
General Features
- Orbiting bodies such as moons, binary planets, etc.
- Optimising the generation of biomes and terrain
-
Animation Generation
- Add support for orbiting bodies as mentioned above
- Optimising the rotation of planets and their orbiting bodies
- Optimising gif generation