Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News - Blog: PRNGs and controlling fate in video games

#1
Blog: PRNGs and controlling fate in video games

<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games.png" width="300" height="175" title="" alt="" /></div><div><p><strong><i><small> The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.<br />The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company. </small></i></strong> </p>
<hr />
<iframe class='youtube-player' type='text/html' width='654' height='368' src='https://www.youtube.com/embed/4GXb2Da1Rak?version=3&rel=1&fs=1&autohide=2&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent' allowfullscreen='true' style='border:0;'></iframe>
<p><big>Just to quickly explain that video, and why it was worth starting with: That was a competitive match of Super Smash Brothers Melee, and Peach has a 1.7% chance of pulling a super strong turnip with one of her moves, and it’s very rare and very useful. So in this clip, the player does it twice in a row, with a taunt in between, and the crowd and commentators go nuts, because that’s unprecedentedly lucky. But my favorite thing about this clip is that Armada, the peach player, was interviewed afterwards about this moment and he says that he “Just knew.” There’s not really any way he could have known, right? That’s sort of the point of randomness, that it’s unpredictable and uncontrollable. So why is the way we talk about luck so active, or participatory? How do we end up with things like “the gambler’s fallacy” and good luck charms? How can people claim to be skilled at luck? There’s this compelling narrative of certain people being able to control fate, to be in total control over there life, but that’s not really possible, right?</big></p>
<iframe class='youtube-player' type='text/html' width='654' height='368' src='https://www.youtube.com/embed/rs55rZcbXYI?version=3&rel=1&fs=1&autohide=2&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent' allowfullscreen='true' style='border:0;'></iframe>
<p><big>Well, there’s this guy named Dominic LoRiggio, who calls himself “The Dominator”, and he consistently wins at craps (dice throwing). Above is an hour long BBC Documentary about him. You really only need to watch 30 seconds or so to get the idea. It’s not the most high end documentary, the video quality is bad and the dramatic reenactments are hilariously dramatic. He goes to a shady seminar and gets recruited to some sort of dice gang, they really play up the “fighting fate” narrative. The gist is that because craps relies on the laws of physics as it’s source of randomness, it can be controlled through careful throwing, and it isn’t technically cheating. </big></p>
<p><big>Now, it’s very possible that the controlled throwing seminar is a complete scam, none of the sources I’ve found are really sure, but it’s an enticing thought. Not everything we think of as random is necessarily out of our control; dice are basically the icon for chance but they’re much more deterministic than we give them credit for, <strong>once you understand the rules they follow</strong>. When something seems random but is actually derived from deterministic rules, that’s called a <strong>Pseudo Random Number Generator</strong>, and that’s the main thing I want to talk about: how they work, the history of pseudorandomness in video games, and what that means to players. My goal in all of this is to make some suggestions for how designers might be able to better tap in to the experiential potential in “Controlling Fate”, because right now the majority of the interaction people have with randomness in games is very surface level, often banal. You can increase the drop chance of loot by wearing a jester hat in Dark Souls, or type in a swear word as a seed for a Minecraft world, but there’s very little thought by the player as to what that means, what they’re actually doing. And there’s a lot more depth of control available with PRNGs.</big></p>
<p><strong id="docs-internal-guid-b67b84ce-7fff-7235-7f6c-2767c7dc0b0c"><img height="175" src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games.png" width="300" /></strong></p>
<p dir="ltr"><big>The people who care the most about PRNGs seem to be mathematicians and cyber security people (it’s very useful for security to be able to generate numbers that are unpredictable if you aren’t in the know, but knowable if you have the key). For one that makes a lot of the writing very dense and technical, but I’ve gone through the trouble of picking out the interesting stuff for us. This <a href="https://www.embedded.com/design/configurable-systems/4024972/Generating-random-numbers">article</a> by Eric Uner points out a variety of important properties that PRNGS are derived from, and I think it’s not a huge leap to try to attach some of these useful terms to input. These are the venues that we would be able to give players control over chance through.</big><strong> </strong></p>
<figure><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-1.png" /></figure>
<p><big><strong>Seed</strong> is an obvious one, it’s the starting point from which the rest of the sequence is derived, and inputting a different seed causes a different result. A lot of games that use procedural generation have this element exposed, such as the aforementioned <em>Minecraft</em>. But it’s not usually as a part of the central gameplay, it’s usually in the menus, or input before the proper game begins. The relationship between the seed and the outcome is also usually obfuscated to the point where the player can make no meaningful choices when inputting a seed, it’s just used as a way of getting repeat outcomes. If you type in “lava” as your <em>Minecraft</em> seed, you sadly do not receive a lava world, it’s a bit unintuitive.</big></p>
<p><big>This brings us to the next property, the <strong>formula</strong>, which is what converts the seed into whatever it is you’re outputting: level generation, item drops, etc. This part is always there under the hood in any PRNG, but I think exposing it, making it editable or learnable, could be valuable. A game that makes it’s formula slightly more digestible is <a href="https://bitstorm.org/gameoflife/" rel="noopener" target="_blank"><em>Conway’s Game of Life</em></a>, which has a more visual rule set that is still deep enough to produce securely unpredictable results.</big></p>
<p><big>It doesn’t let you change the formula at all, at least in any implementations I’ve seen, but it does expose it and help it make sense by dressing it in the analogy of over and under population. The game is also very open and encourages experimentation with little risk, which really lets players take the time to learn the rules for themselves.</big></p>
<p><big><strong>Step Frequency </strong>refers to how often the operation, the shuffling and dealing if it were playing cards, is repeated. This is something that gets more use in games, but usually in the form of grinding. To bring it back to the opening clip, there <em>is </em>one way for Peach players to get better turnips more frequently, it’s pretty simple they just have to find more opportunities to pull. Even that small, inherent amount of control has had effects on the metagame though. Players have developed a method (shown above) to most optimally farm through turnips, thereby <strong>mitigating some of the luck</strong> <strong>with skill</strong> (the method is quite technically difficult). A similar example in shooters would be critical hits, the <strong>frequency </strong>of crits would be naturally be higher on a weapon with a higher fire rate.</big></p>
<p><big><strong>Distribution </strong>is another related term, it refers to how varied the results can be. A random number generator that only gives you 4s and 1s has a lower distribution than one that gives you a number from 1–100. <em>Project M</em>, a competitive <em>Super Smash Brothers Brawl</em> mod, adds some foresight, if not total control, of the distribution of Mr. Game and Watch’s Judgement move. The move, in other games, is completely random and displays a number from 1 to 9. Project M adds a visual indicator that lets players know whether the next hammer will be even or odd, thus limiting the <strong>distribution</strong> and allowing players to make more informed decisions. Since the hammer can also not be the same as the previous 2 numbers, it’s possible to lower the odds of a getting a 9 (the strongest one) down to ⅓, and also be aware of what the other two options will be.</big></p>
<p> </p>
<p><big>All of these properties (and there are more in the <a href="https://www.embedded.com/design/configurable-systems/4024972/Generating-random-numbers" rel="noopener" target="_blank">article </a>for the curious) can be, or have been, linked to game mechanics, but as I said it’s often been very surface level. I think part of the reason for this is that modern PRNGs are often too complicated to be able to teach to players, especially when a lot of games tend to take a very long time just to get across basic movement mechanics.</big></p>
<p><big>Unfortunately because of the cryptographic focus of most PRNG writing, most Pseudo Random Number Generators are designed to be <em>hard </em>to interact with for <strong>security</strong> reasons, while as designers we would probably be aiming for a pleasant sweet spot of intuitiveness and challenge. I’ve found the closest thing to what we would want in PRNG literature comes from older formulas, which are generally pretty terrible for what the math people want.</big></p>
<p><big>One such method is the middle square method, by Jon Von Neumann.</big><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-2.png" /></p>
<p><big>It’s simple enough to be essentially a game on it’s own. You take a number as your seed, and you pick a number of digits, thats <strong>k</strong>. You square the first number, and then the middle <strong>k</strong> digits of the square is your new step. You then square that and repeat.</big></p>
<p><em><big>So here’s a puzzle, if the first number is 12345, and the 3rd number is 225625, what’s <strong>k</strong>? The answer is upside down below, like a newspaper puzzle:</big></em></p>
<p><em><big>xᴉs ʎʇɟᴉɟ pǝɹpunɥ uǝʌǝs puɐsnoɥʇ ɹnoɟ ʎʇɟᴉɟ = ɹǝʍsuɐ</big></em></p>
<p><big>I’ll admit it isn’t a very fun game, it’s really just math, but it serves as a hopeful example that the sweet spot we want can exist, where, given the <strong>proper understanding </strong>of the formula<strong>, </strong>something unpredictable to a layman becomes obvious to someone skilled. So how would we make this genuinely fun, something that people would actually play?</big></p>
<p> </p>
<p><big>Well, one way to find that out is to look at a particular sect of players, who’ve been finding ways to “control fate” even in games where the developers didn’t want them to be able to. Speedrunners, and to an even greater extent TASers (tool assisted speedruns, played frame by frame), are quite dedicated in their unraveling of game engines in order to beat the games as fast as possible. In certain games, usually older ones with more limited computational power, randomness was determined in strange ways, still designed to obfuscate but often tied to player input for lack of a better source of chaos. The tie to player input lets dedicated players do incredible, empowering things .</big></p>
<figure>
<iframe class='youtube-player' type='text/html' width='654' height='368' src='https://www.youtube.com/embed/Zp0jd2I7fPI?version=3&rel=1&fs=1&autohide=2&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent' allowfullscreen='true' style='border:0;'></iframe>
<p> <br />
<figcaption>A tutorial for real time RNG manipulation in Oracle of Seasons. You too can <em>control fate!</em></figcaption></figure>
<p><big>I think it’s kind of beautiful that that just by <strong>linking their PRNGs to player input</strong> these old games accidentally have such added richness. It’s like a <em>hidden power</em> in the player character that can only be brought out through determination and perseverance. That’s exactly the kind of power narrative some designers love to try to invoke and here they were doing it completely by accident. Possibly the best example of this secret power is in The Legend of Zelda Oracle of Ages / Seasons. The engine is only stepped (shuffled) during certain actions in game: screen transitions, digging, sword slashes. This <strong>limited iteration</strong> allows more fine control from players but the best part is this: the pitch of the sword slash sound effect in the games is determined by the PRNG, and as such acts as useful <strong>feedback </strong>(essentially the inverse of <strong>Security</strong>)<strong> </strong>for players. Specific series of sounds allow players to confirm their setups and locate themselves in the generator. These factors allow this RNG manipulation to be viable for real time play, while in other games where it’s less accessible it can be too difficult to perform. And if it’s possible for developers to make RNG manipulation playable by accident, I’m fairly confident we can make it better than playable, <em>fun</em> even, if we actually do it deliberately, taking into account all these factors.</big></p>
<figure><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-3.png" /><figcaption>Bonus fun, a transcription of the simple PRNG in Megaman 2</figcaption></figure>
<p><big>So to reiterate, for luck manipulation to become a useful game mechanic, it needs to be <strong>tied to player input</strong> in some way, and it needs <strong>feedback</strong> so players can understand the system. It needs to be simplified compared to cybersecurity PRNGs, so that the relationship (<strong>formula</strong>) between <strong>seed </strong>and outcome can be understood. Maybe it would be good to let players tamper directly with the formulas, allowing room for creativity. We’ve also learned a variety of ways in which someone could interact with a PRNG, and each can result in different feelings of interaction. Controlling <strong>step frequency</strong> might be farming for a higher frequency or dodging triggers in order to avoid shuffling. Controlling <strong>range</strong> might look like wearing certain charms to invoke certain behaviours in NPCs or the weather.</big></p>
<p><big>The <strong>requirements</strong> for players being able to conquer these systems can be varied as well. It can be <strong>execution difficulty</strong>, like “The Dominator” and his controlled throws. Maybe it’s just a <strong>knowledge gate</strong>: learning the value of K. Or maybe it’s about <strong>learning a system</strong> through experimentation, like figuring out what shapes in Conway’s Game Of Life are stable.</big></p>
<p> </p>
<p><big>So what would a game look like that takes all these things into consideration? Let’s design, hypothetically, a game centered around the mechanic of manipulating chance. Firstly, we need to select a what kind of <strong>seed </strong>we want, and what <strong>formula </strong>we want to apply to it. In order to help players understand and manipulate the formula easily I want to make it something very visual and tangible.</big></p>
<p><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-4.png" /></p>
<p><big>Taking inspiration again from Game of Life, let’s have the <strong>seed</strong> be a small grid of pushable blocks that represent different elements in the game. The blocks can be connected to characters in a game world (let’s say it’s blocks with faces) and their coordinates in the push-block grid can correspond to the locations of the characters on the larger map. So you essentially get to place players in different locations and then go out into the world and find them there. Characters could react differently in different areas or when adjacent to other characters. This relationship is nice and intuitive, but it’s probably <em>too</em> controllable right now to be considered random.</big></p>
<p><big>This is where we need the <strong>formula, </strong>some operation to conduct on the blocks at set intervals to make the arrangement change in complicated ways. The formula could be movement patterns that each block has, denoted by arrows on the block: one character might move left and down alternatingly, or one might circle clockwise. Players could try to set the initial positions such that these moving blocks collide with each other several steps later to be in the positions the player needs.</big><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-5.png" /></p>
<p><big><strong>Step Frequency </strong>then comes into play. How often do the blocks move, and how often can the player reset them? Let’s say that the game runs on a day night cycle, with blocks moving every hour on the hour. The player can only reset the positions at midnight. Tying step frequency to time makes sense aesthetically, but as we’ve learned it might be interesting to tie the progress of time to the player’s input, via their progress through the map. If the map is split into individual screens like <em>Zelda </em>1, time could pass an hour every time the player changes screens. Thanks to the visual <strong>feedback</strong> of a UI clock updating or the light changing it becomes less of an arbitrary connection as it was in the Oracle games.</big><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-6.png" /></p>
<p><big>The skill being tested with this would be of the ‘<strong>understanding the system variety’</strong>. New players presented with the grid likely won’t understand it and will get a slew of unpredictable and unfavorable placements of characters throughout the day. They can continue shuffling the blocks about randomly each day and seeing what they get, and observant players could hopefully start making deliberate choices and planning more and more steps ahead to get more and more specific outcomes.</big></p>
<p><big>Of course this is a very rough outline of a game idea, and a lot of the success of it would depend on the execution and clarity of the feedback, and the complexity of interactions between characters and locations. But hopefully you get the idea, that if you design with these properties in mind you can arrive at some strange, unique ways of interacting with a game that can still be approachable and fit in with standard game tropes.</big></p>
<p><big>Obviously not every game can afford to be <em>about</em> luck manipulation, they don’t need to be. But these concepts can be applied with more subtlety to preexisting genres and formats to easily add richness to current systems.</big><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-7.png" /></p>
<p><big>Take the loot drop rates of an RPG, <em>Dark Souls</em> for example. <em>Dark Souls’ </em>only way of interacting with its luck engine is being able to slightly increase the overall chance of drops. <em>Dark Souls </em>loves to obfuscate it’s mechanics and I wouldn’t want to take away from that by completely opening the hood on the underlying randomness. But you could add some subtle depth by allowing some more specific control over the range (<strong>Distribution</strong>) of drops; Players already wearing parts of an armour set could have raised chances to find the remaining parts, or there could be specific rings that increase the drop chances of specific categories of items (swords, healing items, ‘warm and fuzzy’ items, etc.) Players might even be completely unaware of these mechanics depending on how obvious the effects are, but it would still flavour each player’s experience differently and more deliberately than purely random variations.</big></p>
<figure><img src="http://www.sickgaming.net/blog/wp-content/uploads/2018/12/blog-prngs-and-controlling-fate-in-video-games-8.png" /><figcaption>A hypothetical ring that would increase drop chances for plant-based or healing items.</figcaption></figure>
<p><big>I think Esports games in particular can also benefit from this school of thought, I know many already do to one degree or another. But frustration surrounding RNG mechanics in MOBAs, Shooters, Platform Fighters, etcetera is definitely still prevalent. People get frustrated by random crits, but headshots are adored because they’re skill based. Being able to reinforce every luck mechanic with skill or strategy could help mitigate these complaints and add more competitive depth to a character. If a character’s chance for crits increases gradually so long as they never stop moving, that can encourage a certain style of play and require players develop a certain skill. You could have another character have the opposite, where staying stationary is rewarded by their RNG engine.</big></p>
<figure>
<iframe class='youtube-player' type='text/html' width='654' height='368' src='https://www.youtube.com/embed/DWEQOABTaLs?version=3&rel=1&fs=1&autohide=2&showsearch=0&showinfo=1&iv_load_policy=1&wmode=transparent' allowfullscreen='true' style='border:0;'></iframe>
<p> <br />
</p>
<p><a href="https://www.youtube.com/watch?v=DWEQOABTaLs" rel="noopener" target="_blank">Fun compilation of TF2 crits, some of which are manipulated by certain loadouts and strategies to be more common.</a></p>
<p> <br />
</figure>
<p><big>I think a better working understanding of randomness and the potential therein for emergent stories and deep, compelling gameplay is useful for any designer. It lets both designers and players have more control over certain aspects of play and can mitigate feelings of unfairness or non-interactivity. And I think it’s worth our time to play with this more, collectively. Maybe it could spur a new genre, or subgenre, with wholly different skills and knowledge bases to most games currently available, kind of like the many randomized games that emerged following <em>Rogue</em>. All it would take is one shining, trendsetting example. In real life, it might not be possible to “Control Fate” but when you’re designing a game you get to decide what we can control, and why not explore that fantasy?</big></p>
<p> </p>
<h3><big>Citation</big></h3>
<p><em>Blayd92. YouTube, YouTube, 6 Apr. 2013, </em><a href="http://www.youtube.com/watch?v=4GXb2Da1Rak." rel="noopener" target="_blank"><em>www.youtube.com/watch?v=4GXb2Da1Rak.</em></a></p>
<p><em>Hull, T E, and A R Dobell. “Random Number Generators.” Source For Industrial and Applied Mathematics, epubs-siam-org.library.sheridanc.on.ca/doi/10.1137/1004061.</em></p>
<p><em>Kendall, Graham. “How to Cheat at Dice — from an Expert in Games.” The Conversation, The Conversation, 8 Nov. 2018, theconversation.com/how-to-cheat-at-dice-from-an-expert-in-games-96320.</em></p>
<p><em>“Luck Manipulation.” TASVideos, tasvideos.org/LuckManipulation.html.</em></p>
<p><em>Machicao, Marina Jaeneth, et al. “Chaotic Encryption Method Based on Life-Like Cellular Automata.” </em><a href="http://Https://Arxiv.org/Pdf/1112.6326.Pdf." rel="noopener" target="_blank"><em>Https://Arxiv.org/Pdf/1112.6326.Pdf.</em></a></p>
<p><em>Martin, Edwin. John Conway’s Game of Life, bitstorm.org/gameoflife/.</em></p>
<p><em>Myst, Vestboy. “Guide — Postmodern RNG Tactics (Knitting &amp; Panning Theory Discussion).” Smashboards, smashboards.com/threads/postmodern-rng-tactics-knitting-panning-theory-discussion.414626/.</em></p>
<p><em>O, dragonc. YouTube, YouTube, 18 Apr. 2017, </em><a href="http://www.youtube.com/watch?v=Zp0jd2I7fPI." rel="noopener" target="_blank"><em>www.youtube.com/watch?v=Zp0jd2I7fPI.</em></a></p>
<p><em>“Oracle of Ages.” Zelda.SpeedRuns.com, zelda.speedruns.com/ooa/ooatt/rng-manipulation.</em></p>
<p><em>“Random Generators.” TASVideos, tasvideos.org/RandomGenerators.html.</em></p>
<p><em>Uner, Eric. “Generating Random Numbers.” Embedded, </em><a href="http://www.embedded.com/design/configurable-systems/4024972/Generating-random-numbers." rel="noopener" target="_blank"><em>www.embedded.com/design/configurable-systems/4024972/Generating-random-numbers.</em></a></p>
</div>
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016