May 16, 2022
Planet Generator: A Tool for SciFi and Fantasy Authors
Astronomy is one of my hobbies, and I’m particularly intrigued by exoplanets – planets beyond our solar system. Combining this interest with my coding and writing experience, I thought to make this JavaScript Planet Generator program. Not only does it create graphical representations of such fascinating worlds, it also generates random civilizational data that might be helpful for science fiction and fantasy authors.
In other words, whether you’re a scifi/fantasy author looking for worldbuilding prompts, a programmer looking for inspiration and/or tips, or simply someone interested in the universe, there’s definitely something in Planet Generator that will interest you.
Planet Generator: How the Program Works
On the main screen, there are five initial conditions you can play with (you can also simply leave the randomly selected default values on, or even opt for a “Fast Mode”, bypassing this step):
- Planet Type. Allows you to select from “Gas Giant”, “Ice Giant”, or “Terrestrial”. There are many possible outcomes (such as, among others, an eyeball planet or a hot Jupiter), but these are the initial conditions.
- Star Type. The selection affects temperature (and subtly ambient light), which affects the possible habitability of a planet.
- Tidal Locking. Because tidal locking is a result of close proximity to the larger body, in the context of the program, this affects proximity to the star. A tidally locked planet will be closed to the parent star, which has an effect on temperature.
- Albedo. A planet’s albedo, in very simple terms, refers to how much light the planet reflects back. A low albedo means the planet absorbs a lot of light (which makes it darker and hotter), whereas high albedo means the planet reflects a lot of light (which makes it brighter and cooler).
- Moon. Pretty self-explanatory. You can choose whether to include a moon or not — with the reminder that this is not possible with tidally locked bodies.
That’s it! You set these (or, as I said, leave the defaults on), and Planet Generator is ready to go to work.
Planet Generator: Results
The graphical representation of the planet is made using the excellent (albeit, often frustrating; programmers will relate) p5js library. Depending on the initial conditions plus a set of randomized patterns, the program generates textures for the planet (and moon, if present). Though sometimes the results are repetitive – there’s a finite number of appearances an ice giant can assume – there’s plenty of variety.
The textual data are also randomized, partly according to the initial conditions. Name selections for the planet and the moon come from ancient Greece, and the constellation from a relevant database. Temperature and orbit duration are also partly random, but within the range allowed by the initial conditions – for example, a red dwarf type star will return colder temperatures than a binary system.
The fun begins with habitable planets. Planet Generator returns randomized civilizational data, which can function as a prompt for scifi or fantasy narratives. The images above and below should give you an idea of what kinds of things to expect. The last image showcases the extended help page, with plenty of tips on how to use the program, and links to several Wikipedia pages relevant to the topic:
Where to Find
You can try Planet Generator following this link. For a full list of my available programs, see the relevant page on the main site.
Want to take a peek “under the hood” to see how Planet Generator comes up with civilizational data? Take a look at my post on automatic text generation.