A Paradox of Random Generation
In the world of modern game design, random and procedural generation is everywhere. Entire genres, Roguelikes and Roguelites, are fundamentally built on it and are enjoying extreme popularity right now.
Even in games where things don’t change every time you play, random generation is still heavily used. Games like No Man’s Sky and Star Citizen use forms of random generation to create entire planets, the Age of Empires franchise uses it to generate their randomized maps, and many titles use it to create randomized “extras”, NPCs that populate virtual cities and towns.
Duple Dragon also heavily relies on random generation to create every stage you play. We already wrote multiple articles about how it works. Today we wanted to explain a fascinating paradox in using random generation to create good gameplay—one which we explored and learned through our experimentation while building Duple Dragon.
True Randomization is Just Noise
Duple Dragon was designed from the start with random generation in mind. We’re a small team with limited resources, and it wasn’t feasible for us to hand build enough stages to keep people busy week after week. We knew we needed to create a system that would automatically create fun stages as needed. This led us to create our template system.
You can learn more about how our template system works in this previous post, but the short version is this:
- We hand-built hundreds of small templates in a variety of themes. Like lego bricks, these templates are randomly strung together end to end to create the stages you play.
- Stages come with a difficulty and one or more themes, these limit the pool of templates that can be used. The pool is further limited by a cap on the number of different templates that can be used within the available difficulty and theme.
- Hazards are handled separately; stages can randomly choose between hazard themes to add on top of the main theme of the stage.
Our goal was to get as much variety out of these templates as possible. It seemed intuitive that the larger the range we allowed in our random generation, the more possibilities there would be and the more variety we would end up with.
We started out with wide ranges, allowing as many as four themes in a stage, and on the hardest difficulty up to six hazard themes. This meant that any of our stages could be created with a single theme or a mix of several—it was all up to how the dice fell. The majority of templates came from the same difficulty as the stage, but also a smaller amount from one difficulty below, an even smaller amount from two difficulty levels below, and an even smaller amount from one difficulty above.
As we tested more and more, though, it all felt the same. It turned out that when things are truly random, most of the time it just looks like noise. Stages had so many things mixed together that you were left with only a feeling of chaos. Ironically having many themes mixed together felt like there was no theme at all. It was muddled and immemorable, and we knew we had more work to do.
Variety is the Spice of Gameplay
As our design exploration continued, it became more and more clear that randomization by itself does not create a satisfying sense of variety, no matter how big the pool it’s pulling from is. Counterintuitively, to make things feel random, we actually needed to reduce the amount of randomness.
As we mentioned at the start of this post, our goal for the random generation in Duple Dragon was to make memorable stages without the need to manually create them each week. With that goal in mind, and through our discussions on the topic, we came to the following conclusions about what makes for good random generation:
1. To create a sense of maximum variety between stages, less is truly more. It’s more memorable to have a stage chock full of Evil Spirits, than a small scattering of every kind of hazard available. By forcing our generation to pick a narrow range of options it creates stages that feel more intentionally designed. It also has the added bonus that players will see game content over time, rather than all at once.
2. Chaos can be memorable, but only when used rarely, and never as the first thing you see. We decided it’s okay for there to be a small chance of the old chaotic style of generation, but in order for it to feel memorable it has to be a rare occurrence. In other words, players need to see what the orderly version is like before they can understand why the chaos is interesting.
A Journey in Two Parts
At this point in the story we were racing towards our initial release of the game. We implemented improvements to the random generation by release, but in the months that followed we felt that it still wasn’t quite hitting the mark. Despite our efforts, some of the old noisy feeling was still happening.
Around this time we started our roguelike experiment. That experiment has been put on indefinite hiatus for now, but we learned a lot of important things about the game while working on it. Having a separate sandbox where you can really tear things apart and put them back together can be a fruitful place to solve problems, and random generation was one thing we explored.
We decided to take things to the extreme and see how it felt. What would happen if we only had one theme per stage? One hazard type per stage? What if we didn’t bring in other difficulties at all and only used the stage difficulty? What if we heavily limited the number of templates that could be pulled from the pool in a given stage?
We tried all of the above and more, and throughout this experimentation we found some great results. While there was definitely such a thing as too narrow of a pool to draw from, having a severely limited set of choices for the generation to use for each stage made a big difference in how distinct and memorable those stages felt.
Narrow Randomness is the Answer
While exploring our own game through the roguelike experiment, we also looked to other games using random generation to see how they did things and if it lined up with our conclusions that narrow randomness seemed to feel more satisfying than broad randomness. A strong example we kept coming back to was Slay the Spire.
If you haven’t played Slay the Spire (you should, it’s excellent) the quick overview is it’s a roguelike deck building game where you try to battle your way up a tower and defeat the final boss, working to build an effective arsenal of relics and cards as you go.
We noticed a number of things about how they do random generation that lined up with our conclusions:
- You have a choice of different paths to take each run, but they follow a consistent and narrow set of constraints. For example, you never see a path with many elite encounters in a row. They give you just enough variety in the paths to create a meaningful choice, but the variance is small between them.
- You almost never see the same enemy encounter twice in a run. A truly random generation would potentially spawn streaks of the same enemies, but they’ve purposely designed it so you get a unique encounter every time.
- Collected cards and relics heavily influence the random generation for future choices. For example, if you find a relic which boosts a specific card, you’re more likely to find other cards and relics that boost it, too. It’s still random enough to be surprising and feel unknown, but this weighting of options towards a cohesive strategy is a lot more satisfying than true randomness, which could easily give you an exciting build-around card or relic, only for none of the other pieces of the strategy to ever appear.
Improvements in Action
With our learnings in mind, we moved to implement them in the game. We reduced the range of themes a stage could pick down to just two at maximum. Two themes felt like a good middle ground that still allowed for more variety without losing memorability. This was in line with the way we initially envisioned our templates working; mixed and matched in many ways like Lego bricks.
Hazard themes were also reduced, and the range was narrowed. Early designs had hard stages using 1-6 hazard themes, and this was narrowed to 2-3. This controls the chaos, and also ensures that hard is always going to have multiple types of hazards compared to the easier difficulties.
The difficulty ranges in each difficulty tier also saw changes. Stages now pull most of their templates from the stage difficulty you’re at, and only a small amount from one difficulty below.
The result of all these changes is that stages in Duple Dragon now feel more distinct and memorable in 2.0 than they do in our currently live release. There will be a lot more “spikey” moments, times when you see a lot of one thing instead of a mix of everything. This also works better for the Powers system in the game. You’re meant to change your powers as needed to overcome different challenges. Stages having a narrower range of challenges in them means good power choices are even more impactful than before.
Experience the Improvements in 2.0
These improvements to random generation aren’t live yet, but they’ll be coming along with a slew of other improvements when our 2.0 release arrives.
We hope you’ve enjoyed this tour of all we’ve learned about random generation. Random and procedural generation is used more and more heavily in game design these days, and with the advent of AI-generated content, it’s likely to continue increasing. Understanding the upsides and downsides of it is important for anyone trying to make games using these techniques.
– Caleb, Ian, and Souren