The much-awaited and much-hyped game No Man’s Sky came out recently. Its claim to fame is that instead of putting you in a ‘fixed’, pre-designed game universe, it is a simulated game galaxy where planets are generated on-the-fly using procedural algorithms that guarantee you see something ‘novel’ on each planet. Its 64-bit random seed means that there are about 18 quintillion possible planets, meaning it’s unlikely you’ll ever visit the ‘same’ planet twice.

The amount of hype that the game recieved can probably only be compared to the amount of disappointment it seems to have generated amongst gamers, who say that the game is repetitive and boring.

I think the idea of a procedurally-generated galaxy that you just explore is a great one, it’s just that the execution here is not one that would personally motivate me to play it. In this post I’m going to offer a sketch of a similar kind of game that I think I and (maybe) a lot of other people might find interesting.

I could not find any explanation of the procedural algorithms behind the game with any acceptable level of authority or detail. I’m guessing that Hello Games hasn’t really shared the internals yet. But looking at the game empirically, it’s possible to figure out roughly how it works. There are algorithms for procedurally generating terrain, populating the terrain with plants/animals, and so on. I’m not sure how much detail there is in the generation of the plant and animal shapes themselves. Are the plants just picked from a large library of plants, and just have certain attributes (color, size, etc.) changed? Are they composed of a set of parts (leaves, stalks, etc.) that are permuted randomly? Or are the plants entirely generated using some procedural algorithm? I don’t know. But whatever the case, when you become more familiar with the game, you realize there isn’t that much variation between the plants, nor between the animals. Nor, indeed, between the planets themselves. They are all the same size, have similar-looking terrain, and there is little variation across the surfaces of the planets.

And this is the major problem with the procedural generation that the game uses. Even though there is a lot of ‘shallow variation’ in color, size, shape, and so on, everything looks and feels roughly the same. In fact, you could probably argue that everything looks far similar than the comparatively small (but still large) game worlds featured in other games. Yet, those games do not use procedural generation.

Another way to do Generate a Galaxy

First of all, I’m not a game designer, so I don’t know how much effort went into the procedural generation. My guess is “a lot.” But I wonder if you wouldn’t be able to achieve much better results with a similar, or even less, amount of effort.

How could you do it? Focus more on realistically generating the galaxy itself, and less about the other aspects, like life and so on.

How about using realistic models of star system formation to generate star systems at various points of development? You could visit a star system in its early stages, consisting of nothing more than a protoplanetary disc. Or you could visit a star system in its late stages, where the sun has expanded to a red giant and burned the face off all of the planets. And everything in between.

You could go even further, and generate things like neutron stars, binary/nova stars, white dwarves, and even rogue planets. Each giving rise to unique planetary systems with unique constraints. Who knows what could happen!

As for the planets themselves, you could have gas giants, ice giants, Earth-like planets, and so on, perhaps in their early bombardment stages, or their life-bearing stages, or their Venusian hell-hole stages. With widely varying sizes, orbital periods, magnetospheres, atmospheric compositions, etc. Your planets could be geologically active, in which case they would have volcanoes and mountain ranges, or not, in which case their surfaces would be mostly the result of cratering and wind erosion. You can have planets that are dry as a bone, or planets covered in kilometer-deep oceans – perhaps made of ammonia or methane and not water. You can have periodic asteroid collisions which would range from small to extinction event-level. And none of this has to be behavior that you explicitly program in. All of this could just be from a small set of rules governing planetary system development and orbital mechanics.

Now you just write code that takes those randomly-generated planetary conditions into account, and tries to simulate what the climate would look like on the planets, using realistic models of planetary physics and computational fluid dynamics simulation. For instance, you could have tidally-locked planets that are scorching hot on one side and frozen cold on the other. Or they could have oceans, and thus a milder climate, but now with extreme hurricane winds and ocean currents constantly raging across the planet’s surface. Or you could have a planet orbiting a neutron star, with the star’s intense gravity and magnetic field playing havoc on the planet’s system. Or planets with multiple large moons, with every tide being a tsunami. Or endless more possibilities.

Note that you aren’t programming in a ‘library’ of climate patterns, or even ‘procedurally generating’ climate. You are trying to deduce climate from other, simpler, randomly-generated parameters like orbit, mass, incident radiation, surface composition, and so on. This would almost certainly produce a lot of climate patterns that you simply could not have predicted beforehand – now that’s exciting.

What about life? Life is a bit more complicated and would take a lot of time to program realistically. You could either plunge in and attempt to do it, or make your game interesting enough that pre-programmed life need not exist. Why not just generate the setting, and let the players populate it with their own life?

This could be one of the objectives of the game: Introduce life, and try to either design new lifeforms that match the planet’s conditions, or ‘terraform’ the planets to match the life. You get points if your lifeforms successfully colonize the planet. Alternatively, players could focus on mining planets and setting up industrial centers and civilizations. Clever players would use the randomly-generated geological features that were unforeseen by the developers, and use them to their advantage, again in ways unforeseen by the developers. A true open world where nearly anything is possible.

A large portion of this civilization-building would be just community-driven development, with the only thing you need to code being the constraints and the physics of the worlds.

Is it possible?

Now you might object that doing something like this wouldn’t be feasible, because:

It’s too hard to write the code, and a lot of the factors involved in exoplanet formation and climate are not known. It would be too straining on the computational abilities of game consoles and home computers.

I would argue that (1) is not a valid criticism. First of all, total realism and exacting physics are not necessary; you just need enough computing power to make a convincing game environment. We already know how to do fast, efficient fluid dynamics simulation for games; you just have to do something equivalent for planetary simulation. Note that you don’t have to go into much detail; there are a lot of CFD methods that abstract over the fine-scale details of the simulation and are capable of rapidly simulating large-scale features (such as wind speed/humidity/etc. over large geographical areas, or hurricane wind patterns). There is no shortage of people skilled in both computer graphics and CFD who would be happy to implement such a system for you if they got paid doing it. Also, there is already a lot of research on simulating planetary climates, so you’re not starting from scratch.

(2) might be a more valid criticism, but based on my experiences with physics simulation, I doubt that something like this would be that much of an issue. Indeed, people came up with realistic-looking exoplanet models in the 1980’s, with hardware less powerful than a smartphone or a raspberry pi (a gigaFLOP/s or so). One possibility would be to just network together computers that are playing the game, and have players occupying the same planet work together in simulating the planet.