14

I've been watching "speedrunners" play those games for quite some time. I still can't believe what my eyes are seeing. Somehow, they have managed to find bizarre bugs in the games which enable them to do things which I cannot imagine that I or anyone would ever encounter by playing the game.

I'm talking about standing at precise spots against walls and pressing keys in an exact manner to somehow cause Mario to start flying at super speed through the walls and other objects, for a long time, until he drops into some warp zone further away in the level. It looks unreal. I have real difficulty believing:

  1. That it's the original game and not some kind of modified copy. (But it actually is.)
  2. That somebody is able to reproduce these reliably.
  3. That somebody encountered these in the first place.
  4. That a game, even if 3D and thus complex, can actually contain such strange bugs.

Maybe I can understand that the collision detection code has a bug so that you can fall through certain objects or walls. OK. That makes sense.

But how can the game make Mario seemingly start ignoring all the rules of the game world and go flying (while seemingly standing) across several rooms at super speed? How does that actually happen? How does that make it into game code? And how does anyone find that, no matter how popular the game is?

Unless this entire reality has been set up just to mess with me, this is real. But I don't understand how it can be real.

I've never, even once, encountered even a minor glitch in any game while playing it. The speedrunners press the buttons and move the analogue stick around to seemingly freely warp around in the game world and do whatever they feel like. It's as if they had enabled some sort of crazy debug mode with a "Game Genie" or "Action Replay" cartridge hooked up to the console, but it's actually done on the original game, not using an emulator or modified ROM.

I simply don't understand how it can be the case.

| improve this question | |
New contributor
is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our .
  • 6
    How does anyone find it? Play a game for 25 years and you'll find stuff. There are Doom Eternal glitch runs out there already. You're assuming the coding and the rules of the game world are perfect. They're not, especially in a pioneering 3D game like Mario 64. Some of it involves the hardware and maths calculations, and imprecision there. Check this out: youtube.com/watch?v=opp0MKcNRko – Alan B 12 hours ago
  • 1
  • 2
    These things are found because of heavy, heavy user testing. – Thorbjørn Ravn Andersen 10 hours ago
  • 2
    Also, many of them take a lot of practice to pull off, 95% of speedruns are complete failures (but you don't see those ones), and some of the harder glitches are only possible in TAS mode (which is a cheat). – user253751 5 hours ago
  • 4
    As a software developer I'd like to comment on your reasoning of "...even if 3D and thus complex". Typically the more complex a piece of software is, the more likely it is to contain "strange bugs". 3D games are inherently more complex than 2D games and have more potential for glitches. – Adam Mazzarella 3 hours ago
33

3D games like Super Mario 64 and Ocarina of Time are time-step-based physics simulators. Their basic design is based on the assumption that nothing goes above a certain speed. Each frame, Super Mario 64 calculates four time steps, in which it (among other things):

  • moves Mario ¼ of the distance he's supposed to travel in that frame; then
  • pushes Mario out of any walls / floor / ceiling he's found his way inside.

There are three oversights that make this a massive source of glitches:

  • Mario doesn't slow down when he hits a wall.
  • Out-of-bounds checking only works when you're a little bit out of bounds.
  • Long-jumping only has a speed limit in the forwards direction.

This means that all you need to do is find a corner with a lot of wall behind it, long-jump away from it, hold the control stick backwards and keep sustaining that long-jump, and you can rack up lots of speed; more than enough to get very out of bounds, and break the out-of-bounds checking. (Also, at least in Super Mario 64, there's only bounds checking for regions outside the map; not regions within the map, but behind walls the level designers didn't expect to get behind.)

The game developers really didn't expect anybody to get so completely out of bounds, so everything that occurs there is an artefact of the design of the rest of the game; most of the glitchiness you'll observe there doesn't really count.

Because Super Mario 64's collision calculations use 16-bit integers (unlike the rest of the game, which uses floats), there are partial copies of the level repeated every 2¹⁶ units in the x, y and z directions. If you go fast enough, you can enter them without going through an out-of-bounds region, which has interesting effects.

Most of the other glitches are due to synchronisation issues:

  • A crate can be picked up for a couple of frames without stopping the despawn timer, causing Mario's hands to point to uninitialised memory that's later populated by the next item to spawn.
  • Once activated, a text box will wait until you're on the ground before showing, but if you jump just after it's activated and fly away, you can get it to show (and run the associated code) in a completely different part of the level, letting you trigger bits of the level's scripting out of order.

Certain code is keyed off animation states, so being in an unexpected animation state can suppress its execution; e.g., the “fell in lava” animation can't run during the “sliding” animation, and the “lose health” script is keyed off the “fell in lava” animation, meaning you can slide across lava without losing health.

I'm not sure of the details of Ocarina of Time, but since it uses almost the same engine I assume most things are the same.

| improve this answer | |
6

The short answer is: These games are built on code which is supposed to simulate the laws of physics, at least for motion. But they are also games, which means that that code has to run fast enough for the game to be playable. To do that on the original hardware (which, after all, cannot run arbitrarily fast like nature does), the code author had to take short-cuts in the physics simulation. Those short-cuts cause side-effects which are not necessarily obvious (especially to a developer under pressure to get the product out now). People who play the games often enough and with enough variation in action eventually stumble on those side effects - and occasionally they are exploitable.

| improve this answer | |
New contributor
is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our .
  • Technically, at least according to our current theories of physics, nature doesn’t run “arbitrarily fast” either. Rather, results are “processed” in an extremely decentralized way (every interaction is handled at the place of the interaction without intervention by a central authority), and then the results of that interaction are propagated to the rest of the system at some finite speed (at most c), with the propagated result causing cascading interactions at each other element in the system it encounters. – KRyan 1 hour ago
5

You probably don't encounter these glitches because you play the game as the developers intended.

In Oblivion you can pickup plates and stuff to move or throw (which is the intended use), but if you place the plate below yourself while holding, you could jump on it making you and the object move up and then you could jump on it again and again (which kinda makes your fly). But in real life you would never try to jump on a plate you holding below yourself, so why would you in the game.

It probably helps if you know some programing, but this behavior kinda makes sense from a programming point of view. So knowing what kind of mistakes people can make while developing a game, and just trying lots of random stuff. You will probably find a few glitches in any game.

Lots of retro games can now also be simulated on the computers, which give the users lots of tools to find these bugs easier.

IGN has videos of developers responding to speedruns, they sometimes explain what went wrong in development for the glitch to happen. Or Stryder7x has videos in which he explains glitches in Mario the thousand year door.

| improve this answer | |
New contributor
is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our .
  • Yeah. OP has never encountered even a minor glitch in a game – I bet they haven't played Oblivion or Skyrim, or any other Bethesda game! – tobiasvl 31 mins ago
4

A good way to think about it is to consider board, card and tabletop games:

A board game has rules: who goes first, what happens when you land on a space; and state: whose turn is it, where the pieces currently are, how much each player has. So does a card game like Magic the Gathering, and a tabletop role-playing game like Dungeons & Dragons has a lot more.

Do these games have glitches too? They do, in a manner of speaking! What is a glitch? Let's say it's a vastly unexpected interaction that comes about because of some combination of states according to the rules of the game.

(Let's discount non-repeatable glitches that come about by freak specific circumstance. Knocking over the board, stealing money, pulling out the cartridge...)

If there was some quirk of the rules in Monopoly that, if strictly followed, meant that a player could take infinite turns, or collect $200 GO money every turn, that'd be a glitch. Dungeons & Dragons is vastly more complicated than Monopoly - by 'some interpretation of the rules', a super-powerful character like Pun-Pun can be developed. This and similar characters are made by looking at the rules of the game, coming up with some assumptions about how the model of the game works, and finding through trial-and-error or exhaustion the limits where the rules no longer apply. Look at the conditions you have to follow to make that character - doesn't it resemble the totally weird sets of button presses and conditions the player has to input to execute a Super Mario 64 glitch technique?

The RPG and Board & Card Games Stack Exchanges are all-but dedicated to the resolution of unusual cases and combinations of states and rules within games like this.

The 'advantage' of these non-electronic games above computer games is that the rules are being interpreted by humans. Humans have the advantage of understanding the context of the world, and can be flexible with the rules - every non-electronic game is played by mutual agreement and understanding of the players involved. If the rules listed a human player character's standard running speed in miles-per-second instead of miles-per-hour, you'd understand that it was a mistake and perhaps a misprint, unless they were The Flash. If a rule is blatantly unfair or unrealistic in context, even by design, you can strike it out.

The glitches of Super Mario 64 are more striking compared to a tabletop game because everything happens in real-time: resolution of the rules is automatic and instant, and the rest of the game continues as normal around it. There's no referee to appeal to - if 'the rules' say Mario can do it, and XYZ happens as a result, that's what happens.

How are things like this found? By accident, through observation and repetition. In video games there's also a sneaky way that we don't (yet) have in real life: examination of the code.

It's like a scientific discipline - when something unusual happens, you construct a mental model of what is happening and why, what the rules and state are and how they're represented, attempt to repeat the conditions you've laid out, and ultimately determine the conditions by which something does and doesn't happen. The game Super Mario 64 is an imperfect realisation of the intended design, either through compromise or error.

Why would 'the rules' be wrong with respect to the intent?

A perfectly stable game would have the following properties.

  • The model considers every possible interaction of every possible set of objects under all circumstances.
  • There's a sensible response to each of these circumstances.
  • It's impossible to violate the assumptions built into the model.
  • The model is an accurate description of the intended simulation.

When one of these conditions isn't met, your simulation won't match your expectations, and you'll have a glitchy game.

If you're already carrying an object, can you pick up another? What if you're sliding down a ramp while crouched and collide with a Wing Cap? Does collision still apply during the 'putting the hat on' animation? What happens if you get hit while opening a door? Is there a maximum speed if you continue move using a specific maneuver? Somebody has to think of all these things. If a limit isn't explicitly established, it doesn't exist. It might implicitly be bounded as a consequence of other rules, but if those rules can be evaded, then speed, location, score, lives, time are all up for grabs.

The N64 doesn't use floating-point, and it wouldn't be truly accurate even if it did. The fixed-point units used in the simulation represent the units of length, speed and acceleration into discrete increments. It's an imperfect representation. It looks nice to play because these increments are small enough to simulate smooth motion and friction, but the density of these increments comes at a cost of range. In the dumb, mechanical world of the CPU, large values wrap over to large negative values. These values are then combined with other values in certain circumstances, which may mean that Mario can interact with certain parts of the world and not others.

In the early 3D era, which Super Mario 64 certainly was, there's no tested engines to build off. Everything was made completely from scratch, such as the definition of the world, and everything inside it. This even includes some basic math operations, like finding the distance between two points and the direction perpendicular to a surface. These routines will also have their limits due to the ranges used. Calculating anything in 3D uses multiplications. Multiplying two numbers in fixed-point gives a result with the combined precision of both, at the cost of range.

Being complex and 3D means it's considerably more likely to have strange interactions, not less!

| improve this answer | |
  • "In video games there's also a sneaky way that we don't (yet) have in real life: examination of the code." - quantum computers? – John Dvorak 35 mins ago

Your Answer

Dewsnap is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.