The Two Types of Random Game Makers Toolkit

Video games are full of randomness. There are roguelikes with procedurally-generated level layouts. Role-playing games with random encounters. Strategy games with unlucky misses. And games that play with cards, dice, roulette wheels, and random number generators, or RNG. It’s all the same stuff, really: situations and systems where the outcome is not fully determined by the developer or the player, but driven by the unpredictable whims of lady luck. But while randomness is responsible for some truly wonderful moments in gaming, it can also be a cruel mistress that leads to unfair outcomes and frustrating failures. RNGesus - who is the personification of luck in the gaming community - is cursed just as often as he’s worshiped. So, what gives? Why does this single game design tool lead to such radically different reactions? Do we just like luck when it lands in our favour, and hate it when we lose? No, I don’t think so. The truth is, some game designers actually split randomness into two distinctly different concepts - and recognising these differences can be the secret to wrangling RNG, and making luck more fun than frustrating. I’m Mark Brown, you’re watching Game Maker’s Toolkit, and this is the two types of random. Before we get to that, though, I think we need to talk about why randomness is used in game design, at all. For starters, randomness is used to provide variety. Well-made algorithms can pump out practically infinite set-ups, levels, characters, and problems. Sure, a procedurally generated level is almost never as good as a completely hand-crafted one - but the clear advantage is diversity and quantity. You couldn’t make a game like Shadow of Mordor, with its unique cast of Orc captains; or Minecraft, with its infinitely-large worlds, without a big dollop of randomness. Some games generate content once, and then distribute that to all players - that’s how every No Man’s Sky player gets to explore the same set of, uh, 18 quintillion planets. Other games generate new content every time you play, which is how games in the roguelike genre work. That can be beneficial because by removing the ability to endlessly replay the same level and memorise every aspect of the stage, players are forced to master the underlying mechanics of the game itself - so they’re ready for absolutely anything the algorithm might throw at them. Randomness is also a way to balance a multiplayer game. Basically, lucky rolls and unlucky draws can limit the importance of pure skill, and give newer players a chance to get ahead. That’s especially true when the randomness is weighted in favour of new players, such as in Mario Kart where the random item boxes are way more generous to the players at the back of the pack, than those in first place. This is usually only desirable when it’s expected that players of vastly different skill levels will be playing together - otherwise, the randomness can obscure who is actually the most skilled combatant. So that’s why it appears more often in party games and board games for families, and not esport-level stuff. Randomness can also be used to make rewards in games more exciting. Grabbing an awesome new weapon from a dead body in a looter shooter like Borderlands is way more exciting when you know there was only a small chance for that gun to drop. This can, of course, be taken to the extreme, creating a Skinner box trick that’s designed to sap your time or, more perniciously, your wallet. And finally, randomness can play a role in the player’s formation of plans - which are strategies that take a number of steps to achieve. Making plans requires information - which is essentially the current state of the game’s variables like the enemy’s location, health, and perhaps even their intention for what they’ll do on the next turn. The more information we have, the better our plans can be. But too much information can actually be quite troublesome. For one, complete transparency can lead to players being able to calculate many possible moves into the future to figure out the optimum choice - a paralysis of analysis which can be super tedious, but you already know how players can optimise the fun out of a game. This can already happen on a single turn of Into the Breach, which is a tactics game that shows you the entire board and every enemy’s plan for their upcoming turn. You can spend 10, 20 minutes just staring at a static screen, figuring out the ramifications of every choice you might make. Plus, we can create airtight plans which rarely fail - like in Plants vs Zombies where we get to see the exact cast of upcoming monsters and can quite easily create the perfect defence. This can create flat and uneventful gameplay, as it’s often much better when plans get disrupted with surprising new information - forcing us to react, regroup, and replan. There’s never been a good movie where the heroes come up with a scheme and it just perfectly works as intended. Drama is driven by the unexpected. So we generally want to cap the amount of information the player has access to. The game designer Keith Burgun calls this the information horizon, defined as “the distance between the current turn, and the point at which information becomes known to a player”. And there are four main ways to do this - exponential complexity, like the ever-expanding matrix of game states in chess. Execution uncertainty, which comes from the player’s unpredictable ability to carry out skill-based challenges. Hidden information, like the fog-of-war that hides the enemy’s plans in Starcraft. And, the one we’re talking about today - randomness - like not knowing what the enemies will do on the next turn in Into the Breach. You can’t make perfect plans if certain factors are, by design, completely unpredictable. So, randomness certainly has a role in game design. But to really get to grips with it, we need to break it down into two types - which game designers frequently refer to as input randomness, and output randomness. Input randomness is when a random event occurs before the player gets to make a decision. The most obvious take on this is the procedurally generated levels in a roguelike, because they’re cobbled together and then you get to play in them. Other examples are drawing a hand of cards before taking your turn in a deckbuilder, or rolling dice and then choosing where to spend them in Dicey Dungeons. Output randomness, though, is when you make a decision and then luck takes over and the game tells you what happened. The most infamous example of this is hit chances in XCOM, where you tell your soldier to shoot an alien - but it’s down to chance whether your bullets will actually hit their target. Other examples are not knowing what the enemy will do until after you press “End Turn” or, I guess, paying for a lootbox and only afterwards being told what was in it. I’ve heard the same concepts be called pre-luck and post-luck, by Civilzation 4 designer Soren Johnson. But let’s stick to input and output for this video. These two terms were first introduced, as far as I can tell, on the podcast Ludology GEOFF ENGELSTEIN: “In general, I find this distinction between input and output randomness to be very valuable. I think this is the fundamental difference between randomness that supports strategy, and randomness that undercuts strategy”. The host, Geoff Engelstein, makes a good point there. Output randomness is certainly more responsible for anger and resentment than input randomness. Output can take away control, and break your plans not out of strategic incompetence but sheer bad luck. And most of the random stuff we like the least in games can be labeled as output randomness - such as random encounters and loot boxes. So certain developers are becoming privy to this - after FTL, which was stuffed to bursting with swingy output randomness, Subset made Into the Breach which almost exclusively features input randomness - leading to a much fairer and more strategic game. And while early builds of Slay the Spire hid what the enemies were planning to do until after you finished your turn, the devs found the game was way more fun when they switched things so the random choice happened at the start of your turn - allowing you to strategise around your foes. Output became input. But I don’t think it’s just a case of input randomness equals good, output randomness equals bad. They’re both tools that must be used wisely, and poorly designed input randomness can wreck a game, just like carefully tuned output randomness can, sometimes, improve it. With input randomness, these unpredictable starting conditions can sometimes massively dictate the likelihood of success. So in Spelunky, these crates have random items in them. You’re much more likely to get something mediocre like bombs or ropes than something amazing like a shotgun or jetpack - but if you are so lucky as to get one of these items at the start of the game, you’re going to have a much easier time of things. This can make it hard to tell if your success was down to skill, or just good luck. And it can also make runs where you don’t get the goodies feel slightly pointless. Some speedrunners will just restart the game over and over again until luck is in their favour, and they get good items in an early crate or shop. To be fair, this does lend Spelunky an interestingly spiky texture. But designers have found some clever new ways to present random starting conditions. In Slay the Spire, the devs didn’t want you to just hit restart until you got some really powerful cards or a relic at the beginning of your run. So they introduced a system where you start the game with additional bonuses - but only if you made it to the first boss on your previous go. This encourages players to at least try to play with the stuff they’re given, and who knows - maybe they’ll still find a strategy that can see them be victorious. Another way is to control the randomness in some fashion, to reduce the chaos that it can bring. When setting up the tabletop game Pandemic, you start by removing all of the epidemic cards from the play deck. These cards are terrifying game-changing events that can completely demolish your team. You then split the remaining cards into four piles, and shuffle one epidemic card into each. Finally, you stack the four piles together to create a finished deck. It’s a bit of a faff, but it’s a clever way of ensuring that you always have a pretty fair game, where epidemic events happen evenly throughout the adventure. It’s impossible to have, say, three epidemics at the very start, or no epidemics until long after you’ve cured all the diseases. But there’s still a chance of getting two epidemics in a row, or having an epidemic on the very first turn - though, neither of these would break the game, and the odds are slim enough for those to be exciting, surprising, one-off events. I’ve never said the word epidemic so many times. And, actually, lots of games put limits on their randomness. Diablo 3 has a smart loot system, where you’re more likely to find items that match the character class you’re playing - to reduce the likelihood of finding pointless hats and swords. And in modern versions of Tetris, the game doesn’t just pick a block at random for every drop. Instead, the game generates a random sequence of all seven blocks and then delivers them in that order - before making a new sequence. This ensures that you’ll always get a diverse selection of blocks, and there’s an absolute maximum of twelve garbage blocks between two gorgeous I-blocks. Sometimes called line pieces, or Colin Blocksworth. And, for what it’s worth, while Spelunky typically has a low chance of randomly giving you one of these icky dark levels - the game won’t spawn one if you finished the previous stage in under 20 seconds, just to be merciful to speedunners. Another thing to consider is how often are new input randomness events occurring? If these occur at the start of every single turn, it can have the effect of drawing the information horizon in claustrophobically close - and stopping you from making plans that last any time at all. Designers should, ideally, consider their game’s information flow - a term invented by Ethan Hoeppner in the article Plan Disruption. He points to XCOM, where we can make strategic plans about how we want to approach each mission and for a good few turns our plan will be pretty viable - not perfect, thanks to all the output randomness. But close enough. But every now and again, you’ll stumble onto a new pod of enemies, or a fresh bunch of foes will descend onto the battlefield. This unexpected spike in new information disrupts your plans and forces you to stop, regroup and rethink. He says “a good pattern to follow is the spiky information flow, in which high-impact information is collected into discrete spikes that happen at regular intervals, with a slow, regular flow of information between the spikes”. As for output randomness - you might wonder why developers would want to use it at all. Well, for starters, this sort of randomness can be a good way of simulating mistakes and inaccuracies in a game with an abstract combat system - which is games where you tell characters to perform an action rather than doing the action yourself. If your units never missed, then that wouldn’t be particularly realistic. Also, output randomness forces players to think about risk management, and to create contingency plans if things go wrong - which I think are totally valid skills to test. There’s this idea that output randomness essentially becomes input randomness for the next turn, because you’ll be dealing with the consequences of whatever just happened. Essentially: the best XCOM players are those who have a backup plan if their shots miss. And there are also methods to make output randomness feel more fun. One way is to get away from binary hit or miss mechanics. In Phoenix Point - which comes from original XCOM designer Julian Gollop - each bullet fired is simulated through a ballistics system so you might find that some of your bullets hit, and some of them miss - which is way less annoying than XCOM’s punitive complete miss. It can also be important to show the player the odds, because this allows them to make way more informed decisions about which risks they’re willing to take, or how their actions - like moving closer to the enemy - can impact their chances of success. Unfortunately, though, humans are just really bad at understanding odds. That’s thanks to countless cognitive biases in our pattern-seeking brains that make it really hard to deal with random numbers. In fact, game developers frequently lie about the actual chances of things happening, so the probability in games better matches the broken probability in our heads. The numbers in most Fire Emblem games are subtly massaged in the player’s favour so - for example - a 90% chance to hit is actually more like a 99% chance. If you lose two 33% chance battles in Civilization, the third will always succeed because that’s how we think numbers work. And there’s allegedly a pity timer in Hearthstone, to ensure you’ll always get a legendary card after a certain number of empty packs. If number manipulation isn’t your thing, one of the best ways to get around this is to ditch those cold, unknowable computer calculations in favour of recognisable, real-world mechanisms - like a six-sided die. Zach Gage, creator of the dice-filled space survival game Tharsis, says “we understand things that we can hold in our hand. When things get abstract, especially with math, it becomes very difficult. Human beings just have this innate understanding of stuff that we can touch and hold and turn, and look at. The dice in Tharsis are an analogue for something everyone is familiar with”. Tharsis, and the similarly tabletop-inspired Armello, even include physics systems to drive their digital dice - in an effort to make them seem even more realistic. Other games use cards - another familiar, real-world favourite. Cards are interesting because where dice feature independent probability - i.e. each throw of the die has zero impact on the next one - cards can have dependent probability - i.e. by drawing a card and removing it from the deck, you’ve now changed the makeup of the deck and impacted the probability of the next draw. It’s the latter that makes it possible to rack up ridiculously fun synergies in Slay the Spire. It can also be good to have output randomness in places that will only ever be in the player’s favour. The only real example of output randomness in Into the Breach is the game’s building defence system where there’s a very small chance that the enemy’s attack will actually miss and save you from surefire defeat. It’s so small that you never actually count on it to save it you, but boy does it feel good when it lands. Here’s the game’s co-designer, Justin Ma. JUSTIN MA: "We found that if there’s randomness where you’re expecting something bad and then you get something good, no one ever ever complains. So that’s the only kind of randomness, output randomness, that we left in the game”. So randomness can be an incredibly important part of games. It’s used for variety, balance, rewards, the information horizon, and probably more things I’ve forgotten about. But because it can impact everything from fairness to player psychology, it’s something that designers must use with great care and attention. Understanding the difference between input and output randomness is perhaps the most important thing to learn - but it’s also crucial to realise that neither of these is a silver bullet or a dastardly trap. Both can endanger or improve a game’s design - depending on how they are used. But when used correctly, randomness can do amazing things. It can create surprises and unique situations. It can force the constant reevaluation of strategies. And it can turn players into risk-calculating tacticians. Thanks so much for watching. I’ve put some links in the description to some resources if you want to learn more about the technical side of random number generation. And also to head off the comments about how computers can’t do “true randomness”. I also want to give a huge thank you to my patrons - especially those who helped contribute towards this video in my new GMTK Workshop. It’s a thing for $5 backers, where they get to see early versions of certain new videos, and provide feedback or suggestions. Their help was invaluable on this episode.