Super Mario World - Level End Glitches

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Very well presented!

๐Ÿ‘๏ธŽ︎ 4 ๐Ÿ‘ค๏ธŽ︎ u/OverlordLork ๐Ÿ“…๏ธŽ︎ Mar 13 2018 ๐Ÿ—ซ︎ replies

This is ridiculously good! Thank you!

๐Ÿ‘๏ธŽ︎ 4 ๐Ÿ‘ค๏ธŽ︎ u/personman ๐Ÿ“…๏ธŽ︎ Mar 13 2018 ๐Ÿ—ซ︎ replies

He has more of these videos on his channel, highly recommended!

๐Ÿ‘๏ธŽ︎ 3 ๐Ÿ‘ค๏ธŽ︎ u/Tompala ๐Ÿ“…๏ธŽ︎ Mar 13 2018 ๐Ÿ—ซ︎ replies

Amazing

๐Ÿ‘๏ธŽ︎ 2 ๐Ÿ‘ค๏ธŽ︎ u/Tischel ๐Ÿ“…๏ธŽ︎ Mar 13 2018 ๐Ÿ—ซ︎ replies
Captions
There are three major glitches in Super Mario World that are used in speedruns to complete levels quicker. They are: creating Yoshi wings, spawning an invisible Koopa Kid boss, and collecting a question mark orb in the inventory. Each of these glitches allow the player to end a level prematurely, and they all work in their own way. Yoshi can grow wings by holding a blue shell in his mouth, but there are a few blocks in the game that contain special wings that warp Mario and Yoshi to a bonus room and finish the level. There are only three of these blocks in the game, but using block duplication, they can be created in many other different levels. Block duplication is a glitch that occurs due to a discrepency between which tile is hit by an item, and which tile should have be activated. When a tile is activated, it is deleted and a sprite version of the block is created in its place. This is responsible for the bumping animation and spawning the item that is contained within the block. Then, when it returns to its neutral position, it is removed and another tile is put in its place, usually a brown block. When the tile that is collided with and the tile that is activated are different, this results in the block being duplicated, since the original is never deleted. Most sprites in the game have a position that determines its location and a clipping box that determines its collision with tiles like the ground and blocks. This clipping box can be offset from the sprite's position--we'll show this with red box. The green dot marks the sprite's actual position. From a programming oversight, the coordinate that is used to determine which tile will be activated is a combination of the sprite's position and its clipping box. The Y-coordinate is strictly the sprite's Y-position, but the X-coordinate is the horizontal center of the sprite's clipping box. In this example, which is used by most carriable items, the resulting coordinate, marked with the blue dot, is actually hovering above the sprite's clipping box. If this coordinate is not inside the bounds of the tile that triggered the collision, the block will be duplicated to the tile where the coordinate is located. In the horizontal case, sprites that are located inside of a solid tile are ejected outwards so they don't become stuck. This can cause the detection coordinate to slip outside of the tile bounds before the block activation is handled. In the vertical case, if the collision is high enough in the tile, the clipping box can be inside the tile, but the detection coordinate can be above the tile. This can be done easily by throwing an item upwards inside of a block to get the block to duplicate upwards. Both of these events can occur simultaneously, which will cause the block to duplicate diagonally upwards and to the side. This might seem pretty pointless for the Yoshi wings block, since having more than one in a level isn't very useful at all. However, in order to decrease the number of unique objects in the game, certain ? blocks in Super Mario World contain different items depending on their location in the level--more specifically their X position. There are 4 such blocks in the game: a turn block with a chain star, 1-up, or vine, a turn block with a blue or gray P-switch, a note block with a fire flower, feather, or star, and a ? block with a key, Yoshi wings, P-balloon, or Koopa shell. Duplicating any of these blocks horizontally will produce the item previous or next in the series. For example, duplicating a vine block to the left will produce a 1-up mushroom, and duplicating a note block with a star to the right will produce a fire flower. Most importantly for us, is that duplicating a key block to the right will produce Yoshi wings, and duplicating a P-balloon block to the left will also produce wings. This can be used in six extra levels, bringing the total up to 9. Although really it's really 8, since the P-balloon in Donut Secret 2 is in a sublevel, which breaks the wings transition so the level becomes unbeatable. It doesn't stop there. Let's talk about Dragon Coins. Dragon coins are the big collectable coins that take up two tiles. If Mario touches one half of the coin, the other side will be deleted as well. The Dragon Coins tile IDs are $002D and $002E for the top and bottom respectively. To delete the tiles when Mario touches them, the lower byte is changed to $25, resulting in $0025, which is a completely blank tile. The upper byte is never actually changed! It makes sense, since the upper byte is already $00, why bother rewriting zero again? We can exploit this property by duplicating a block with an ID of $0100 or higher on top of one of the halves of the coin, and collecting the other half. This will result in a tile with an ID of $0125 being created instead, which just so happens to be the ? block with the key, wings, P-balloon, and shell. The block is invisible at first, since a blank tile was expected to be created instead, but if the tile is reloaded by moving it off-screen, it will show its true form. This block can then be activated, or duplicated itself to create the Yoshi wings we're after. Using the technique, another 20 levels can be finished via Yoshi wings. Only a few of them are actually faster than completing the level normally while being simple to execute, like Vanilla Dome 1 for example. Some of them require duplicating tons of blocks across the entire level, like in Yoshi's Island 1. And a few of them are incredibly difficult to pull off, even with emulator tools, like Butter Bridge 1. Here is a tool assisted movie recorded by Bruno Visnadi that abuses Mario's cape flight mechanics to duplicate a bunch of multicoin blocks over the the Dragon Coin in mid-air. Sprite number $29 is the Koopaling sprite. It actually handles all seven different Koopalings--similarly to the blocks with different items, it initializes a different boss depending on the Y position of the sprite. Starting from Y co-ordinate 0 and increasing, it handles Morton, Roy, Ludwig, Iggy, Larry, Lemmy, and Wendy Koopa. By utilizing a couple of glitches, this sprite can be spawned arbitrarily, skipping the initialization process. What remains is an invisible, glitchy boss sprite that can be killed with fireballs to end the level prematurely. Before describing what is going on, we need to know how Super Mario World handles which enemies are currently loaded. It does this by allocating memory for up to 12 sprites to be loaded simultaneously. When a new sprite needs to be loaded into memory, an empty slot is searched for, and if one is found, all of the sprite's properties will be loaded into that slot. Conventionally, the slots are numbered from 0 to 11, or 0 to B in hexadecimal. Here you can see each sprite labelled with its slot number. When an enemy is grabbed with Yoshi, its slot number is stored with Yoshi's data to tell that it is currently on Yoshi's tongue or in his mouth. Additionally, the licked sprite will set a flag of its own for the same purpose. Then when Yoshi swallows or spits the sprite out, Yoshi's data is replaced with -1 to denote that nothing is attched his tongue anymore. There is one instance where this value is not updated with -1, and that is when an enemy is dropped off of Yoshi's tongue by taking damage while licking it up. This results in carriable sprites retaining some weird properties--for example, Koopa shells will just fall through the ground when kicked. The next time Yoshi sticks out his tongue, this sprite slot reference is updated correctly with -1 until another sprite is caught on his tongue. Because of this, there's no inconsistancy and the link between Yoshi and the sprite attached to him isn't broken completely. There is however, a way to completely destroy this link between the two, and that is to use the double tongue glitch. When the player presses X or Y to stick out Yoshi's tongue, Mario's animation timer is set to 18, and decrements once every frame of active execution. When this value is 18, Mario pulls his hand back. At 16, Yoshi's animation timer is set to 6; at 12, Mario hits Yoshi in the back of the head; and at 0, he pulls his hand back. Yoshi's animation timer is used to show the face he makes in anticipation of Mario smacking him in the head--it decrements once every single frame. Under continuously active execution, this is a flawless system. The problem is that there are events in the game that pause execution of certain elements without actually pausing the entire game. The best example of this is when Mario grabs a powerup that changes his appearance. Mario's animation timer in particular does not decrement during the period that the game is frozen, but Yoshi's does. If Mario's animation timer happens to be 16 when this pause occurs, Yoshi's animation timer will be set to 6 every single frame until the game unpauses. This anomaly will cause Yoshi to stick his tongue out twice in a row, even though the player only pressed the button once. This happens even if Yoshi can't swallow something he picked up with the first tongue. For example, if a shell is grabbed with the first tongue, the second tongue will still appear even though Yoshi's mouth is full. This resets the sprite slot that Yoshi has on his tongue back to -1, and now he has a null sprite in his mouth. If you combine this glitch with eat cancelling, the end result is being able to have a sprite in Yoshi's mouth and not in Yoshi's mouth at the same time--the link between the two has been broken. The sprite can be spat out as if it were still in his mouth, and it can be killed as if it weren't in his mouth. In fact, if you kill the sprite in his mouth, the sprite slot is still considered to be in Yoshi's mouth. This means another sprite can spawn in that slot and enter the same limbo state as the original sprite. The last thing to know about before piecing together the boss kill trick is how sprites utilize what is called their stun timer. The stun timer is a generic timer that any sprite can use for any purpose--it will be decremented automatically once every one or two frames. The name stun timer comes from its most common usage--it dictates how long a Koopa will remain stunned inside its shell before it jumps out. In fact, this is the default action for any sprite when it is carriable. When a sprite that is carriable runs out its stun timer, another sprite is spawned from it. In this case, a shell-less Koopa is spawned from a shell. Koopas are the only sprites that use this feature in practice--other carriable sprites that have non-zero stun timers like Goombas and Buzzy Beetles override this mechanic just so they can wake up instead. Any other sprite that can be carriable and can have its stun timer set to something non-zero will spawn a different sprite from it. For example, P-switches are normally carriable, and their stun timer is set when Mario steps on them to determine how long until they despawn. By using Yoshi to eat the P-switch before it actually despawns, the P-switch will remain unflattened with its stun timer set. The sprite that spawns is determined by a table indexed out of bounds. The only intended values are the four different colored shell-less Koopas. So there are three requirements to get a sprite to spawn from another: 1) it can't be one of these sprites, 2) it must have its stun timer set, and 3) it must be carriable. Number 1 is easy to satisfy, but how about the other two? For number 2, we can utilize another use of the stun timer. It turns out that this timer is also used to determine how long the puff of smoke will persist after killing an enemy with a spin jump or with Yoshi. The problem with this method is that the slot is still condered occupied until the puff of smoke is completely gone and the timer is zero. Using the double tongue glitch we can get around this restriction, as you will see in a little bit. And then for number 3, we can use Yoshi to force sprites to be carriable, even if they weren't meant to be. Any sprite that comes out of Yoshi's mouth can be put into either the carriable state or the kicked state by spitting it out while ducking or standing respectively. For example, here is a glitch that you may have done yourself on accident. When all of the sprite slots are full, the goal tape sprite will force itself into an occupied slot no matter what. If the sprite it overrides happens to be the sprite in Yoshi's mouth, the goal tape itself will be put into Yoshi's mouth automatically. Then, the sprite can be put into kicked or carriable state by spitting it out. The sprite graphic looks pretty glitchy since it was never intended to be in either one of these states. If we did this glitch while also setting its stun timer, we would get a sprite to spawn just like the P-switch and Cheep Cheep. In this case, the goal tape spawns a red Parakoopa. Combining these three glitches, double tongue, broken Yoshi tongue link, and unintended stun spawning, a Koopaling boss sprite can be spawned by stunning a sliding blue Koopa. Take note that in this example, the sliding blue Koopa will be spawning into slot number 9. So we'll aim to unlink Yoshi's tongue and have it persist with slot 9. The first step is to trigger the double tongue glitch. We'll do this by dropping this fire flower from the item box, and sticking out Yoshi's tongue as we touch it. To break the link regarding Yoshi's tongue, a non-swallowable sprite needs to be grabbed with the first tongue. The first Koopa shell will work perfectly. By flicking it up into the air like this, it makes it easier to grab after jumping into the fire flower. The second tongue then needs to touch a sprite that is in slot 9 so that that slot is considered to be in Yoshi's mouth. In this setup, the blue Koopa happens to be in slot 9, so the second tongue needs to reach over the red Koopa and grab the blue Koopa. Then to cancel this tongue grab, we run into the red Koopa that is in front of Mario so the blue Koopa falls off Yoshi's tongue. At this point, the blue Koopa is in that limbo state and is both in and not in Yoshi's mouth. We can spit it out remotely, or we can kill the Koopa by stomping on it. Now there is nothing on screen that is in slot 9, but Yoshi still has it in his mouth. If we spit out whatever is in Yoshi's mouth now, the blue Koopa would be revived--or his shell would be at least. Instead of doing that, let's go back left and respawn the sliding blue Koopa. It spawns into slot 9, so now it is the sprite in limbo. Just like the goal tape example, we can spit it out into kicked or carriable states and make a glitchy mess. However, in order to spawn the unintended sprite, the Koopa's stun timer has to be set before spitting it out. We can do that by stomping on him first and creating a white puff of smoke, which sets the stun timer for this slot. See, using the smoke puff works in this case since the sprite being killed and the sprite coming out of Yoshi's mouth are in the same slot, thanks to the broken link. This makes the double tongue glitch a very easy way to stun a lot of sprites that were never intended to be stunned in the first place. Now, the Koopaling sprite is invisible since it was not initialized correctly, but it functions similarly to Morton, Ludwig, and Roy Koopa. Jumping on it once will make it teleport way off screen, so the best way to defeat it is to shoot it with 12 fireballs. This will trigger the boss defeated fanfare, and the level will be completed. This trick can be used in any level with a blue sliding Koopa--this includes Yoshi's Island 1, Groovy, and Cookie Moutain. And by using the unintended stunned sprite spawning, a sliding blue Koopa can be spawned in other levels, and then stunned itself to spawn the Koopaling. Here is a tool assisted movie recording by Masterjun that does just that in Valley of Bowser 4. There is a special sprite at the end of the Sunken Ghost Ship, and that is the green ? orb. Touching it will end the level immediately. It is possible to insert one of these orbs into the inventory box using an item swap glitch, and then releasing it anywhere you want to end that level prematurely. In this context, a powerup is defined to be a sprite that triggers the subroutine that attempts to modify Mario's state. The only intended powerups were mushrooms, fire flowers, cape feathers, super stars, and 1-ups. However, there are additional sprites that trigger this routine that aren't traditionally considered powerups. These are the invisible solid sprite found at the ending of Switch Palaces, and all of the Chargin' Chucks. But why does it matter if these are techincally powerups if they don't change Mario's state when you touch them, and you can't even eat them with Yoshi? The answer is that it is possible for Yoshi to eat both of these sprites, or rather any sprite, by performing an item swap. When talking about the boss kill, we saw what happened when an enemy was knocked off of Yoshi's tongue by taking damage during the action. In this instance, we'll see what happens when a sprite is completely removed from Yoshi's tongue before he can swallow it. The easiest way to show this is by eating a moving coin, and collecting it quickly. However, this glitch can be performed in any way that despawns the sprite, such as moving it far enough off screen. Let's look in slow motion. First the coin is latched to Yoshi's tongue. The two way link mentioned earlier is established at this point. When the coin is collected by Mario, it is deleted and now it looks like there is nothing on Yoshi's tongue anymore. However, the link is not broken until Yoshi swallows something, so the link still exists. Even though the coin doesn't exist anymore, that sprite slot is still attatched to Yoshi's tongue. It's a different sort of limbo state, where a sprite can still exist and not exist at the same time--the difference here is that the sprite is on Yoshi's tongue instead of in his mouth. You can see this in action when Yoshi finally retracts his tongue all the way, and the coin is eaten again even though it doesn't exist anymore. Since the sprite slot that had the coin in it was empty, it just took on the attributes of whatever was in that slot last, which was the coin. So in this way, sprites that get deleted when Mario touches them can be duplicated, since their effects are activated when Mario touches them and when Yoshi eats them. The item swap occurs when another sprite spawns during the period of time when the sprite slot on Yoshi's tongue is empty. Since the link between the item and Yoshi's tongue is still active at this point, any sprite that spawns into that particular slot will automatically warp onto Yoshi's tongue. This applies to pretty much all normal sprites, which means Yoshi can eat pretty much everything. Most sprites will only give Mario a single coin when they are swallowed, with the exception of powerups, which will update Mario with the appropriate state. And this brings us back to the Chargin' Chuck. Since these guys are techincally powerups, they will invoke the routine that updates Mario's state when consumed. The first thing this routine does is determine the current status combination for this execution instance, since the results depend on both Mario's current powerup status, and the powerup that was collected. There are four possible states for Mario's powerup status and five intentional powerups. This comes out to 20 different combinations of the two. The routine is broken into two parts: updating Mario's powerup status and updating the item box contents. Each part contains a table that is 20 entries long that determines what action to take or what item to give in the item box. For updating Mario's powerup status, these values are treated as indices into a table of pointers to subroutines that give the appropriate powerup and setup the appropriate animation. A value that isn't less than 6 will result in a broken pointer that will most likely crash the game if taken. For example, if the index into the original table is 20, which exceeds the length of the table by one, the pointer index will be #$38, which results in a pointer to $1088, which does not contain game code. For the second partof the routine, the value in the second table is treated as the item ID that goes into the item box. The 20 entires of the table only include 0, 1, 2, and 4, for no item, mushroom, fire flower, and feather respectively. Again, if this table is indexed out of bounds, a junk value will be read, and a completely unrelated sprite will be put in the item box. For example, if the index into the original table is 40, the value read will be #$38, which results in a Rex being placed in the item box. Now, since Chargin' Chucks aren't taken into account in the status combination check, they will result in an errant index. There are 8 different kinds of Chucks, and 4 different Mario powerup statuses, so this results in 32 extra indices that can be created that will exceed the bounds of the table: 116 through 147. It turns out that in index of 135 will result in the green ? sphere being put in the item box, and the subroutine located at $95C6 will be executed. This points to the middle of a routine that deals with sprite-object interation, but it is able to return safely without crashing. This index can be created by eating a Clappin' Chuck while Mario has fire power. With the orb safely in the item box, it can be carried to where ever you want and released to finish the level immediately. Other interesting item swaps include indices 124 and 128 which will put a key in the item box, and can be done with a Bouncin' or Whistlin' Chuck with small Mario. Index 116 will put Lakitu's cloud in the item box. This can be done by item swapping a normal Chargin' Chuck with small Mario. And if you item swap the Chargin' Chuck with big Mario instead, you'll get index 117, which will put a Bullet Bill in reserve, and give Mario invincibilty. There are more ways to complete a level prematurely, such as spawning a Reznor boss and glitching a message block to trigger a switch palace, but those will be explained in a later video. Feel free to support me on Patreon in the mean time! I am a one man team, and work on editing in between my studies. Thank you for watching!
Info
Channel: Retro Game Mechanics Explained
Views: 499,631
Rating: 4.9342155 out of 5
Keywords: video, game, programming, code, glitch, trick, explain, description, hack, tas, speedrun, super mario world, mario
Id: 1SGfYkXoGjg
Channel Id: undefined
Length: 24min 6sec (1446 seconds)
Published: Mon Mar 12 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.