close
Science

Infinite worlds: procedural generation in No Man’s Sky

Early August saw the release of the much anticipated No Man’s Sky, a space exploration survival simulator from Hello Games, billed on being almost entirely ‘procedurally generated’. There are around 18 quintillion planets for players to visit, or 18,446,744,073,709,551,616 to be exact – all with their own unique landscape, climate, flora, fauna, perils and spoils, and all of it essentially created by an algorithm (or two). The term ‘procedurally generated’ was bandied about a lot during the game’s development, often as the game’s main draw. Not as often, however, was the term explained. So what exactly is procedural generation? Starting at a definition, procedural generation is the creation of content using an algorithm, with an algorithm essentially being a set of rules and parameters used to take an input and turn it into an output. Long-division is an algorithm. Baking a cake is an algorithm. Googling something sets in motion a web search algorithm. The types of content that can be made using procedural generation vary widely: numeric, visual, audio,  text-based, among others. In videogames, procedural generation is typically used for generating game environments (terrain, textures, map layout), encounters (how AI will act and/or react to your actions) and loot. Loot generation in particular is one of the more common examples of procedural generation in videogames. Say every time you open a box in a game, you get a cache of items. Naturally there needs to be a list of items you can receive; procedural generation doesn’t create from nothing, it needs inputs. So when you open the box, you might receive a completely random list of items, defined by an algorithm that picks items randomly, or you might receive items based on some parameters: your skill level, your class, the items you already own, or how ‘rare’ different items are. Both of these scenarios are ‘procedural generation’, and just two of the many types of procedural generation used in No Man’s Sky. Lead developer on No Man’s Sky and co-founder of Hello Games, Sean Murray, was hesitant to call his work on the game ‘programming’, as he and his team weren’t ‘creating’ the game

in the traditional sense, but rather the rules and recipes that would create the game’s world. First thing’s first, the galactic map. An input number (or ‘seed’, apparently the phone number of one of the developers at Hello Games) is used to kick off a pseudorandom number generator, which plots the position and stellar classifications of the stars in No Man’s Sky. The coordinates of each star becomes the next input, and an algorithm (or two) takes it from there. Star coordinates determine orbiting planet number and location, planet location determines planet terrain and climate, and climate determines the type of flora and fauna. That first input – the phone number of a (probably) overworked London game developer – creates an entire universe, and creates it the same way for each player. This is why that first generator is ‘pseudo-random’. In order to avoid melting the average gaming console, No Man’s Sky essentially generates a portion of game universe in real time based on player location (as opposed to constantly generating and keeping track of all 18 quintillion planets). Because of this, it needs to generate each planet the same way each time, otherwise there would be pure, actual chaos as planets and entire star systems completely changed with each revisit. This highlights an interesting caveat in the use of procedural generation; it is never truly ‘random’, and often governed by many many rules to make sure the output of the algorithm is at the very least coherent. Make no mistake, a vast amount of programming went into making No Man’s Sky an actual game as opposed to a dynamic and needlessly vast screensaver; things such as the user interface, the story, the physics, and the mechanics all needed a designing hand. Procedural generation simply handled the rest. And even then, the algorithms themselves needed a heavy amount of design. There need to be rules in place to stop No Man’s Sky’s algorithm from generating ten thousand planets around one star, or planets populated by 1000ft tall trees, or fish without mouths. Some of these rules can be fairly straight-forward, for example, imposing hard limits on certain parameters. Other rules relating to the generation of in-game flora and fauna are slightly more complex. To avoid generating creatures that look like they’ve come straight from God’s fever dreams, ‘silhouettes’ as they were dubbed by Sean Murray, were created by Hello Games for different types of fauna. There is a ‘fish silhouette’ for example, with a basic fish skeleton and fish bits that the algorithms and mutate into something unique – assigning limbs, shapes and textures at random. Animation and behaviour is then assigned on top, for example large, horned or generally more mutated creatures are inherently more aggressive*. Similarly, the trees and plants on each planet are generated using L-systems, fractal equations that mimic organic structures. It is important therefore to distinguish the use of procedural generation in videogames as guided randomness. Where game design is architecture, procedural generation is gardening.

It’s worth mentioning that No Man’s Sky received mixed reviews. The game currently sits a 71/100 critic rating on Metacritic. IGN called it ‘amazingly big, but too often poorly designed’. Videogamer UK somewhat scathingly described it as ‘an ocean of stars, a thimble of possibilities’. We just detailed how immense and complex the procedural generation in No Man’s Sky is. If No Man’s Sky was criticized for being ocean wide and pond deep, what was the point of all that work? This brings us to why procedural generation is used. Procedural generation excels at creating a large amount of content, and making the content entirely unique, but not necessarily interesting. For a game about space exploration, a big world waiting to be discovered is a huge selling point. This was the selling point of No Man’s Sky. Since the game’s release it has become clear that this was also the only selling point. Therefore the final question about procedural generation is whether or not it can truly replace good game design. In an interview with IGN, Sean Murray snorts that when he looks at a planet in No Man’s Sky, he doesn’t see the mountains, he sees ‘the maths’. Many of the game’s critics however have called that ‘maths’ dull and repetitive (as maths often is). Regardless, No Man’s Sky is a technical achievement that manages to procedurally generate an entire universe. Hopefully in the next iteration of the space exploration mega-game, someone will figure out how to also procedurally generate fun. * My partner recounted the story of a particularly aggressive goat-like species he encountered in game, which he subsequently named Goatouttahere. The wonders of space exploration, everyone.

Lot's Wife Editors

The author Lot's Wife Editors

Leave a Response