19 votes

Super Mario 64's invisible walls explained once and for all

8 comments

  1. [2]
    wirelyre
    Link
    Summary Super Mario 64 has "invisible walls" which obstruct Mario. They're caused by the physics engine and minor errors in the level geometry: Physics is calculated using 16-bit integer...

    Summary

    • Super Mario 64 has "invisible walls" which obstruct Mario.
    • They're caused by the physics engine and minor errors in the level geometry:
      • Physics is calculated using 16-bit integer coordinates.
      • Some static level geometry doesn't correctly cover all physics coordinates.
      • Lots of dynamic geometry (moving platforms) rounds strangely to physics coordinates, leaving small holes.

    Specific causes of invisible walls

    • Geometry with no drawn texture (a real invisible wall)
    • Ceilings with no floor above
    • Edge of the game course (intentional)
    • Vertex coordinate rounding leaving holes
    • Floors incorrectly making holes in other floors

    Bonus information

    • Whether a physics triangle is wall, floor, or ceiling is decided by its normal vector. These three kinds of triangles behave completely differently.

    • Most invisible walls are super thin because they're rounding errors. This means that it's very possible to go straight through them, since the physics engine will never register that they've been hit. In fact, they often don't cover contiguous horizontal areas.

    • There isn't necessarily geometry at the edge of a stage. Mario simply isn't allowed to be anywhere unless there's a floor below him. For stages he can fall off, there are death planes far below which are valid floor (so he can yolo out into space) but which kill him if he gets close. If Mario moves out of bounds, he's pushed right back in. And if he's still out of bounds, he dies immediately.

    • Mario's hat disappears if he manages to sneak out of bounds (and then instantly dies). Every frame, his hat is removed, then his position is checked, then it's put back on.

    • "Parallel universes", used in TASes, happen because of physics rounding too. When Mario interacts with floor geometry, his position is clamped by taking the least significant part of his horizontal coordinates. This means that if he can get really far away from a stage, he can still stand on things; it's like there's loads of copies of the floors at horizontal intervals in space. But in order to get there, he has to travel unfathomably fast — around 4 times the maximum stage size per frame.

    11 votes
    1. Macil
      (edited )
      Link Parent
      The really major detail is that the collision boxes of ceilings (downward facing surfaces) extend infinitely upwards until hitting a floor (upward facing surface) above it, in order to prevent the...

      The really major detail is that the collision boxes of ceilings (downward facing surfaces) extend infinitely upwards until hitting a floor (upward facing surface) above it, in order to prevent the player from ever getting inside of large objects, but walls (vertical surfaces but critically also nearly-vertical steep surfaces) do not block a ceiling's hitbox from extending upwards like floors do. Because of this oversight, anywhere in the game where you have a ceiling with a steep not-quite-vertical wall above it is likely to be leaking a thin strand of the ceiling's hitbox above it. There are about a half-dozen places in each level that do this. However, usually the leaked ceiling hitboxes are only a single unit (~1cm) wide with gaps, and the game's collision detection frequently fails to register collisions between the player and such a thin surface depending on the player's speed, so many invisible walls would only be hit at a fraction like 1/8 of passes. If you move slowly or along an invisible wall then it's much more likely for you to hit it.

      5 votes
  2. [3]
    teaearlgraycold
    (edited )
    Link
    I watched most of this video, skipping through the enumerative sections. It’s funny. Now I have to wonder how I played through SM64 without constantly encountering these issues! It feels like the...

    I watched most of this video, skipping through the enumerative sections. It’s funny. Now I have to wonder how I played through SM64 without constantly encountering these issues! It feels like the unit-sized invisible walls are everywhere.

    Also, I feel like pannenkoek may be one of the people most knowledgeable about this game’s engine, probably beating out many of the original programmers. His in-engine visualizations are amazing and instantly show you this abstract concept very concretely.

    5 votes
    1. puhtahtoe
      Link Parent
      Another contender for most knowledgeable about this game is Kaze Emanuar. He has gone through the SM64 code and rewritten sections of it to do things that seem like they should be impossible with...

      Another contender for most knowledgeable about this game is Kaze Emanuar. He has gone through the SM64 code and rewritten sections of it to do things that seem like they should be impossible with the engine.
      https://youtu.be/t_rzYnXEQlE

      I highly recommend his videos if you're into this kind of stuff. Most of it is way over my head but it still fascinates me.

      4 votes
    2. Macil
      Link Parent
      Watching him show all of the invisible walls made me remember I actually had run into a few of them as a kid. I remember trying to jump over the sliding chest on the ship in Jolly Roger Bay and...

      Watching him show all of the invisible walls made me remember I actually had run into a few of them as a kid. I remember trying to jump over the sliding chest on the ship in Jolly Roger Bay and getting glitched downward into it once and damaged. I remember thinking some of the mushrooms on Tall Tall Mountain were off-limits because I bounced off the air above one once, and I was mildly confused later when I realized I did have to go to it and figured I must have been remembering a different off-limits mushroom or that maybe some of the mushrooms were off-limits during the early stars. I remember climbing the wire ceiling in Hazy Maze Cave and falling off just barely on the platform with the item box and assuming my held B button was registered as being up. I remember riding a turtle shell on Shifting Sand Land and bonking out of nowhere on the quicksand and dying in it. I remember having some brief unexplainable difficulty in doing the jump after the blowing wind at the top of Cool Cool Mountain and falling all the way down.

      I specifically remember having thoughts a couple times that I considered superstitious at the time like "I hit something I didn't see and fell down several times when I did an easy slow backflip or sideflip to try to get over, maybe I should try jumping at it directly with more speed to get through and spend less time in the problem area" which it turns out this video has explained was exactly right (you're more likely to collide with unit-wide ceiling hitboxes when your horizontal movement is slower). It's fascinating to understand the bug in detail now and to compare it to my previous understanding of it.

      3 votes
  3. [2]
    CptBluebear
    Link
    This is the guy that made the video about parallel universes, which was a great video about the layers within the game and how to manipulate movement within Super Mario 64. Highly recommend it, it...

    This is the guy that made the video about parallel universes, which was a great video about the layers within the game and how to manipulate movement within Super Mario 64. Highly recommend it, it was memed to hell and back for a reason.

    3 votes
    1. teaearlgraycold
      Link Parent
      That video actually caused pannenkoek to have something of a nervous breakdown. He stopped posting videos on his channel for years because he’d put so much more effort into the parallel universes...

      That video actually caused pannenkoek to have something of a nervous breakdown. He stopped posting videos on his channel for years because he’d put so much more effort into the parallel universes video than normal and was caught between the desire to meet all of his new subscribers’ expectations and the need to return the channel to business as usual. So he actually made a second channel, pannenkoek uncommentated, where he posted short videos for a few years without any voice overs.

      I’m glad that he’s righted himself. He’s really good at what he does.

      3 votes
  4. Macil
    (edited )
    Link
    All the clips of players running into bugs right after he fully explained them are hilarious. I kind of want a highlight video of just these parts. One of my favorites is the first one at...

    All the clips of players running into bugs right after he fully explained them are hilarious. I kind of want a highlight video of just these parts. One of my favorites is the first one at 1:28:20-1:30:20 (https://youtu.be/YsXCVsDFiXA?t=5300). There's also a big series of clips from 2:08:48 to 2:14:06 (https://youtu.be/YsXCVsDFiXA?t=7728). And at 2:25:32 to 2:27:46 (https://youtu.be/YsXCVsDFiXA?t=8732). And at 2:28:45 to 2:29:17 (https://youtu.be/YsXCVsDFiXA?t=8925). And at 2:34:35 to 2:35:16 (https://youtu.be/YsXCVsDFiXA?t=9275). And at 2:41:11 to 2:41:55 (https://youtu.be/YsXCVsDFiXA?t=9671). And at 3:10:04 to 3:10:42 (https://youtu.be/YsXCVsDFiXA?t=11404). And at 3:17:20 to 3:17:50 (https://youtu.be/YsXCVsDFiXA?t=11840). And at 3:21:09 to 3:22:00 (https://youtu.be/YsXCVsDFiXA?t=12069). So many of them are a perfect comedy of errors of real player mistakes mixed with the player getting finished off by a bug we just saw the full explanation for, which from their perspective looks like they just got randomly smited by the game.

    I only just noticed that the video has the live chat replay available on the side. It's funny seeing everyone's reactions to these clips. "I would quit Mario and leave forever if that happened to me" "Miyamoto apologize to this man" "this explains everything" "these mushrooms ruined my childhood" "Nintendo owes us reparations" "this video premier is still going??" "I love how these super-detailed scientific explanations get paired with pure gamer rage" "​​jesus christ they are EVERYWHERE" "this is like a whole masters degree in mario"

    3 votes