Super Mario Bros. Glitch Levels Explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2022
  • Why do glitch levels in Super Mario Bros. look the way they do? And how are levels stored in the game's ROM anyway? It's all explained right here.
    CORRECTION
    At 11:20, The brown block and horizontal pipe are swapped--the pipe should have index 1001 and the brown block should be 1010.
    LINKS
    Twitter (updates): / retrogamemechex
    Patreon (support): / rgmechex
    SubscribeStar (support): www.subscribestar.com/rgmechex
    Discord (discussion): discord.rgmechex.com
    Cohost (updates): cohost.org/RGMechEx
    INLINE LINKS
    Part 1: • Access Glitch Worlds i...
    Part 2: • Exploring Glitch Level...
    Animation of Every Level Being Loaded: • Super Mario Bros. Leve...
    Maps of all Levels: rgmechex.com/tech/smb1levels/
  • เกม

ความคิดเห็น • 448

  • @RGMechEx
    @RGMechEx  ปีที่แล้ว +101

    Here's a link to the video with the full playthrough of the game! th-cam.com/video/1whju31WAPA/w-d-xo.html
    You can support the channel on Patreon here: patreon.rgmechex.com/

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +4

      0:50 The moment I saw this, I realized all this could be prevented with "AND #7". And yet the programmers chose not to. They had some major cajones (or desperately needed to save the two bytes required to bounds check) to leave that out.

    • @neb_setabed
      @neb_setabed ปีที่แล้ว

      5:38 1 kilobyte equals a thousand bytes not 1024. You're thinking of a kibibyte actually

    • @Hue_Sam
      @Hue_Sam ปีที่แล้ว

      Now make another note on the follow up video explaining all the possible level numbers you can increment to.

    • @Hue_Sam
      @Hue_Sam ปีที่แล้ว

      @@neb_setabed computer term

    • @EebstertheGreat
      @EebstertheGreat ปีที่แล้ว

      What font do you use for your videos? It seems like it was designed to look monospace, but with a couple of clever tricks to increase readability, like a ligature for a comma-space that is just one character wide. Did you make it yourself?

  • @MrCheeze
    @MrCheeze ปีที่แล้ว +920

    The fact that pipe warps have a check for what world you're in is interesting, that explains why in every single glitch level I've ever seen, there has NEVER been a pipe transition that successfully takes you to a different level.

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +112

      Case in point: -1 which is identical to 2-2 but is unbeatable because the pipe just brings you back to the beginning.

    • @quinn7894
      @quinn7894 ปีที่แล้ว +91

      In Kosmic's series of glitched worlds, the first time a pipe took him do a different level was in something like 1-111. There was probably a warp sprite that just by chance only occurred when it's world 1.

    • @Enlightenment0172
      @Enlightenment0172 ปีที่แล้ว +16

      Sections of levels are reused between others.
      Thus, a warp pipe is always a warp pipe (1-1 being an exception)

    • @mr.missingno.9884
      @mr.missingno.9884 ปีที่แล้ว +8

      ​@@MarioFanGamer659 Actually it's 7-2

    • @ijljil
      @ijljil ปีที่แล้ว

      1-× is 19 code of world in rom

  • @GreyWolfLeaderTW
    @GreyWolfLeaderTW ปีที่แล้ว +82

    And what made this even more hardcore is the fact that Shigeru Miyamote and his team had to design levels by hand on graph paper, then manually enter in the bit registers for every BG, BG theme, tile data, and object data for each level into their source-code editor while paying attention to the rules of the programming logic they had written to avoid lockups, crashes, and glitches, and then compile the game and run it to playtest it.
    At the time, there were nearly no game development tools available to allow on the fly level editing or playtesting without having to recompile the whole game.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +13

      No emulators either, including the fancy devices we have now that emulate a cartridge. Each test attempt had to be written to EPROM, which took a while!
      They must have been relieved when FDS came along and they could use disks to quickly load from for testing, even if the final game only used ROM.
      I know they even made a SNES floppy disk drive for development - not related to the CD-ROM drive that would later become the PlayStation; this was for internal use only. Some of the leaked Super Mario Kart code uses it to run a level editor. Even some N64 games used the 64DD as a debug tool long after it was cancelled.

    • @SpaceCat712News
      @SpaceCat712News 6 วันที่ผ่านมา +1

      *That's the original Paper'a Mariooooooo !!!*

  • @wernerderchamp
    @wernerderchamp ปีที่แล้ว +438

    As a programmer myself, I am pulling my head in front of those who developed this format and the loading routine.
    All these edge cases create a lot of branches in the code, making the routine really complex.
    Crazy to think of these times where ROM was so expensive you had to play such tricks.
    I wished the video would have gotten more down to the reasons these levels crash.

    • @sweetypuss
      @sweetypuss ปีที่แล้ว

      probably the same reason that creatures like the liger and zedonk are unable to reproduce; they were never meant to exist in the first place

    • @darren8453
      @darren8453 ปีที่แล้ว +32

      Back in the days before speculative execution made this kind of thing too expensive.

    • @watchm4ker
      @watchm4ker 7 หลายเดือนก่อน +18

      Not just ROM. This predated the memory-mapper chips that defined what NES-era games looked like. Even if it was affordable, there wasn't a means of addressing more than 32 + 8 K of program/object data.

    • @algotkristoffersson15
      @algotkristoffersson15 4 หลายเดือนก่อน +1

      @@darren8453what is speculative execution and why?

    • @darren8453
      @darren8453 4 หลายเดือนก่อน

      @@algotkristoffersson15 modern cpu performance is more or less defined by the ability to find work that can be done, to keep the instruction pipelines full. Long pipelines mean less work done at each stage, meaning breaking up the longest running instructions into smaller steps and so allowing the clock speed for all operations to be increased.
      Instructions start at the first pipeline step and are delivered to the next step on each cycle. But in order for this to execute instructions efficiently you need to find lots of work to do on each cycle, as the latency to execute each individual instruction is 20 cycles. This becomes harder at the point of a condition or branch, as it is unknown which set of instructions to start adding to the pipeline next.
      Modern cpu design uses a lot of prediction to allow the cpu to try and schedule work. This prediction takes advantage of various locality correlations in code - branches tend to be mostly taken or mostly untaken and the processor can track this.
      If the cpu guesses correctly, it has done a set of work ahead of time and can carry on. If incorrect, it has to remove the instructions from the pipeline (they are tagged and tracked) and return the processor to an earlier state to take the alternative path. This "pipeline flush" work is very expensive and results in no useful work done during this time.
      This is speculative execution, and in especially branch heavy code it struggles to get every decision right. The code mentioned in this video would not be written today, mostly for that reason.

  • @QuintusCunctator
    @QuintusCunctator ปีที่แล้ว +462

    This level encoding is a masterpiece of engineering, and is "living" proof that real art is born from limitations. 2k of ram, 32k of data... What the programmers and game designers were able to do within these constraints is staggering. Thank you for explaining this!

    • @intron9
      @intron9 ปีที่แล้ว +2

      Pfft

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +72

      The most impressive part here is that SMB1 is a full game and not a minigame as many other games were around its time but also exists on a vanilla cartridge (i.e. no MMC, no extra RAM). Even as an arcade game (given that lives, score and hard mode are a thing), it still would be one of the more complex ones due to the variety of levels here.

    • @ecernosoft3096
      @ecernosoft3096 ปีที่แล้ว +18

      How about Atari 2600 specs? 128 *BYTES, NOT KILO-BYTES* of RAM, 4K of ROM.... Made a fully functional platformer!

    • @kargaroc386
      @kargaroc386 ปีที่แล้ว +4

      @@MarioFanGamer659 you mean *most* games of its time.
      Lots of games (most?) were still either conversions of arcade games, or were original but mimicked arcade mechanics. And arcade games tended to be minigames.

    • @algotkristoffersson15
      @algotkristoffersson15 4 หลายเดือนก่อน +1

      @@kargaroc386the defenition of a minigame is “a smaller game included within another game” not “a game based around obtaining a high score” therefore it is completely impossible for an entire game to be a minigame.

  • @JamieStuff
    @JamieStuff ปีที่แล้ว +72

    Having been an assembly language programmer in the 8-bit era, I am truly amazed at how great the true masters were at cramming so much stuff into so little memory. Boundary checking? 5 wasted bytes, and we can't spare the CPU cycles, either. Use a lookup table; who cares if level 33 points to the executable program? You can't legitimately get there anyway.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +14

      Yeah, and it made glitches so much more fun.

    • @komos63
      @komos63 9 หลายเดือนก่อน +7

      If only modern games were made like this...

    • @somenameidk5278
      @somenameidk5278 2 หลายเดือนก่อน +2

      @@komos63modern games (particularly AAA ones) do tend to still be a lot more like this than most software, because squeezing out as many FPS as possible makes the game genuinely better for players with less than cutting-edge hardware.

  • @JoeMecca
    @JoeMecca ปีที่แล้ว +607

    As a kid, i always wanted to make my own Super Mario Bros. levels. It seemed so simple in my mind, and you almost nailed the concept i had with level storage back then (and 10 year old kid-me was frustrated at the lack of easy tools to do so). Watching this video makes so much sense to me why the reality is that was so much harder to achieve, and why there is a base level of understanding of the game's engine required to make a custom level. Really great video (and series) as always!

    • @pleasebcool2006
      @pleasebcool2006 ปีที่แล้ว +26

      how did you comment 2 days ago if this was uploaded 2 seconds ago?

    • @RGMechEx
      @RGMechEx  ปีที่แล้ว +112

      Patreon and SubscribeStar supporters get to see the video a few days early.

    • @pleasebcool2006
      @pleasebcool2006 ปีที่แล้ว +14

      @@RGMechEx ohhh i see

    • @araigumakiruno
      @araigumakiruno ปีที่แล้ว +33

      i used to draw whack SMB levels in graph papers.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +10

      @@araigumakiruno I drew my own in church haha

  • @DisturbedValidity26
    @DisturbedValidity26 ปีที่แล้ว +145

    If you're wondering how you can bump blocks when everything is on a fixed grid, there is a trick to it. First you delete the tile from the tile map, replace it with a sprite with the same tile image and animate the bump. Then at the end of the animation, you remove the sprite and if the tile object is not destructible, put the original tile back into the tile map.
    The book "I Am Error" also covers the SMB1 level format (along with a lot of other NES stuff). Recommended.

    • @BagOfMagicFood
      @BagOfMagicFood ปีที่แล้ว +16

      That's also why the Emerald Framers in Adventures of Lolo lose a color while you're pushing one.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +23

      This is why in Super Mario World, there can only be four spinning blocks at once. Hitting one replaces the solid block with a spinning one and adds its coordinates and frame counter to a queue. When the frame counter reaches zero, it's replaced with a solid block again. Adding a fifth block to the queue removes the oldest one.

  • @brightblackhole2442
    @brightblackhole2442 ปีที่แล้ว +28

    19:18 i knew it! peach was actually toad in disguise the whole time!

  • @nankinink
    @nankinink ปีที่แล้ว +100

    That animation going through the level is insanely helpful. All the concepts covered are well explained but kinda hard to visualize in practice since so much is happening at once, the animation clears all that at once. It's really really well put!

  • @MaxOakland
    @MaxOakland ปีที่แล้ว +41

    I’m making a Super Mario Bros ROM hack and I’ve learned so much about the crazy stuff behind the scenes of SMB. SMB feels like it’s one of those facade houses. Only the parts we see work the way you’d expect

    • @ItsHyomoto
      @ItsHyomoto ปีที่แล้ว +5

      I often tell people what you *see* and what you *do* are not the same thing. The naive approach is to mirror reality, but that's rarely most performant or helpful. All video games are lies, there is no Mario. So, when programming games, what you do is lie convincingly.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +7

      @@ItsHyomoto Super Mario Bros 3 is a stage play, both in its theme and in the fact that all games are.
      Modern engines even call the objects "actors" and the levels "scenes". Everything is just behaving according to a script, playing its role.
      It might sound a bit obvious and/or vague, but that mentality can help when designing the actors. Maybe you want a monster that, when its HP is zero, it still doesn't die until hit one more time? If you approach it as a simulation, you might have coded something like "when anything reaches zero HP, kill it", which would make that case difficult. If you approach it as a play, you'd probably code each monster to do "if my HP is zero, I should switch to my death animation", making it much more flexible.

    • @ItsHyomoto
      @ItsHyomoto ปีที่แล้ว +3

      ​@@renakunisaki My favorite example is just a player object. The player is the person sitting at the keyboard or gamepad, the actor in front of them is just a collection of 1s and 0s. The only reason they associate with it is because when they press left on the controller it moves.

    • @spacebibba8984
      @spacebibba8984 ปีที่แล้ว +1

      Generally, in computer science you head for a model which fulfils the requirements it has to - which is usually not the "human way of imagining things".
      You want 8 worlds? Have a list of 8 numbers as IDs. Accessing the 9th one is not accounted for because it doesn't have to - the game never will do that.
      You could check for this and handle it nicely, if somebody tries to load world 9, but this takes up the scarce space on the cartridge and as far as your model (-> game) is concerned, loading world 8 will never happen naturally, so why bother?
      Of course, this is not resistent to bugs and enables glitchy levels like this (instead of giving nice error messages) - but for the usual player, it's perfectly fine and sufficient, while using less memory than a "safer" more extensive style with more checks in place, which do not benefit the player or game at all.

  • @invalid_user_handle
    @invalid_user_handle ปีที่แล้ว +45

    Honestly, I'd like to see that final animation applied to the fully-glitched levels, considering their broken data...
    Or we could even see _why_ these crashing levels do so, and possibly try and remove what causes the crash to see their true appearence.

  • @SwizzleDrizzl
    @SwizzleDrizzl ปีที่แล้ว +79

    I don't know why, but the original mario game has always fascinated me. i guess it's the way retro games work, but i've watched a bunch of videos on this game and it never gets any less fascinating

    • @LeviathanRX
      @LeviathanRX ปีที่แล้ว +9

      It was a marvel of coding done with limited resources in a time when video games were seen as bad. Such a legendary work.

    • @MaxOakland
      @MaxOakland ปีที่แล้ว

      Me too. Have any links to other good videos?

    • @aceae4210
      @aceae4210 ปีที่แล้ว +2

      @@MaxOakland displaced gamer has some videos on the coding logic of SMB1 and some of the other nes games (+ going into the all stars collection as the SNES and NES have the same asm but with 16 bit and 8 bit systems)
      NES Scrolling Basics featuring Super Mario Bros. - Behind the Code
      is the first video and
      New Discovery for Minus World in Super Mario Bros! - Behind the Code
      for the second video on SMB

    • @watchm4ker
      @watchm4ker 7 หลายเดือนก่อน

      With no hyperbole, Super Mario Brothers is the most complex 'official' game for the Famicom *under its original specs.* Virtually every game since then - including SMB2 (Lost Levels) used hardware upgrades on the cartridge or the FDS to expand the amount of usable program and graphical space.

  • @JamieVegas
    @JamieVegas ปีที่แล้ว +12

    In official Nintendo parlance, level "screens" are called "pages". Screen is the physical screen. The high bit of the second byte is the page flag. What we call "pixels" are dots, as pixels are a physical thing on a physical screen. Screen and pixel are physical. Dot and page are logical. What are sometimes called 8x8 tiles are "characters". What we call "sprites", which Sega uses, Nintendo calls "objects." That is why the sprites are in OAM (object attribute memory) and the background tiles are the "name table", short for character name table.

    • @algotkristoffersson15
      @algotkristoffersson15 15 วันที่ผ่านมา

      Why are they calling things stuff that literally no-one else calls them?

    • @JamieVegas
      @JamieVegas 14 วันที่ผ่านมา

      @@algotkristoffersson15 Because they are professional engineers, not kids on the Internet. "object" was in use for a long time before "sprite." "Character mode graphics" is the proper term in use for a long time.

  • @Purpie_Slurpie
    @Purpie_Slurpie ปีที่แล้ว +36

    I have such an enormous level of awe and admiration for the folks behind earlier game design. The creativity which with they were able to execute their ideas in such harsh restrictions is incredible. It may be a silly sentiment, but I think present day designers would benefit from that inspiration. We have so much free space to work in now that it often feels like it's being squandered. Of course, that's just from a lay person's perspective though

    • @ariastroke9692
      @ariastroke9692 7 หลายเดือนก่อน +2

      Nah, you're right. How big games are now feels unnecessary and people keep saying it's justified because you spend 150+ gigabytes on textures alone.

    • @nikkiofthevalley
      @nikkiofthevalley 4 หลายเดือนก่อน +1

      ​@@ariastroke9692And a lot of the time the reason why those textures take up so much space is because they're all gigantic uncompressed 4K textures that just aren't needed on most systems. If someone wants those textures, distribute them separately as a free DLC, so the people who don't want them don't have to download a bunch of textures that are never going to be displayed.

  • @EebstertheGreat
    @EebstertheGreat ปีที่แล้ว +10

    19:14 OH! So this is why you can kill generated bullet bills with a koopa shell but not bullet bills that come out of launchers. They had to share a slot with cheeps.

  • @jarrod752
    @jarrod752 ปีที่แล้ว +35

    I think how the small and big castle are the same but encoded into 2 different bytes blew my mind. I always recognized the small castle on the big one, but didn't realize they were the same object under the hood.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +5

      The fact that the big castle is just the small castle extended down, with extra bits added to the sides, is what got me.

    • @ewetwentythree
      @ewetwentythree ปีที่แล้ว +1

      Whenever I accidentally make the small castle big during level editing (by moving it above the ground) I am absolutely disgusted each and every time

  • @kaukospots
    @kaukospots ปีที่แล้ว +83

    I would love to see an analysis on how they improved all these mechanics in SMB3

    • @MaxOakland
      @MaxOakland ปีที่แล้ว +1

      Need Mario 2 first!

    • @Rocket_Gunner7414
      @Rocket_Gunner7414 ปีที่แล้ว +2

      @@MaxOakland uh lost levels is very VERY similar

    • @Nightcaat
      @Nightcaat ปีที่แล้ว +6

      @@Rocket_Gunner7414 They’re probably referring to Super Mario USA

    • @Rocket_Gunner7414
      @Rocket_Gunner7414 ปีที่แล้ว +4

      @@Nightcaat yea But that's not really a mario game

    • @Nightcaat
      @Nightcaat ปีที่แล้ว +14

      @@Rocket_Gunner7414 It was worked on by the same software division as Mario 1 and aside from Doki Doki Panic lacking a run button, it controls just like you’d expect a Mario game to. I wouldn’t write it off as not a Mario game

  • @HBMmaster
    @HBMmaster ปีที่แล้ว +21

    oh this is excellent. everything I could have asked for for a video about this topic

  • @ClassicGameSessions
    @ClassicGameSessions ปีที่แล้ว +36

    Great details of how they achieved level design with these familiar sprites from the 8 bit days. I've played a lot of Mario brothers and often wondered about some of the underlying methodology - very interesting to see it explained here!

  • @MarioFanGamer659
    @MarioFanGamer659 ปีที่แล้ว +22

    I already was guessing how the game loaded its level data (i.e. only a portion of it) and some of the other stuff also came into my mind when I was experimenting with Brutario (a WIP SMAS:SMB1 level editor). The queuing system is also interesting (which, in hindsight, is actually natural due to the objects' shapes) and also explains the existance of the level foreground pattern but damn, I didn't expect it to be _this_ strict.
    A lot of the ideas has been transplanted into later games, albeit in a cleaner way. The object compression (i.e. compressing a level data) is the biggest giveway but even in the details, there still are things which are mirror SMB1. SMW, for example, only uses three bytes per object (which, among others, has to do with the fact that objects now keep track of both sizes instead of just one) with the only exceptions being the level destination (which is four bytes) but it still doesn't have an X position high byte (unless it's a vertical level in which case there is no Y high byte) and makes use of the next screen flag as well as the screen skipt to handle more complex positioning. The existence of tileset specific objects (the tile type and special platform setting) also is used albeit in a much greater scale than in SMB1.
    Yoshi's Island is the most sane, having separated data for objects, teleport destinations (which strictly speaking is part of the foreground data but loaded after all the objects are processed) and sprites as well as no screen skip (it helps that the levels can be as tall as 128 blocks and as wide as 256 blocks so longer objects is ultimately a necessity), though the fact that its level data works on a memory allocation basis results in some interesting level storage (most notably, the game is only able to fill half of the screens) while the object handlers themselves are pretty crazy due to using pointer everywhere as well as storing tileset Map16 data in RAM to save on objects (e.g. the mud floor in the swamp levels use different Map16 tiles but are made of the same object). Furthermore, the sprite tileset can also be used to change the palette and even foreground tileset, something which I made use of it in my YILDC level, btw.
    The most interesting fact is that SMB1 can change which background decoration is generated which actually explains why the backgrounds in the SMAS version are dynamic and are larger than they fit in VRAM: It's just the modern equivalent of the change background decoration! As an aside, this also is true to TLL (naturally) and SMB2, surprisingly enough. SMB3, on the other hand, uses static backgrounds like SMW.
    Another thing which is interesting is the fact that the object end byte is 0xFD instead of 0xFF as one might expect. Then again, the screen skip object is easily sacrificeable, it actually makes sense.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +2

      It can help to think of the object data as a sequence of bits rather than a sequence of bytes.

  • @nou2912
    @nou2912 ปีที่แล้ว +8

    The reason why some glitch levels lag a lot or sometimes crash in the middle of the game is because $0000-$7fff is nes ram, so the level data might not just be invalid, but also change while the game is running

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +5

      I'm sure you have a typo with the RAM memory because the NES has 2 KiB or RAM which is enough to fill go from $0000 to $07FF but not any higher.

  • @hoodedman6579
    @hoodedman6579 ปีที่แล้ว +9

    There's an interesting trick that comes up in Mega Man 2 hacks where they make multiple enemies load in at different times; normally, most enemies in that game load when they get on-screen, but the trick allows things such as enemies appearing behind Mega Man as well. To my understanding, this is because enemy loading is handled in a similar way as SMB, in that they all need to be done in order; however, instead of breaking if they're out of order, it just delays the earlier enemy until the latter is also loaded. It's quite interesting, though I do wish that I knew the exact way it worked.

    • @XBladenoJutsu
      @XBladenoJutsu ปีที่แล้ว +2

      If it works the same, then to my understanding, clearing the queue of something that is already loaded (killing an enemy) will allow something to take its place in the queue (the unloaded enemy).

  • @Zorgot.
    @Zorgot. 8 หลายเดือนก่อน +2

    huh, the object explanation on how objects don't spawn sometimes for some reasons kinda helps me understand a bit why some stuff doesn't spawn correctly in the lost levels. even tho it's caused by enemies like lakitu, it still kind of helps knowing how object spawning works and actually seeing it

  • @BigOlSmellyFlashlight
    @BigOlSmellyFlashlight ปีที่แล้ว +5

    one of my favorite parts of these videos is the interactive content you put on your website
    like you didn't have to make a level decoder and decode all the glitch levels in full but you did anyways and i appreciate that and it piques my curiosity

  • @zfmag
    @zfmag ปีที่แล้ว +4

    Your presentation tools to visually show the mechanics and what happens in memory are amazing. I love these videos

  • @Mainyehc
    @Mainyehc ปีที่แล้ว +8

    Wouldn’t it be interesting if Mario Maker had a mode that limited you in the same ways as the original SMB NES cartridge (or, sure, the SMB2 FDS disk as well)? It would make for a great ROM hack concept playground!
    By the way, kudos for the awesome design work on this video, it’s a really good piece of information design on a rather arcane topic.

  • @carolmerritt2240
    @carolmerritt2240 ปีที่แล้ว +6

    As a programer this really makes me appreciate the amount of effort put into this game! Id love to see something like this for other NES games like mario 3! Though if this one is this complex, I cant imagine more complex games. Goes to show how much faith nintendo had that Mario Bros would take off.

  • @williamdrum9899
    @williamdrum9899 ปีที่แล้ว +32

    Very interesting. It isn't stored the way I imagined at all. Now the level header thing seems very complex. I'm surprised the game can process all those edge cases so fast. Is the black screen that says "WORLD 1-1 MARIO x 3" secretly a loading screen to unpack the level header?

    • @Dwedit
      @Dwedit ปีที่แล้ว +24

      The real "loading screen" is the blank screen that appears for several frames when you change levels. NES PPU (graphics chip) can't have large amounts of graphics data uploaded except when the screen is 'turned off' (forced blank screen). So in order to update an entire screen's worth of data, the screen needs to stay blank for several frames.

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +15

      ​@@Dwedit Interesting. Admittingly, there aren't that many things which need to be prepared for a SMB1 level when everything is basically ready to be used.
      This contrasts SMW where the Mario Start is an actual loading screen since that's where the level data is decompressed and music is uploaded to ARAM as well as YI where the Yoshi Start sequence does the same _and_ upload all the graphics and stuff.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว +8

      SMB1 is a bit unique in how it "streams" level data (part of why you can't go backward), so it's essentially loading in the background while you play.
      Later games had enough RAM (added to the cartridge for NES games) to store a huge tilemap, so they decode the entire level at once, and in some cases use a "start" screen to mask the load time.
      (This tilemap is the other reason you can't go backward - the game wouldn't be able to remember which blocks you've destroyed/collected.)

  • @possible-realities
    @possible-realities ปีที่แล้ว +5

    Fantastic video! Been wanting to understand about this for a long time, and I'd definitely say you did the topic justice. Also really like all the illustrations, and the video at 27:50, that must have been a ton of work!

  • @HYRULE10
    @HYRULE10 ปีที่แล้ว +3

    Very interesting stuff! Really love the effect you put into the animations and explaining the loading algorithm!

  • @sonicatyt1082
    @sonicatyt1082 ปีที่แล้ว +5

    At 3:00 (world e-1) I used an infinite jump cheat code and there is much more to that level than just a block and the void. I recommend trying it out because there’s more than the void.

    • @Jeansowaty
      @Jeansowaty 9 หลายเดือนก่อน

      That's because it uses random RAM code. It's always different and pretty much endless.

  • @ElliLavender
    @ElliLavender 5 หลายเดือนก่อน

    I love your channel so much and keep adding every single video I watch to my "intetesting" playlist. These are the intricacies of retro games I have always been super interested in, explained in a really accesible way. Thank you so much for all the work you do!

  • @skmgeek
    @skmgeek ปีที่แล้ว +4

    Honestly, super cool! I loved the explanation, very informative!

  • @shizza3198
    @shizza3198 6 หลายเดือนก่อน

    First video of yours that I've seen and it is extremely high quality. I'll be taking a look at the rest of your catalog.

  • @msk8k
    @msk8k ปีที่แล้ว

    Great explanation! Thanks for the in-depth review and graphics that tied it all together. The timeline at the end is a masterclass in using visuals to teach a complex subject. Well done.

  • @oc-steve
    @oc-steve 9 หลายเดือนก่อน +2

    Great video. Instead of framing the video as how glitch levels work, it could just be how level data is stored.

  • @fire_man3173
    @fire_man3173 ปีที่แล้ว +2

    I think that level loading animation is easily the coolest thing this channel has produced. I'm a software developer and the stuff these guys did to make this game run is just... My hair is going gray just thinking about all of the edge case BS the devs had to remember. It's a miracle this game doesn't crash all the time.

  • @ClassicTVMan1981X
    @ClassicTVMan1981X ปีที่แล้ว +4

    Awesome video! I would love to see you do this again, but for the Super Mario All-Stars version of this game. Most of what you talk about in this video has been retained in that version. When referring to the tile data for each of the above ground type levels in that version, at the end before the tile data terminator ($FD), are two other bytes placed after the end castle sprite. These two extra bytes constitute a scroll stop, which I know you discussed at one point here.
    In the original NES SMB1, scroll stops were featured in every level type except for above ground ($01), the few exceptions in that case being the cloud type bonus levels and the outside warp zone in 4-2 that takes you to Worlds 6, 7 or 8. Scroll stops were first added to the other above ground type levels beginning with the Japanese Super Mario Bros. 2 (the one we call The Lost Levels), which was released for the Famicom Disk System accessory, but the only iteration of SMB1 to have the scroll stops for the above ground levels in the 8-bit era (outside of the cloud bonus levels and world 4-2's outside warp zone) was All Night Nippon Super Mario Bros., also for the FDS; this title was a promotional data pack that was given away to celebrate the 20th anniversary of the founding of the All Night Nippon radio station.

  • @Chrisuan
    @Chrisuan 6 หลายเดือนก่อน

    these videos are so incredibly well-made, please never stop creating them!

  • @serial_box
    @serial_box 4 หลายเดือนก่อน

    Absolutely fantastic video series! 🌟 Even though I'm not a tech expert and didn't grasp every detail (from part 2 onwards my brain was technically out most of the time 😂), I'm blown away by the clarity and depth of the explanation, it really covers the topic very interestingly.
    It's not the video's fault that I didn't fully understand everything; it's just super extensive stuff and I don't have a particularly good brain!
    The previous two parts of this series were also incredible. The animation is top-notch, and the whole presentation feels so high-quality. Keep up the great work! 👍

  • @CrushedAsian255
    @CrushedAsian255 ปีที่แล้ว +2

    Amazing video with great visuals as always!

  • @_polpon
    @_polpon ปีที่แล้ว

    All your videos have excellent graphical representations, but this really stood out to me! Truly amazing! I didn't know how intricate the level loading was in this game, very interesting!

  • @coolbrotherf127
    @coolbrotherf127 ปีที่แล้ว +1

    I'm always so excited when you upload.

  • @LegendBegins
    @LegendBegins ปีที่แล้ว

    Simply amazing. Thank you for doing all this research and putting it into such a digestible format!

  • @quinn7894
    @quinn7894 ปีที่แล้ว +1

    YES! I've waited so long for this video! I subscribed just for this video!

  • @rtyuik7
    @rtyuik7 ปีที่แล้ว +3

    World E-1 is giving me flashbacks of that "Super Mario Bros. Frustration" video from like over a decade ago...i thought it was like a 'pre-Kaizo' ROMhack intentionally made to be near-impossible to beat, but i guess it couldve just been a Glitch Level...he DOES end up with 'W-BlueSky lives' at one point...

    • @renakunisaki
      @renakunisaki ปีที่แล้ว

      The lives counter works in an odd way. I might be misremembering but it does something like, if number of lives is greater than 9, draw a crown before the number and subtract 10 from it. So it works correctly for up to 19, then starts showing glitch tiles. (The W was probably the crown icon.)
      I don't know why they didn't just draw a 1 instead. It would have been much clearer. It would still show glitch tiles after 19, but it already does that. Clearly they never intended it to get that high.
      That hack just gives you some absurd number of lives.

  • @esmerylan
    @esmerylan ปีที่แล้ว +4

    After watching this video, I decided to try and recreate some of these levels in Super Mario Maker 2 using the maps linked in the description as a reference. Unfortunately, most of the unique effects produced by the original's level storage method aren't reproducible in SMM2 at all- things like the weird mixtures of tilesets and backgrounds just aren't possible with the way the latter handles level styles. The best I could manage was an approximation with relatively accurate object placements, but it still doesn't have the same magic as these weird messy levels.

  • @celeryman14
    @celeryman14 ปีที่แล้ว

    I've been waiting for this video, thank you :)

  • @nickfarace9339
    @nickfarace9339 ปีที่แล้ว +1

    I actually was trying to recreate levels in the way SMB1 did them in Mario Maker 2, but lacked a ton of the detail of how they worked. This video alone basically setup exactly how to do so, even to the point of limits. Now I feel inspired to make those levels.

  • @MusicByproduct
    @MusicByproduct ปีที่แล้ว +1

    2:40 ”just a lone question block” aw there’s a koopa too, RIP koopa

  • @hotmultimedia
    @hotmultimedia ปีที่แล้ว

    Thank you for making this explanation, I loved reading these kind of specs from txt files but of course having cool visualizations is even better :)

  • @Bizzozeron
    @Bizzozeron 7 หลายเดือนก่อน

    ur vids are so relaxing bro, thanks.

  • @pimmonts
    @pimmonts ปีที่แล้ว

    I absolutely love these videos, its just so fascinating. Great voice to listen to, as well.

  • @Murnjendoof_too
    @Murnjendoof_too 3 หลายเดือนก่อน +1

    I love this video so much. Is there any chance you'd be willing to do a similar video about how SMB3 stores its levels? They tend to be larger and more complex than those in SMB1, and I'm really curious as to how they managed to fit so many in the cartridge.

  • @ChaoDee
    @ChaoDee หลายเดือนก่อน

    "Mario eventually meets his worst enemy... A single lone brick block" Best narration of all time

  • @Kenjitsuka
    @Kenjitsuka ปีที่แล้ว

    I love this series so much! Thanks!!!

  • @cll1out
    @cll1out ปีที่แล้ว +1

    This guy deserves a medal for communication with diagrams and animations. I imagine most anyone who knows what hexadecimal is could clearly understand what goes on here without even any basic understanding of NES architecture.

  • @YF501
    @YF501 ปีที่แล้ว +1

    One of my favorite nuances with smbs worlds is that the levels can be labeled in different ways.
    8-4 for example can be 1-36 (using cree3po's smb any worlds patch)
    X-4 can be (x+1)-0 (2-0 is 1-4)
    And it even works with negatives.

  • @Artoooooor
    @Artoooooor ปีที่แล้ว

    That was super-cool to watch! Thanks.

  • @electronicecstasy8453
    @electronicecstasy8453 ปีที่แล้ว

    I never would've guessed that the levels in this game had to be implemented so intricately. This is incredible!

  • @glitchy_weasel
    @glitchy_weasel ปีที่แล้ว

    Outstanding series as always. It's crazy how the developers came up with such complex routine to encode level data to save space. But I think is crazier how to level designers managed to create fun levels with these restrictions - or maybe they were the same people lol. Cheers

  • @saleboat
    @saleboat 2 หลายเดือนก่อน

    this makes me wanna see more from you, maybe stuff like bugged objects from Super Mario World when the game is corrupted in some way

  • @mattlau04
    @mattlau04 ปีที่แล้ว

    Super interesting video! And the animations are amazing as always! (the one at 27:55 is bluffing)

  • @StereoBucket
    @StereoBucket ปีที่แล้ว +2

    Man, I remember these levels on one of those 99999 in 1 cartridges. Half of the Mario games were unplayable and/or had these. Others had some weird effect, I ended up finding one where big mario cannot go small by touching an enemy.
    I always wondered what was after the black void of E-1, thanks for the maps.

    • @will88k
      @will88k 4 หลายเดือนก่อน

      Haa yes I had one of those on my bootleg nes, Polystation. It had thousands of mario versions, most of them normal but others where bugged as heck. I remember the one where the objects came before collision, so you could pass through them and later hit and invisible wall.

  • @Opanker_
    @Opanker_ ปีที่แล้ว +2

    You forgot: The weird castle block white background empty space, castle level with red background and mario stopped in place, and a glitched level that changes depending on how you move through it.

  • @martin_emrich
    @martin_emrich ปีที่แล้ว +4

    After all that wasteful JSON/YAML at work, your videos are like a Spa for the mind… 😌

  • @VinsCool
    @VinsCool ปีที่แล้ว +3

    Great stuff like always!
    I wonder how much work would be required in order to allow going backwards in a level, and still get the routines to load the proper data at the correct place.
    Probably something painful, lol

  • @johnnydracaena6052
    @johnnydracaena6052 ปีที่แล้ว

    I am LIVING for this series

  • @iamsushi1056
    @iamsushi1056 10 หลายเดือนก่อน +2

    I feel like this could be used to make some super cool custom levels that change colors when you go through a pipe like a weird NES Mario maker. It might require force-freezing certain parts of the RAM to be stable to get it to work but it should, ignoring issues _that_ would cause, work

  • @wariolandgoldpiramid
    @wariolandgoldpiramid ปีที่แล้ว +1

    As I've done some SMB romhacking before, this was very interesting, and easier to understand than videos o this style on other games.
    But when it came to the "objects in those specific Y values", I think it would have been helpful if you showed how they look in the SMB Utility program, being 1, 2, or 3 tiles below the bottom of the floor.

  • @misreal1166
    @misreal1166 ปีที่แล้ว +3

    2:35
    Hello! Actually you can access these crash levels as well using the SZTOLS Game Genie code or setting the 0729 RAM value to 0. Not a technical expert, but there seems to be a part of game code intentionally preventing you from accessing them.

  • @l9m241
    @l9m241 ปีที่แล้ว +18

    Interesting how the loading is more of a technicality of how objects and the level worked with loading stuff into memory. I'm curious to know how that changed in SMB3/SMW and how they handle their loading of objects instead. Especially SMB3 since it too was developed on the NES.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +5

      SMB3 had a lot more cartridge space than SMB1 did, plus it had four-way scrolling so I imagine they would be vastly different.

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +5

      The biggest advantage both games have is the fact that they can have the complete level data stored in RAM so they don't have to build the levels on the fly and thus allow for bidirectional scrolling.

    • @warmCabin
      @warmCabin ปีที่แล้ว +6

      SMB3 uses a similar object system, but it unpacks all the individual tiles into RAM on the cartridge, so going backwards and diagonally is that much easier.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +3

      @@warmCabin So basically it pre-constructs the entire level, as if it were going to copy the data to VRAM, but instead unpacks it from ROM to cartridge RAM, and during the game the portion of the level that Mario is at gets copied from the cartridge RAM to VRAM. Right?

    • @warmCabin
      @warmCabin ปีที่แล้ว +3

      @@williamdrum9899 Not quite. It stores each individual _tile,_ like brick, cloud, or question block w/ fire flower, to be used as collision data. Then the drawing code can dig into that data based on your screen scroll or whatever. Look up 100th coin on TH-cam, he taught me everything I'm telling you

  • @soverysleepy
    @soverysleepy ปีที่แล้ว

    love your videos
    thank you for making them

  • @RedStoneMatt
    @RedStoneMatt ปีที่แล้ว

    Learning so much from this, thx!!

  • @pyro143
    @pyro143 ปีที่แล้ว

    another incredible RGME video

  • @DurpeeSlurpee
    @DurpeeSlurpee 9 หลายเดือนก่อน +9

    "the toad and the princess are the same sprite"
    Hang on, does this mean toad goes through every castle, pretending that there's a princess that got captured but moved to a different castle, then at the end of the game he dresses up like a princess so Mario can save him? Is this whole game some sick plot by toad just to get attention from Mario?

  • @ecernosoft3096
    @ecernosoft3096 ปีที่แล้ว

    I've been waiting forever for this, thanks!!!!!!!!!!!!!

  • @TheGameCreator13
    @TheGameCreator13 ปีที่แล้ว +1

    Great video!
    Now I want a video explaining how Zelda 1 stores screens 🥺

  • @IamRegularPerson
    @IamRegularPerson ปีที่แล้ว

    Still love your content :) Always looking forward to the next video.

  • @um_idkw
    @um_idkw ปีที่แล้ว +1

    If you had ground in e-1 you would find random monochrome level tiles, and in w-1 if you could walk it would crash soon after. Plus in 62-1 if you could walk you would walkdown a hall way until you reached a wall and if you could walk through walls you would continue walking until the scrolling stops or the time runs out.

  • @halonothing1
    @halonothing1 11 หลายเดือนก่อน +2

    TH-cam's got your video categorized as being about 1983's Mario Bros. in the section below the description, instead of 1985's Super Mario Bros. It reminds me of looking up Game Genie codes for SMB in the book and always confusing it with Mario Bros.

  • @smallangrycrab
    @smallangrycrab ปีที่แล้ว +1

    Good video, I do like it a lot!

  • @thecunninlynguist
    @thecunninlynguist ปีที่แล้ว

    Great deep dive analysis!

  • @lilbluefoxie
    @lilbluefoxie ปีที่แล้ว +2

    it still amazes me how they put this all together in a 32kb rom.

  • @seditt5146
    @seditt5146 ปีที่แล้ว +6

    3:26. Can't you get through the wall using that speed running technique where the clip into the block using small Mario forcing themselves to be pushed forward? Its use on I believe its world 4-2 in order to shift the pixels and create the wrong warp exploit. Its difficult but it allows you to hit a block which is a solid wall.

  • @MichelleSleeper
    @MichelleSleeper ปีที่แล้ว +7

    The level maps are incredibly fascinating. Would you be willing to share the code you wrote to make these? The SMB map/tile format is extremely interesting and I wanted to try doing something like this on my own to understand it better, but had no idea where to begin.

  • @Bakamoichigei
    @Bakamoichigei ปีที่แล้ว +1

    I assumed that level tile data would at least be stored via RLE, it's interesting to know they went so much further and defined preset tile and sprite 'groups' for quickly roughing in the map and placing recurring objects like the flag staircase, pipes, etc. Thus, requiring very little space to encode additional customizations. 🤔 Oh-ho~ so not being able to scroll the level back was as much a technical limitation as anything else?! Now I'd be all the more interested to hear how SMB3's engine works! 🤩

  • @user_romanport
    @user_romanport ปีที่แล้ว +6

    Really great video as always! I'm curious though...if the level is loaded left to right and level data is assumed to be organized left to right, what's the point of having an X coordinate in the object data? To me, it seems like it would make more sense to instead use that "next screen" flag bit as a "next column" flag instead (and maybe expand it to be two or three bits wide, allowing larger jumps as well). That way, when loading a column, the game would just load objects on the current column until that flag is set. The only problem I see with this is that the queue system wouldn't work for objects larger than one column, but I think that could be fixed by adding an "offset" byte to each item in the queue that starts at zero and is incremented by one every time a column is drawn to track progress on rendering it

    • @Dwedit
      @Dwedit ปีที่แล้ว +6

      It was the first time they used an object system like that. Zelda 2 would refine the system. Zelda 2 used something very similar, but instead of storing an X coordinate, they stored the difference between this object's X coordinate and the previous object's X coordinate. Then you don't need the "Next Page" flag anymore, so you can double the number of possible objects.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว

      I think Super Mario Land 1 does something kinda like this. The level data is one byte per column, indexing into a list of columns (and each column is a list of tiles). I'm not sure though.

  • @darkstryller
    @darkstryller ปีที่แล้ว +2

    this actually explains why there is nothing after the flagpole, becuase it reached the end of the list.

  • @minuspi8372
    @minuspi8372 ปีที่แล้ว

    3:54 That extended jump sound is incredible

  • @MegaZeta
    @MegaZeta 11 หลายเดือนก่อน +2

    Game Genie "codes", just me as a kid messing around with them, once took me to a single-screen _Super Mario Bros._ "level" that was nothing but letters / characters from the character map on a black background. Their locations had some property where Mario would bounce on them but couldn't "land". No clue what it was pointing at...!

  • @billcalabro6550
    @billcalabro6550 ปีที่แล้ว +1

    It's crazy to think that folks designed and built this game without an easy way to visualize this process.

  • @TheSektorz
    @TheSektorz ปีที่แล้ว +2

    0:26 when I was a kid I had one of those bootleg Famicom cartridges pretending to have like 2000 games, and one of those was a broken Super Mario Bros. that started with this level... oh it was so mystifying for a kid to wonder how to beat this "game" :D

    • @Dwedit
      @Dwedit ปีที่แล้ว +1

      Even if you have a weird SMB1 bootleg cartridge, the A+Start continue code will still start you at 1-1.

    • @renakunisaki
      @renakunisaki ปีที่แล้ว

      I remember some hacked ROMs circulating online back in the day, which changed the startup code for some reason (cheats and/or bootlegs that erased the title). They expected all memory to be cleared a certain way at power on. But since many emulators (and for that matter, real consoles) didn't do that, you'd start in World 0-1, or Mario just wouldn't show up.

  • @incognitiosaystransrights
    @incognitiosaystransrights 4 หลายเดือนก่อน

    This reminds me of the glitch pokemon that have stats that are just random numbers in the code and cirrupted data for sprites. Its really interesting and neat

  • @LeftClickShift
    @LeftClickShift ปีที่แล้ว +6

    So, now knowing this - I'm kind of curious how Super Mario Bros 3 differs. The levels of this game's threequel are WAY more varied. Is SMB3 using a form of floor pattern switching and prebuilt level elements like this? Or are they storing rows and rows of individual tiles?

    • @Shadownnico
      @Shadownnico ปีที่แล้ว +4

      it mostly uses a bunch of pre-built elements like SMB1. the channel 100th Coin has a pretty detailed video about it!

    • @MarioFanGamer659
      @MarioFanGamer659 ปีที่แล้ว +1

      The most important point is that SMB3 keeps track of the whole level instead of just a portion so the object codes are very much simplified compared to SMB1.

  • @sagacious03
    @sagacious03 ปีที่แล้ว

    19:21 What do you mean the Toads & the Princess are the same sprite?!
    Anyway, neat analysis video! Thanks for uploading!

  • @eyesistorm
    @eyesistorm 10 หลายเดือนก่อน

    One thing i'd like to see in another video is how looping levels work. If you can't backtrack in the level with the screen skip object, I wonder how they did that looping thing in 3-4.

  • @Der_Arathok
    @Der_Arathok ปีที่แล้ว +1

    Have you ever been to MissingNo - MissingNos Brother? that level was wild!

  • @vulduv
    @vulduv ปีที่แล้ว +4

    huh... Never would I have guessed that the original super mario bros would store tile data like a bunch of objects.
    Very clever of the developers though. But that must have been hell for the developers with all those extra special cases.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว +2

      I'm guessing they sketched the general level concepts before creating the encoding method, then tweaked each level as needed to fit the limitations

    • @vulduv
      @vulduv ปีที่แล้ว

      @@williamdrum9899 Most likely yes. I know they sketched the levels out on paper first.
      I was mostly talking about getting it into the raw data the game could use, without messing any of the numbers up. As they didn't really have that much in terms of digital tools back then.

    • @possible-realities
      @possible-realities ปีที่แล้ว +2

      @@vulduv But maybe it was actually easier for them to enter the levels in a compressed format like this, since each entry can describe much more contents? Still a bit of a pain to encode everything into the format of course.

    • @vulduv
      @vulduv ปีที่แล้ว

      @@possible-realities I didn't think about that. Good point.

    • @williamdrum9899
      @williamdrum9899 ปีที่แล้ว

      @@vulduv Yeah the format can be a headache, but they may have made their own tools to create it (which we never saw since if such a tool existed it wouldn't be on the cartridge but rather a piece of software that outputs the data that would get put onto the cartridge)