Have you ever wondered why the replay systems in games like Super Smash Bros. and Gran Turismo often lack simple features like fast forward and skip? Well, I did, so I dug into a couple of wonderful articles on how replay modes actually work. In addition to satisfying my curiosity, the nitty gritty got me thinking about how illusory our digital worlds really are. We throw about claims of realism and slap the simulation label on anything that doesn’t revolve around fantastical violence, but the truth is we’re a long way from condensing the complexity of real life into a collection of 1s and 0s.
To examine the vast gulf between physical and digital reality, we need to discuss determinism. Simply put, determinism means that a particular action will always produce the same reaction, every time. Drop a rock, and gravity will pull it towards the ground. Sit an ice block under the sun, and you’ll soon have a puddle.
Non-determinism, on the other hand, refers to behaviour that cannot be predicted without some measure of uncertainty. The physics of sub-atomic particles is a prime example. Heisenberg’s uncertainty principle prevents us from accurately determining both a particle’s position and its momentum, while Brownian motion hinders our ability to predict the path a particle will take through a fluid such as water or air.
Non-deterministic behaviour, by definition, cannot be codified; that would make it deterministic. Since games are, at their core, coded, predefined algorithms, they are thus entirely deterministic. That’s not to say they’re easily predictable; from the player’s perspective, there are many situations in which the outcome is obscured by insufficient knowledge or incalculable variables. But beneath the surface, all the information is there to forecast the future.
Let’s use the aforementioned replay mode as an example. Rather than recording the entire state of a game at all times so it can be played back like a standard video, many games implement a replay system based on state changes, similar to how correspondence chess used to be played before the advent of computers. Players back then would exchange letters containing only their next move, which their opponent would then play out on their personal board. Taken alone, each letter/move was useless for divining the state of the game, but played out in sequence, they made for an efficient means of long-distance chess.
Change-based replay systems work the same way. For each frame - typically 1/30th or 1/60th of a second - only the variables that have changed since the last frame are recorded. If a button is pressed, that will be noted, but if it’s still being held down, no change needs to be recorded. This principle applies to player input, in-game physics, collision detection, and any other process that affects the state of the game world.
When it comes time to show the replay, the game state at the start of recording is restored, then the game plays itself, making the exact same moves as were made the first time. If it’s implemented correctly, it will be indistinguishable from the much larger, raw-recording method.
The notion of determinism might seem to come unstuck when you factor in RNG, or random-number generation. RNG governs things like landing attacks in Final Fantasy, enemy spawn patterns in The Binding of Isaac, and loot drops in Diablo. But ‘randomness’ in games isn’t as unpredictable as it may appear. In truth, RNG is just another algorithm. It takes one number, known as the seed, and uses it to produce a string of seemingly random numbers good enough to fool us mere mortals. But if you seed the RNG algorithm with the same value, it will produce the same string of numbers, every time.
Even when RNG is random enough for our analogue minds, the effect it has on our digital experience is limited. In an RPG, a sword might inflict between 32 and 45 points of damage, subject to RNG. In Borderlands, each area has only a handful of possible enemy spawn locations. And in Guild Wars, enemies might patrol randomly within set zones, but those paths will never cross waist-high walls, shallow ponds, or mild inclines.
Real life isn’t so clearly defined. Our understanding of physics and biology is good enough for our day-to-day lives, but as the regular resetting of world records and the tumultuous state of quantum physics prove, we are still a long way from deciphering the code of the universe.
Take the weather, for instance. Forecasts are shrouded in terms of probability and vague descriptors like ‘light’ rain and ‘mostly’ sunny. The fact is that the weather is contingent on countless variables, far too many for us to currently observe and calculate. We settle instead for rough estimates, hoping that the 20% chance of rain will be respectful of our washing hanging on the clothesline.
Contrast that with the dynamic weather systems in games like The Witcher or GTA. The possible outcomes boil down to sunny and clear, foggy, light rain, and heavy storm, with few options in between. Each effect will last for a limited time then move onto the next; you won’t see any staccato storms or fake-out sunshine. Nor is there any interaction between the different effects. A downpour is just as likely to follow sunshine as is more sun. The ‘system’ part of video-game weather is often sorely lacking.
Video games represent an idealistic version of reality, one where everything is knowable. It’s possible that we will one day enjoy such omniscience - a Theory of Everything has been pursued by scientists as great as Einstein and Hawking - but it’s a long way off at best. In practical terms, then, the universe remains non-deterministic, and the predefined nature of the digital space will continue to be a simplification of the world we live in. And while quality is in no way contingent on complexity, it is worth remembering that ‘simulations’ are more often than not simulacrums. Realism is a buzz term; don’t let it fool you.
Matt Sayer is 50% gamer, 50% writer, 50% programmer, and 100% terrible at maths. You can read more of his articles over at Unwinnable as well as right here, friend him on Steam here or tweet him cat photos at @sezonguitar