Home For Fiction – Blog

for thinking people

There are no ads, nor any corporate masters
How to show support


May 16, 2022

Planet Generator: A Tool for SciFi and Fantasy Authors

Programming, Writing

creativity, fantasy, fiction, javascript, programming, science fiction, writing

6 comments

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
Here’s how the results page of Planet Generator looks like

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):

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.

Like all my apps, this too is free and ad-free. Please consider dedicating a few minutes of your time to read about the ways you could support my work and why this is important for both of us. Thanks!

6 Comments

  1. Passed on to an Australian SF author friend.

  2. lol – the Australian SF author friend just signed up for your newsletter. 😀

    Given that we seem to loathe at least some of the same social media platforms/corporations, mind if I ask which client you use for the newsletters? I’ve been looking for one that won’t data mine my contacts.

    1. Chris🚩 Chris

      😀
      I wouldn’t even call it a newsletter. It’s the default WordPress subscriber interface that sends out a notification (containing the first paragraph of the article or so) when I post a new article. I briefly considered other, third party options, but I decided against them for several reasons, one of which was indeed privacy.
      Many thanks!

      1. Aaaaah! Thanks for that. It’s what I do as well. I sometimes wish I could find a reputable client to enlarge my reach, but then I realise that I already put everything thing of value on my blog so what would I write a newsletter about?
        Cheers from Oz. 🙂

  3. I’m curious if you would ever share the code for this the code. I am building a 3d star map that takes in GAIA 2 catalog data and allows you to create a star map. I am adding a planetary generator based on the acrete generation model. I’m curious about what you’ve done.

    1. Chris🚩 Chris

      There are likely far better solutions than mine out there (more mature, more flexible, more adaptable).
      Nonetheless, if you checked the source code using your browser’s developer console, you’d discover this particular app doesn’t rely on server-side routines, it’s pure JavaScript. Which means, being client-side, you can study it as much as you want. Though, as I warned you, it’s probably too muddled and convoluted to be worth the trouble!
      Alternatively, if you’d like to discuss any particular aspects of the program and would like a direction, feel free to email me.


Punning Walrus shrugging

Comments are closed for posts older than 90 days