With procedural content generation (PCG) we can create algorithms that design new weapons, characters, dungeons, and even entire worlds. This seems quite commonplace today, with games such as No Man’s Sky and Elite: Dangerous putting players in the face of the infinite: with millions upon millions of unique planets to visit in an ever-expanding universe. In fact, No Man’s Sky has over 18 quintillion planets in its universe for people to visit. That’s 18, with 18 zeros after it: 18,000,000,000,000,000,000.
That’s a lot of planets.
As you can imagine, no human can possibly visit every single one of those in one lifetime: Even if you only spent 5 minutes on each, that would take over 170 trillion years. So naturally, those planets were not hand-crafted by designers, instead, it’s reliant on a procedural generation algorithm to design all of these planets with their unique geography and environmental properties in a way that players can still survive and build towards completing their goals.
The ideas and technology that solve content creation for these exploration games are really the same as what drives roguelikes:
- The need to generate near-infinite amounts of content for players to experience
- Not having to rely on a human to design them individually
- And make sure you don’t need to store them on the device.
Much of this stems back to Elite from 1984: a space trading game by David Braben and Ian Bell. Elite had 4096 planets for players to visit. Each of these planets had trading stations, missions to complete, space pirates, and much more. But the thing is it was originally released on the BBC Micro and Acorn Electron, which only carried 32KB of RAM and was loaded from a floppy disk that could barely store 1MB. How on earth do you get all that packed into the game?
The trick was that the game was procedurally generated at runtime: it uses a pseudo-random number generator to decide every facet of a planet and galaxy. Where each of these objects is it in space, what their name is, and even more, detailed text information is determined by randomly selecting numbers that correspond with a lookup table of pre-built information. Random number generators can never truly make completely random numbers, they always rely on the seed. So if you know the seed, you could get the game to ‘randomly’ generate the exact same planet again. It saves a huge amount of storage space, given you can generate all the information about the planet on the fly, provided you know the seed that was used to create it.
While Elite was the first to try this approach, it’s since been popularised by many modern games seeking to address the same content creation issues. Minecraft by Mojang Studios procedurally generates every world you visit, and the farther you travel in any one direction, the more of the world it will build, because it only creates the immediate area you start in when you boot it up for the first time. But it isn’t just about creating a single universe or world but providing a lot of variation in those worlds too. Even games like Civilisation and Age of Empires use procedural world creation to ensure players continue to find new interesting situations to explore.
Plus procedural generation is increasingly being used as a mechanism to speed up development in other areas of game development. Tools like SpeedTree allow environment artists and designers to create vegetation in real time that satisfies specific needs. This mitigates the need to create dozens of similar but different plants or trees at design time and lets the system generate them during play. At the end of the day, procedural generation can help speed up the development of games in a variety of ways, and allow us to tackle problem spaces far beyond even the biggest of development teams. But it’s all about building the right tools to service our development needs that still create a wide range of interesting and fun outcomes for players to experience.