Guided Generation in Prologue: ML Generated Landscapes Based on Game Designer Input
January 28, 2025
How can game designers guide machine learning (ML) to produce landscapes that, while natural and world-like, also present interesting gameplay mechanics? And specifically, what role can Guided Generation play in achieving this goal? For our upcoming survival game Prologue, PLAYERUNKNOWN Productions have used Guided Generation to combine the ingenuity, passion, and creativity of our game designers with the ability of a Machine Learning model to produce a huge number of startlingly unique permutations of this art.
Guided Generation allows game designers to draw approximate rivers and mountains on a map, and have a machine learning model trained to take that rough drawing to produce near-infinite unique heightmaps with the requested river and mountains, which feel realistic to exist in. This blog will dive into the technique, while offering details of how we use it to produce countless, rich, and diverse game worlds for our community to explore in Prologue.
We’ll be continuing the discussion on the PLAYERUNKNOWN Productions Discord, where there is more information about Prologue and other projects from the studio.
Author: Joey Faulkner, including work by: Saul Chung, Remco Van de Ven and Noel Lopez Gonzaga
Prologue: Go Wayback in-game landscape.
Oatmeal
The '10,000 Bowls of Oatmeal problem' in procedural generation is where there exist many potential random outcomes but they are only different in superficial ways.
Unfortunately, Machine Learning will typically struggle with this problem too. In particular, this is because we train a ML model to imitate a training data set. The model is rewarded when it creates something (a sentence, a picture) which seems like it could be part of the training data and punished when it creates something different. This leads models to generally err on the side of caution: by way of example, if you train an ML model to generate images of a pizza, it will be much more likely to generate a classic margherita than the (regrettably real, but thankfully rare) Heinz Baked Beans Pizza. The chances of the model generating something exciting like a demonic pizza is effectively zero. Therefore, by using ML we are compounding the issue, a model will preferentially lean towards making oatmeal if it thinks it can get away with it.
Prologue
For Prologue, we are creating a game which puts the player in a realistic landscape and forces them to try to survive. Part of this is using real-world landscape data (from public geospatial datasets). What we found to begin with was that on the scales we were interested in, landscapes produced by a standard machine learning model weren't quite fitting for a game.
In the world, if you walk uphill for eight hours to get to a peak, you will probably feel rewarded and satisfied. In a video game, we have a different set of expectations, and an eight-hour trek probably wont feel engaging. Therefore, when using plain real-world data, the results were not quite interesting enough to fit in a gameplay loop.
We followed two key strands to fix this issue. One strand, led by my colleague Remco, was to adjust real world data by superimposing interesting terrain features using procedural techniques (discussed in a future blogpost), this accentuated and augmented the natural flow of the land, and led to a training data set that allowed a machine learning model to output these interesting features while imitating natural landscapes.
The second strand was guided generation: In Prologue, we use guided generation as a way of putting a game designer in the loop, to force our machine learning model to create interesting maps.
Guided Generation
The concept behind guided generation is this: what if we were to create a system whereby we empower a game designer to outline a concept for a map, and then hand it to a machine learning model which can take this concept and generate effectively infinite unique maps which broadly follow the concept. This way we can use human ingenuity and design to force our machine learning model to produce interesting outputs.
Its a generic concept, but in the first case for Prologue we are interested in verticality.
Verticality has long been used in games to convey gameplay mechanics. For an open world game, it can be used effectively as a lever to nudge players into interesting gameplay without restricting their freedom or holding their hand. Breath of the wild famously used verticality to implement the Triangle Rule to encourage players to explore and find interesting content. Elden Ring utilized beautiful vistas to give a sense of awe and openness to the player while also nudging the player to be interested in specific points.
Elden Ring: First check the grace, then the church, and then eventually get obliterated by Margit in the castle.
In the real world, verticality is moderated by gravity and the flow of water. For millions of years, rain has fallen on every part of the earth and moved downwards, with each drop chipping away from the land or bringing sediment to it. This creates what are known as drainage networks, efficient paths from high altitudes to low, where the water drains.
Using these drainage networks, we can identify peaks (places where water only drains away from) and rivers where the drainage networks are largest.
A drainage network.
This is how the world looks, and so this is how we want Prologue to feel like. We want you to feel like you are stranded in the real world.
Therefore, we apply an algorithm to identify peaks and rivers from our training data. We then pair the peak and river identifications with their heightmaps and use it to train a model to go from the rivers and peaks to generate heightmaps. This is inspired by a great paper Interactive Authoring of Terrain using Diffusion Models - Lochner - 2023 - Computer Graphics Forum - Wiley Online Library.
Input to the machine learning model (left), and output rendered in-game (right).
Out of this we get a machine learning model which can power our new guided generation workflow. In brief:
- An artist draws an approximate river and some mountains, the “schematic.”
- The guided generation machine learning model takes a schematic and generates a random heightmap which follows it (has the same mountain and river setup).
- The heightmap (including the river and mountains) is rendered in game.
- The heightmap and river mask is then used by the PCG and other teams to create a vibrant world to play prologue in. (see Creating Dense Forests in Prologue: Balancing Immersion and Performance).
Because this is generative ML, even with the same schematic, we can generate millions of unique heightmaps and be sure that we never see the same map twice.
Clockwise from top left: 1. An artist draws an approximate river and some mountains, the “schematic.” 2. The guided generation machine learning model takes a schematic and generates a random heightmap which follows it. 3. The heightmap (including the river and mountains) is rendered in game. 4. The heightmap and river mask is then used by the PCG and other teams to create a vibrant world to play prologue in.
All of these maps come from the same river schematic, all of them with semi-realistic drainage networks and interesting geographical features within.
Example 1: When we hand this tool to a designer, they can create a new set of maps simply by drawing a river sketch.
Example 2
Example 3
Conclusion
With Guided Generation in prologue, we are using machine learning to generate a unique experience for every game played, however we are utilizing the skill of game designers to make sure those unique experiences are interesting.
Experimental mountains in Prologue development build.
The future of guided generation at PLAYERUNKNOWN productions will follow the needs of our projects and our players, but the two most obvious extensions to this as we see it now are this:
- firstly, scale: we are currently producing 64km^2 maps with guided generation, but we want to be able to extend this to planetary sizes. Thinking about water flow, this will mean creating entire river networks and generating a planetary size heightmap which incorporates that.
- secondly, domain: we are generating the heightmap with guided gen, but there is nothing stopping us from applying this to other aspects of the game. Say we would like to create caves or mountains which had a specific set of requirements, a process of guided generation like what we have done with these heightmaps would be possible.
Apart from this, post-release when we get players in the game, its possible we can fold in player data to finetune maps. Also, we want to look at a range of different biomes and how they each individually capture water flow/verticality, and also how we can blend biomes naturally between one another. But our goal remains to give players a unique experience that they will enjoy, and we are excited to bring that to players soon.
Join the conversation and learn more about the technology behind Prologue: Go Wayback! at the PLAYERUNKNOWN Productions Discord.
About the author:
Joey Faulkner is a Senior Machine Learning Research Engineer at PLAYERUNKNOWN Productions, currently focusing on delivering landscape generation in Prologue. He holds a PhD in Machine Learning & Astronomy from the University of Edinburgh and a Master's in Physics from the University of Oxford. After 10 years working on various Machine Learning focused startups from agriculture to green energy, he has started working in games development, firstly at Epic Games and now here at PP Studios. Outside of work, he has been playing online video games since EverQuest; and enjoys board games, hiking and test cricket.
Share: Twitter Facebook Copy link Next article

Keep me posted
Stay updated on our journey to create massive, procedurally generated open worlds.
For more latest news and updates you can also follow us on Twitter