Alien Worlds, Part I: The Visual

No game about space exploration would be complete without planets. The original Starcom Flash game had them, but they were purely ornamental landmarks. There were a half-dozen or so bitmaps with color tint shifts to give the illusion of greater variety.

An example planet from the original Flash game

As decorative features they worked quite well: the game would have felt much less rich without them. And given the limited scale of the game, their limited variation wasn’t obvious.

Starcom:Nexus is planned to be many times the length of Starcom with over a thousand planets. So I need a way to create a greater variety of planets. And with so many planets in the game, the player will probably want them to serve some purpose.

To create much greater visual variety, I combined several different techniques.

First, every planet has a base archetype that defines:

  • What types of environments occur on the planet (e.g., temperate, desert, arctic, etc). This is important for anomalies, which I’ll discuss later, as well as influencing what alien encounters are likely to be found near it;
  • What size range the planet can have;
  • Where this planet is likely to occur (snow covered worlds shouldn’t be next to the sun, planets with water oceans shouldn’t be too close or too far);
  • What Shader the planet uses for rendering.
A terrestrial procedural planet
A terrestrial procedural planet

Each instance of a planet is given a number. The planet uses this number to seed a random number generator which is used to “morph” the planet it multiple ways:

  • Change its size based on a normal distribution;
  • Create a diamond-square pattern that is used to blend four different textures to create the planet’s surface;
  • Shift the offset of those textures;
  • Shift the tint of those textures within a pre-defined gradient range;
  • Calculate an optional-sea level.

The end result is that each of the dozen or so archetypes can take on an effectively infinite number of visually distinct appearances:

GIF of a few dozen randomly generated planets

Up next: Planetary Anomalies