10 ms·
For those who can't watch the video or just want a text summary: The underground 1-2 level is supposed to stop scrolling as soon as the mundane return-to-surfa
by raldi 4y ago
For those who can't watch the video or just want a text summary:
The underground 1-2 level is supposed to stop scrolling as soon as the mundane return-to-surface pipe comes onto the right edge of the screen. (Unless you're walking on the ceiling.) But because of a programming error, it keeps scrolling, revealing that the warp zone room is there.
It was originally intended to be a much more hidden secret than it turned out to be.
(This is all explained much more thoroughly yet accessibly, and illustrated much more brilliantly, in the video; I suggest you watch it when you can.)
Now for some speculation on my part.
It's unclear whether the error was missed in testing or intentionally left unfixed because they decided they liked the erroneous behavior better. But there's a bunch of evidence that warp zones were added very late in the game's development, perhaps as a last-minute change.
This includes:
* Comments in original SMB source code (revealed in the 2021 "Nintendo Gigaleak") confirm that the programmer thought they were checking if Y = 0 when deciding whether to lock scrolling for the warp zone, even though the code doesn't do that. And these subroutines are located at the ends of their files/sections.
* Each object and enemy in the game is assigned a code, and the ones used to control warp zones are assigned the last codes used in the game.
* Memory addresses assigned to warp zone control variables are at the end of their respective tables.
* The code that decides where the warp pipes take you is implemented as: "Are we in World 1-x? Then 2-3-4. Else, are we underground? Then 5. Else, 6-7-8." This indicates that the level maps were stable when the warp code was written.
- rightbyte 4y ago> But there's a bunch of evidence that warp zones were added very late in the game's development, perhaps as a last-minute change. I assumed they were for testers to quickly go to some level on a release build?
- Wowfunhappy 4y agoSurely if that was the only goal, it would be easier to have a debug menu come up when you enter a certain sequence of inputs? Among other things, getting to the warp zone still requires playing 1-1 and 1-2, and you can’t warp just anywhere. It could even only work for the P2 controller, or use inputs not normally possible like left + right simultaneously.
- gowld 4y ago> use inputs not normally possible like left + right simultaneously. Are there NES games (or mods) that have different (useful) behavior when an emulator permits such inputs?
- rdlw 4y agoIn SMB, you can brake more quickly by holding L+R, which is impossible with an original NES controller, and as such that input is not allowed in official speed runs. https://tasvideos.org/GameResources/NES/SuperMarioBros#TurningAroundQuickly https://tasvideos.org/GameResources/NES/SuperMarioBros#Turni...
- milesvp 4y agoThere’s controversy around this in the mario kart speed run community too. Apparently with snes controllers you can press L+R on the dpad if your dpad has been used enough to wear down the dpad’s plastic center pivot. What’s interesting is this created a schism bifurcating the community, and the one that allows L+R I hear is the more vibrant conmunity.
- euoia 4y agoNot NES but I seem to recall playing Wonder Boy on a master system that had a missing D-pad and pressing up and down simultaneously made Wonder Boy drop through the earth and fall from the sky.
- gernb 4y agoYou just compile a dev version of the game during development.
- NobodyNada 4y agoIt's quite common for games to have bugs or unintentional behavior when pressing left+right simultaneously. Super Mario Bros. is one example (as another commenter points out); another example is Super Metroid (for the SNES), which allows you to repeatedly wall jump in-place if you hold left+right: https://wiki.supermetroid.run/L+R_Walljumping https://wiki.supermetroid.run/L+R_Walljumping This sparked a mild controversy recently in the speedrunning community: L+R walljumping makes it possible to climb walls underwater without Gravity Suit or Hi-Jump Boots. Through the use of very esoteric and difficult speedrun tech, this enabled a runner to complete the game while collecting only 13% of available items, which would beat the previous low% record of 14% if left+right runs were allowed on the leaderboard: https://wiki.supermetroid.run/13%25_xCharge https://wiki.supermetroid.run/13%25_xCharge
- baisq 4y agoThank you, I'm so tired of 15 minute videos for something that can explained in text and images that can be read in one minute.
- cplusplusfellow 4y agoBut how else would we make $300k a year on YouTube?
- moralestapia 4y agoHa! More like $10k (or even less).
- Deletionk 4y agoWeird criticism. Video is a nice relaxing medium with video and audio. Some prefer it others prefer text, I prefer both depending on where I am. Guess what I prefer on the couch
- Semiapies 4y agoIt's actually a reasonably detailed explanation that goes beyond that summary, including into how SMB levels were represented and video breakdowns of the state changes. But TL;DR is a way of life.
- raldi 4y agoMy summary barely scratches the surface; the video gets deep into the code and the ones and zeroes. I don't think there's a wasted sentence in the entire piece.
- michaelhoffman 4y agoWhile I agree with you in general, this is actually a really well-edited video full of lots of interesting stuff about how Super Mario Bros works beyond the conclusion.
- ChrisClark 4y agoSo you know exactly how the minus world glitch works then? I didn't get that from the comment at all.
- Pxtl 4y agoI think you've glossed over the most significant bug, which is that for no apparent reason at all the Scroll Unlocker increments the Warp Zone Control value, which configures the 2,3,4 warpzone to instead function as the World 5 Warpzone. If you don't get properly into the warpzone (which triggers the proper warpzone object), this is what causes it to function as a World 5 Warpzone, whereas the other bug is the one that allows you to scroll into it through unorthodox ways. Also, the video has a lot of info about how levels are constructed in Mario in general, which I found very informative.
- coldpie 4y ago> Also, the video has a lot of info about how levels are constructed in Mario in general, which I found very informative. If you'd like a lot more on this kind of topic, check out the book "I Am Error" by Nathan Altice (published by MIT Press; don't buy from Amazon). It goes into a bunch of detail about how the NES hardware worked and how specific games used it.
- raldi 4y agoIndeed. I'm the guy he thanks at the end of the video, and the inspiration I passed along came directly from that book. This video would not exist without it.
- jvanderbot 4y agoEven better. they take Y & <some other condition that is almost always true> expecting that condition to be false only when Y==0, but it appears to be false whenever the lowest bit of Y is 0, which means for any even numbered vertical position. Fantastic! Here Y is the vertical position of Mario (0--> on top of the level). So, one bug is: there was supposed to be a scroll stop unless Mario was on top of the level. Because you can scroll the screen while not on top of the level produces the -1 level bug where you scroll Mario through to the warp zone with some junk in a certain memory location. The memory location is corrupted because they set a boolean flag with an increment operation, which of course causes an overflow instead of setting a zero to a 1. (EDIT: I misunderstood this point, see discussion below)
- NobodyNada 4y ago> The memory location is corrupted because they set a boolean flag with an increment operation, which of course causes an overflow instead of setting a zero to a 1. Huh? No, the increment operation simply changes the warp zone control flag from 0 to 1. The valid values are normally 4, 5, and 6 (since they only use the low 2 bits to index into a table, and 0 is reserved for "no warp zone") -- so 1 is treated identically to 5. Why this increment is even there is not clear at all, since the 1 should just get overwritten by a 4 later on, once the screen is scrolled all the way to the right and the warp zone is properly loaded. The only situation where this 1 has any effect is when entering the warp zone before it's properly loaded in order to go to the minus world. Given that this increment is right after the nonsensical AND, I'm just gonna guess that whoever wrote this code was very sleep-deprived :)
- LocalH 4y agoPerhaps they meant to increment another variable and typed the label or address wrong (labels back then were generally much more limited in length on the average development system, I bet that the actual name for the variable in question was nowhere near the length of WarpZoneCtrl, most likely it was limited to 6 or 8 characters). I don't know the low level logic of the engine enough to know if there is a different variable that it would actually make sense to increment in this place.
- AtNightWeCode 4y agoBugs with the scrolling exists throughout the game though. You can do wrong warps within both 4-2 and 8-4.
- synu 4y agoDo you happen to know why the minus world is the way it is? Was it a level that was designed, or is it a level where it's rendering some random program or other data? I'd love to learn more about that part too.
- LocalH 4y agoThe minus world is technically an out-of-bounds level. The game treats it at world 36-1 (since the digits are tile numbers 0-9, followed by the alphabet, then a space tile at $24 or 36). Since doing so reads a whole host of other data out-of-bounds as well, it ends up pointing at the level layout for 2-2, but without the data that properly sets the pipe destination, resulting in an infinitely-looping level. Other versions of SMB have different minus worlds (and some versions had the bug either fixed as in Super Mario All-Stars, or blocked off as in VS Super Mario Bros). Famicom Disk System version of SMB1 has a three-level minus world that ends with a Bowser fight that completes the game as if it was 8-4. The minus world is a total bug. It was not designed or intended to exist. The bug was solely the result of the INC WarpZoneCtrl instruction that the video author mentions, which makes the game treat the warp zone pipes as the 4-2 warp zone until the text appears. Remove that INC, and the game will instead dump you out as if you'd gone in the L-pipe prior to the warp zone. Obviously this bug doesn't exist at all in SMB DX for Game Boy Color, as it is a completely rewritten engine. I would presume the bug didn't exist at all in Super Mario Bros 35.
- vlunkr 4y agoIt’s pretty interesting how the game can continue to function in a level that isn’t supposed to exist. Metroid has similar areas I believe. It’s hard to imagine a modern game or any modern software handling a scenario like that without crashing.
- jaywalk 4y agoI think it's a reflection of how incredibly simplistic these older systems and games really are. Modern games bear no resemblance to them as far as level design and asset storage go.