๐๏ธ fireork12 ยท 675 points ยท Posted at 01:51:04 on May 28, 2017 ยท (Permalink)
I explain all about walls, floors, and ceilings, as well as other related topics like triangles/unit normal vectors, frames/quarter steps, Marioโs position, the sequence of a events in a frame, and out of bounds. For convenience, here are each of the topics:
00:00 Intro, Triangles, Unit Normal Vectors
02:29 Frames, Quarter Steps
03:34 Marioโs Position
04:35 Sequence of Events in a Frame
04:59 Wall Hitboxes
10:21 Multiple Wall Hitboxes
13:55 Double-Sided Walls
16:58 Clipping Through Walls
18:51 Floor Hitboxes
20:22 Ramps and Stairs
21:20 Ceiling Hitboxes
24:56 Entering Ceiling Hitboxes
26:41 Sequence of Events in a Frame Revisited
27:02 Boxes
28:13 Seemingly Vertical Surfaces
30:28 Out of Bounds
32:44 Entering Out of Bounds
34:17 Walls vs. Ceilings vs. Out of Bounds
https://youtu.be/a9fUV7uA2_s Non-Cardinal Wall Hitboxes
I consider the information in this video to be extremely important, especially when it comes to SM64 analysis (e.g. can Mario dive recover onto this box?). In fact, I've been using this information for years to help me execute strats (e.g. clipping through two walls at a corner when I have less than 400 speed) and quickly dismiss impossible strats (e.g. even if we had enough speed, we couldn't launch to above the chests in JRB since that's above a ceiling). And so now, I've finally compiled all of this knowledge into one video so that everyone has access to it. Big thanks to Tyler Kehne and Peter Fedak for assisting me throughout the research process.
Note that I've tried to make this video as simple and concise as possible, which often meant making generalizations that apply in most cases but not all. For example, I said moving into out of bounds while airborne resets Mario's horizontal speed, but this only occurs when Mario has a small positive speed or negative speed. For a medium positive speed, Mario will do a soft bonk. And for a high positive speed, Mario will do a hard bonk. So there may be exceptions to some things I say, but this was because delving into every possible case would have made the video several times longer and more complicated.
Interestingly, in the time between when I started this video and when I posted it, I've made other videos that have used information from this video, such as the hitbox dimensions and effects. Those videos even used the same color scheme in their visuals, since I had just copied the visuals from this video. But in all of those cases, I had to briefly explain the important principles beforehand, since I couldn't rely on viewers having seen the not-yet-released wall/floor/ceiling video. But now that this video is released, I won't bother re-explaining information from this video in future videos that rely on it.
Aside: I had actually started this video on May 26, 2016 (a year and one day ago). But after starting it, this video ended up becoming a much larger endeavor than I had anticipated. Indeed, the magnitude of its scope combined with how tedious the research and visuals were caused making this video to be extremely unfun. So unfun that I soon abandoned it in favor of working on other easier/funner videos instead. In fact, Iโve made 70+ other videos since then, since basically I preferred to work on any other video rather than have to finish this video. During that period, Iโd attempted to resume working on this video about 8 times, but each time I just ended up abandoning it again due to how unfun it was. During one attempt, I even tried mandating that I couldnโt work on any other SM64 things besides this video, but that just led to 3 days of getting nothing done in SM64, and so I abandoned that attempt. It wasnโt until recently that conditions aligned just right and so I was finally able to coax myself into finishing this video. The takeaway from this is that I simply cannot force myself to make a video that Iโm not in the mood to make. If I do try to force myself, Iโll just end up resisting, putting it off, and getting nothing done. Note that if this video also had to be commentated, then my resistance to making it would have increased several fold, and so it probably would have taken at least 5-10 more years to coax myself into making it. In other words, I was only able to get this video out as early as now because it was strictly uncommentated.
Saved comment
insanekoz ยท 87 points ยท Posted at 04:18:04 on May 28, 2017 ยท (Permalink)
This is fuckin rad. If you loved Super Mario 64 and care about the logic behind the physics, you've gotta watch this
๐๏ธ fireork12 ยท 51 points ยท Posted at 04:20:42 on May 28, 2017 ยท (Permalink)
Don't forget the obligatory parallel universes shit
[deleted] ยท 47 points ยท Posted at 11:03:05 on May 28, 2017 ยท (Permalink)
"an a press is an a press. You can't say its only a half"
TJ "Henry" Yoshi
Jebobek ยท 6 points ยท Posted at 21:27:39 on May 28, 2017 ยท (Permalink)
I don't understand how pressing + holding is such a hard concept. You're literally doing that to run through Mario games starting on arcade/NES.
Bwgmon ยท 66 points ยท Posted at 06:24:54 on May 28, 2017 ยท (Permalink)
something something half an A-press.
Galle_ ยท 8 points ยท Posted at 03:12:35 on May 29, 2017 ยท (Permalink)
This video finally explains why Mario always does the push animation when he's traveling to parallel universes, too.
bugybunny ยท 5 points ยท Posted at 10:35:19 on May 29, 2017 ยท (Permalink)
That what so satisfying to get the explanation for. I said โahaaaaaโ loud when he showed it and I got that.
Arctem ยท 13 points ยท Posted at 17:13:39 on May 28, 2017 ยท (Permalink)
I love the montage of game overs for doing seemingly innocuous things.
"You read a sign? Thanks for letting Bowser win, Mario."
LawRunner ยท 13 points ยท Posted at 16:49:49 on May 28, 2017 ยท (Permalink)
I love this, it's so rare to see this kind of information about how a game is built. How do people find this stuff out, anyway? Is there more of this sort of nitty gritty programming detail for other games?
homer_3 ยท 5 points ยท Posted at 19:11:52 on May 28, 2017 ยท (Permalink)
There are countless blog posts/talks on techniques people used when developing their game out there. GDC talks are probably a good place to start.
[deleted] ยท -3 points ยท Posted at 19:32:46 on May 28, 2017 ยท (Permalink)
That's because you're not browsing websites used by actual game developers. If you want to learn how games work then just visit a forum used by developers, or try to make a game. There are lots of tutorials out there.
..or you could just rely on people who don't make games to butcher the facts because they don't know what they're talking about. The wast majority of the videos I see on here are pseudo-intellectual trash that's factually wrong most of the time, so I don't recommend it. Pannen is actually pretty good in my opinion, because he at least doesn't radiate an aura of egoism like some other tubers.
turboknight ยท 8 points ยท Posted at 16:56:48 on May 28, 2017 ยท (Permalink)
If you guys find this interesting, I highly recomend watching another video from the same guy: How Holding Objects In Mario 64 Really Works. There's some great tricks that Nintendo used to keep the world consistent and items easier to manage that are really cool.
PM_ME_SPREADSHEETS ยท 24 points ยท Posted at 20:02:51 on May 28, 2017 ยท (Permalink)
If anyone plans on exploring that channel, I hope you really like that 10 second flute music loop.
๐๏ธ fireork12 ยท 15 points ยท Posted at 20:05:57 on May 28, 2017 ยท (Permalink)
It's the File Select theme, and it's the greatest thing ever
enjineer30302 ยท 5 points ยท Posted at 22:56:50 on May 28, 2017 ยท (Permalink)
Doo doo doo do doo doooooo, doo doo doo dodododoo do doooo...
terencecah ยท 10 points ยท Posted at 13:35:12 on May 28, 2017 ยท (Permalink)
Do other games have parallel universes?
Yomoska ยท 29 points ยท Posted at 15:47:30 on May 28, 2017 ยท (Permalink)
It's not parallel universes, it's number overflow caused by converting one type of number to another. Other games have it, but not in the same occurrence as Mario 64. Another famous one is Gandhi's aggressiveness in Civilization. Since he was so much in the positive end of the spectrum, anything that pushed it towards more positive would cause his personality to overflow and wrap around to the most aggressive side. Most games do min/max checking on numbers so this wouldn't happen, and maybe Mario does, but the speed at which he moves probably messes up that check.
Galle_ ยท 10 points ยท Posted at 03:15:14 on May 29, 2017 ยท (Permalink)
Gandhi's aggressiveness isn't a result of a casting error, it's a result of an underflow. Aggression in Civ 1 is an unsigned byte, so when it tries to subtract 2 (the modifier to aggression for democracies) from 1 (Gandhi's default aggression) it winds up at 255.
Parallel universes in Mario 64, on the other hand, are a result of the fact that object positions and collision detection use different data types.
Yomoska ยท 5 points ยท Posted at 05:51:08 on May 29, 2017 ยท (Permalink)
I believe all that is what I said? The bug in Mario is caused when a data type is converted to another, which causes the over/under flow and then the number wraps around to be within bounds of the collision detection.
ZeroNihilist ยท 9 points ยท Posted at 07:22:10 on May 29, 2017 ยท (Permalink)
It's not quite the same. Casting a larger numerical type to a smaller one is a change of the domain of the number, while over/underflow doesn't change the domain.
To put it another way, over/underflow is reversible if you know what's being added/multiplied/etc. while casts are not, because they remove information.
For example, with 1 byte unsigned ints we get 250 + 100 = 94, but 94 - 100 = 250 as well (I don't think there's a simple process to reverse multiplication overflow, but it is still possible).
On the other hand, I can't possibly recover the original value after a casting error; with 4 byte integers there are 65,536 values that map onto any given 2 byte integer.
So while they may seem similar (big number -> smaller number), they really aren't the same problem at all.
Galle_ ยท 1 points ยท Posted at 15:47:15 on May 31, 2017 ยท (Permalink)
No, it's not quite the same thing.
Overflow/underflow errors are like walking in a circle - if you go far enough, you wind up back where you started.
Casting errors are more like drawing a map. As long as the map is smaller than the place it's a map of, you're going to have to squeeze multiple different things into the same spot on the map.
jimmynumba1 ยท 2 points ยท Posted at 06:45:20 on May 29, 2017 ยท (Permalink)
it's overflow
and that's literally what the post you replied to said.
Galle_ ยท 4 points ยท Posted at 14:03:57 on May 29, 2017 ยท (Permalink)
The byte doesn't measure "happiness", it measures aggression. AI personalities are only on a scale of 1 to 10 anyway, so overflow errors are effectively impossible - if it was going the other way, Gandhi's "happiness" would just be set to 12, and the game would interpret that as being identical to 10.
And no, the post I replied to confused underflow/overflow errors with casting errors.
gmfreaky ยท 9 points ยท Posted at 15:26:48 on May 28, 2017 ยท (Permalink)
I have actually tried this out! It seems like Rayman 2 and Rayman Rush on the PS1 have parallel universes, although they are quite useless.
TheDobber ยท 8 points ยท Posted at 15:54:03 on May 28, 2017 ยท (Permalink)
Actually, Paper Mario does, too.
๐๏ธ fireork12 ยท 9 points ยท Posted at 14:17:23 on May 28, 2017 ยท (Permalink)
If there is, we have no way of getting to it in other games unless if we can figure out ways to build up enough speed
b0b_d0e ยท 1 points ยท Posted at 21:54:45 on May 28, 2017 ยท (Permalink)
Parallel universes have nothing to do with speed. All a parallel universe is is an out of bounds + overflow where position is stored as a float and collision is stored as a unsigned 16 bit number. A float can represent much larger numbers than a 16bit unsigned number, which means Mario's position (as a float) can be on a "wrapped around" version of the level (as a 16bit number) when you go way way out of bounds. Only reason so much speed is needed is because the game is programmed to check if Mario is out of bounds and prevent it. Other games may or may not have that check meaning you don't necessarily need to build up speed to go to a "parallel universe"
Zanford ยท 1 points ยท Posted at 21:08:46 on May 28, 2017 ยท (Permalink)
In the original Metroid, you can glitch out the edge of the normal map in a few places, and you'll find yourself in pseudorandom extra areas; some people have tried extensively traversing and mapping them out. They look sort of like mishmashes of regular game geometry, a bit like Pac Man's kill screen but not AS garbagey, and somewhat traversable.
Presumably the game's code was written in a way where it looked up map assets based on Samus's X and Y coordinates, and if you plug in X,Y values outside the normal game map, it extrapolates new terrain. You can recognize pieces of regular game geometry....like a lot of early games, Metroid extensively re-uses certain room layouts with little tweaks.
Sugioh ยท 3 points ยท Posted at 03:55:53 on May 29, 2017 ยท (Permalink)
It's actually that it's looking at memory locations outside of where map data is stored. Theoretically you could manipulate some of that for things that aren't static, but I have no idea what Metroid's memory map looks like so that might not be feasible.
Since most cartridge-based systems have the cart's data mapped in the same memory space as ram, that sort of behavior is not uncommon for games of that era.
skyman724 ยท 1 points ยท Posted at 22:20:02 on May 28, 2017 ยท (Permalink)
The original Super Mario Bros technically has 256 worlds to it, owing to how the game stores the value of the world in an unsigned byte (8 bits, 28 possible values). The unsigned part is strange considering that the most infamous of these is the "Minus World" which displays -1 as the level name, but this is because the sprite for the world name is actually a random transparent sprite, so it's more appropriate to think of it as "World Null-1".
Accessing all the other worlds is a bit complicated, as the easiest method requires a Japanese NES that loads games into the top as well as a cartridge of Tennis. This page explains the rest in succinct detail if you're interested.
shoopdahoop22 ยท 1 points ยท Posted at 03:04:48 on May 29, 2017 ยท (Permalink)
Ratchet and Clank doesn't.
HilariousCow ยท 15 points ยท Posted at 10:12:41 on May 28, 2017 ยท (Permalink)
Weird to see it's hit boxes against surfaces. I would have assumed that it's more to do with multiple swept volumes testing in the direction of the movement, from different body heights. That's how most fps games I've worked on do it - normally just to check if you can step up over geo, but occasionally to see if you can auto crouch, too.
ggtsu_00 ยท 24 points ยท Posted at 11:08:33 on May 28, 2017 ยท (Permalink)
Swept volumes are quite expensive and usually require good precision floats to evaluate with predictable results. Hit boxes, evaluated in a 2D plane of the velocity vector is significantly cheaper and be done using fixed integer math. SM64 uses short ints for physics calculations.
HilariousCow ยท 3 points ยท Posted at 11:51:25 on May 28, 2017 ยท (Permalink)
Makes sense! Yeah I wouldn't have expected swept traces here, but, didn't expect loads of hit boxes placed everywhere either? But whatever works, right?
ggtsu_00 ยท 12 points ยท Posted at 12:19:22 on May 28, 2017 ยท (Permalink)
I don't think there are actually hitboxes placed on everything, just triangles defining the world collision geometry. A collision hitbox can be calculated at runtime during collision tests per triangle on the intersection plane of the velocity vector and the triangle plane. Seems like an extension of SAT for collision response.
Cycloneblaze ยท 2 points ยท Posted at 18:13:28 on May 28, 2017 ยท (Permalink)
I've been wondering where pannen got to for the last couple months. A 40 minute video is a great return!
bugybunny ยท 2 points ยท Posted at 10:37:37 on May 29, 2017 ยท (Permalink)
Well, he released several videos. On one day even 4 at once which felt like Christmas.
[deleted] ยท 2 points ยท Posted at 10:40:13 on May 29, 2017 ยท (Permalink)
It's amazing to learn so much about a game that's over 20 years old. I wonder if any of the SM64 developers have seen any of his content.
Iwantoridemybicycle ยท -12 points ยท Posted at 05:36:35 on May 28, 2017 ยท (Permalink)
What is up with this guy and SM64? Why is he focused on it so much? Don't get me wrong I like his videos and the way he breaks down the game mechanically. But why so much?
TheSecretMe ยท 28 points ยท Posted at 12:31:34 on May 28, 2017 ยท (Permalink)
The N64 / PS1 era was a turning point where game developers had to learn to think and design around a third dimension. Which was exceedingly difficult and led to many terrible games.
Nintendo didn't just knock it out of the park on the first try, Mario64 set the bar for years to come.
Technically the game is a treasure trove of creative problem solving.
ClysmiC ยท 72 points ยท Posted at 05:44:45 on May 28, 2017 ยท (Permalink)
Because he finds it fun? Obviously he loves the game and loves reverse engineering, so he reverse engineers the game he loves
Iwantoridemybicycle ยท -47 points ยท Posted at 05:54:02 on May 28, 2017 ยท (Permalink)
Alright well whatever float your boat.
benG_boy ยท 14 points ยท Posted at 11:07:03 on May 28, 2017 ยท (Permalink)
Not sure why you got so many downvotes, seemed like a genuine question to me
SRVfender001 ยท 0 points ยท Posted at 03:55:11 on May 29, 2017 ยท (Permalink)
Yeah, I saw them as pretty innocent comments as well.
chaossabre ยท 21 points ยท Posted at 07:17:24 on May 28, 2017 ยท (Permalink)
It's among the first games of its type (3d platformer), combined with limitations of the N64 hardware meant the devs had to get really creative. He has an academic interest in understanding the challenges they faced, the solutions they devised, and how those solutions affect gameplay.
SkyIcewind ยท 44 points ยท Posted at 07:36:18 on May 28, 2017 ยท (Permalink)
Good question.
To answer it, let's talk a bit about parallel universes...
Pretygood ยท 4 points ยท Posted at 12:24:21 on May 28, 2017 ยท (Permalink)
0 . 5 A P R E S S E S
Rammite ยท 21 points ยท Posted at 05:38:59 on May 28, 2017 ยท (Permalink)
Why not? SM64 is the most popular game in existence to speedrun.
Iwantoridemybicycle ยท 8 points ยท Posted at 05:48:34 on May 28, 2017 ยท (Permalink)
But its not all about speed running. That video of him beating a stage in the least amount of A presses, he had Mario running up against a ledge for 12 hours. I'm just curious why he's so set on this game and its figuring out its mechanics.
sirmidor ยท 44 points ยท Posted at 05:52:36 on May 28, 2017 ยท (Permalink)
He's a computer science major, so I assume he just finds things like this fun. Also, his runs are TAS (Tool Assisted Speedrun), he's not sitting there himself running against a ledge for 12 hours.
yoda133113 ยท 9 points ยท Posted at 06:14:55 on May 28, 2017 ยท (Permalink)
That is a type of speedrun. Obviously not based on time, but least number of A-presses. Just like people try to get the best path for time, they also compete for A-presses.
Aquason ยท 5 points ยท Posted at 06:19:33 on May 28, 2017 ยท (Permalink)
Well it is based on time, it's just a different category than any%. He's still trying to get the best time (I vaguely remember certain "0 A Press" routes being obsoleted by faster 0 A Press routes) , just with the added stipulation of having the lowest amount of A-presses possible. It's very similar to a low%, which focuses on getting only the minimum number of collectibles, even if it would be much faster to not try to avoid them.
Rammite ยท 1 points ยท Posted at 15:42:05 on May 28, 2017 ยท (Permalink)
It's absolutely all about speed running. Literally every topic he talks about is something he or another speed runner meticulously became an expert on, and he thought (correctly) that it's be interesting enough to teach to non speed runners.
JakeTehNub ยท 1 points ยท Posted at 09:41:32 on May 28, 2017 ยท (Permalink)
How do you know that's true?
[deleted] ยท 7 points ยท Posted at 13:28:05 on May 28, 2017 ยท (Permalink)
http://www.speedrun.com/games
JakeTehNub ยท -2 points ยท Posted at 20:29:23 on May 28, 2017 ยท (Permalink)
I seriously doubt everyone who speedruns videogames goes on there
ggtsu_00 ยท 12 points ยท Posted at 10:10:14 on May 28, 2017 ยท (Permalink)
Why are so many scholars obsessed with the literary works of Shakespeare? Maybe because they were masterpieces worthy of study? What makes video game classics less worthy of study?
robertito42 ยท 1 points ยท Posted at 20:52:20 on May 28, 2017 ยท (Permalink)
Are parallel universes basically non Euclidean bugs?
Galle_ ยท 2 points ยท Posted at 03:19:33 on May 29, 2017 ยท (Permalink)
They're a result of a glitch in collision detection. Positions in Mario 64 are stored as floats, but for some reason those are converted to shorts when checking collisions. Since there's more possible float values than there are short values, some positions are effectively equivalent to each other for the purposes of collision detection.
Two-Tone- ยท 1 points ยท Posted at 04:49:23 on May 29, 2017 ยท (Permalink)
Floats are computationally expensive, so shorts would have been a performance short cut.
enjineer30302 ยท 1 points ยท Posted at 22:59:50 on May 28, 2017 ยท (Permalink)
Pannenkoek/UncommentatedPannen has some of the best videos about video games I've ever seen. Aside from the 0.5 A press meme, it's really awesome how much a 20-year-old game can be deconstructed and, for that matter, broken so incredibly.
IrrelevantLeprechaun ยท 1 points ยท Posted at 01:17:31 on May 29, 2017 ยท (Permalink)
Why do all of these things come from Mario64? Did other games not also do these exact same things? What makes it so special?
bugybunny ยท 3 points ยท Posted at 10:44:12 on May 29, 2017 ยท (Permalink)
More people are interested in it. For me, I started getting interested in speedrunning because of siglemicโs marathon in 2012. So SM64 was the starting point for me and is still the game I know most about, even though I have only played it briefly in the 90s when it came out. I guess for many other people it is, because they played SM64 for their own when it came out and the have this fascination when they see videos about it and get started with TASing or speedrunning themselves so even more people get sucked in.
Pannenkoek said himself, that SM64 was his favorite game when he was younger and he wanted to know more about it, so he started exploring it. And now pannenkoek is investing a lot of his free time to this stuff and producing videos, while other people like Tyler Kehne or Peter Fedak do a lot of work in the background and their videos (like the moot door skip last year I believe) do not get that much attention. But itโs still SM64, yeah :D
So to get back to your question: Many more people are interested and running/TASing this game than other games. So thatโs why there are so many videos about SM64.