Super Mario Bros.
From SDA Knowledge Base
DISCLAIMER: This page is referring to the NES/Famicom original release, not any of the remakes.
However many techniques still work in the same or a similiar way in the releases. Almost everything works exactly the same in the sequel SMB2j (aka Lost Levels).
Contents
General Game Mechanics
The "21 frame rule"
Every time you enter a new level, the game delays for a varying amount of time.
The delay is actually calculated so that the level frame count gets rounded up to the next 21 frame boundary.
As an example, this means that if you complete a level in
• 1 frame, the level length will be N+21 frames
• 15 frames, the level length will be N+21 frames
• 20 frames, the level length will be N+21 frames
• 21 frames, the level length will be N+21 frames
• 22 frames, the level length will be N+42 frames
• 30 frames, the level length will be N+42 frames
• 42 frames, the level length will be N+42 frames
• 43 frames, the level length will be N+63 frames
And so on, where N is a constant minimum length of the black screen.
Therefore, the only part of the game that can be improved by a time less than 21 frames (=a frame rule) is the last level.
Flagpole jump
If you hit a flagpole at the highest possible position, Mario will enter the castle about 11 frames faster. In most levels this saves a frame rule.
Avoiding fireworks
The fireworks are launched when a level is completed with the last digit of the timer at 1, 3, or 6.
Getting the fireworks wastes time, so you should slow down instead of hitting a time that yields them.
Lip jumps
It is possible to stand on the edge of a pipe even when a plant has risen out of it. There are a few pixels of room on both sides of the pipe that you can land on and immediately jump off again.
Known pseudorandom enemy patterns
The random number generation in this game is purely frame-based. If you reach an enemy at the same frame from reset, it will behave the same. Due to the 21 frame rule (which also applies to the title screen), it is possible to know what frame rule you are on.
This can be used in 8-3 to safely avoid the Hammer Bros.
Jumping through hammers
How it's done: The game does a very poor job of detecting collisions with hammers, so sometimes you can go through a hammer without getting hit, and sometimes you can completely miss a hammer and still get hit.
Bowser will start throwing hammers beginning from 6-4. Even if it looks like there's no gap in the stream of hammers, it's still likely that you'll be able to get through without taking a hit.
"Stomping" enemies from below
You don't need to hit the top of an enemy to kill it. As long as you're moving downward as you hit the enemy, you'll kill it.
Useful Glitches
Alternate pipe glitches
The alternate pipe glitch occurs when a pipe takes you somewhere other than its intended destination.
Theory: The game can have only one "entry point" (a pipe or vine) per screen. The reason lies in how the game is designed: There is just one global variable in the game RAM that determines where pipes or vines in the current screen lead. Once the screen scrolls far enough for the next target label to be loaded from the level data, all entry points in the current screen will lead to that place instead.
• If Mario is far on the right side of the screen, the entry point variable will be out of date, so a new entry point will lead to the target of the previous one (Example: In 4-2 of SMB1, if Mario is far enough on the right side of the screen, he can use the pipe to go to the warp room since the destination info of the vine is still valid. Making the vine appear is not required for this glitch. The only thing needed is that the screen hasn't scrolled too far when the pipe is entered.)
• If the screen is ahead of Mario (Mario is on the left side of screen), the variable will have updated too soon, so you can access a future entry point's target from an earlier entry point. (Example: In 8-4 of SMB1, in the area before the water area, instead of going in the pipe after the lava pit, go a little past the previous pipe, and then turn around and go in that pipe, and it will take you to the water area instead of taking you back to the beginning of the level.)
Methods of getting Mario to the left side of the screen
• Just move back.
Methods of getting Mario to the right side of the screen
• Teleport to the right edge of the screen the vine glitch (explained below).
• If you enter a wall, the wall will automatically transport Mario towards the right edge of the screen without scrolling.
• If Mario bumps into the left edge of an obstacle (wall, pipe, coin block etc.) while jumping, the screen scrolling will momentarily stop even if Mario continues to move to the right. Since Mario accelerates faster into the direction he doesn't face to, you should use this trick while jumping backwards (Mario faces to the left).
Walljump
A walljump is when you jump towards a wall and somehow Mario's foot catches the wall and allows to jump again, boosting from the wall.
Walljumps happen because the game does a floor check (a simple "is there a solid block below him?" test) even during a wall-ejection. Wall-ejection is SMB's mechanism to push Mario out of a wall when he entered it partially. The game ejects Mario towards the opposite of his steering.
To perform a walljump, you need two things:
• Some horizontal speed towards the wall
• Mario's feet must hit the wall exactly at a block boundary (every 16 pixels)
It's possible to perform walljump from any non-lethal solid material (bricks, pipes, etc.) and most notably in the second room of 8-4 to enter the next pipe quickly.
Flagpole glitch using an enemy
Koopa Troopas and Bullet Bills can be useful for flagpole glitching. When Mario enters the block at the flagpole with proper height, the "walking to the castle" sequence will be skipped. Landing on shells results in a higher bounce than Bullet Bills, so in order to use shells for this version of the flagpole glitch, you need to be inside the block at the flagpole already, at the moment you bounce off.
With a lucky Bullet Bill spawn this trick is possible in 8-2.
Going through walls as big Mario
When Mario is big, he can simply perform a duck-jump into the corner and start walking. This is because his head will be well inside the ceiling, enabling the ejection to the right. (If he ducks again before he is fully inside the wall, he'll be ejected to the left instead.)
Doing this at the end of 1-2 lets you reach the "Minus World".
Jump in mid-air
If you grab a mushroom in mid-air, you can jump again. To do this let go of A before you touch the mushroom and then hold A until the transformation is over.
The Minus World
This is a well-known glitch which occurs when Mario glitches behind the wall in 1-2 in SMB1 and enters the first pipe.
The minus world is basically just a random location of the game ROM, it is not a real world. It wasn't designed that way ― it's just an oversight of the programmers that you can get into the pipe before the correct warp labels are assigned.
In the NES version of Super Mario Bros., the "minus world" was a looping, uncompleteable copy of world 2-2. In the FDS version, however, it is an underwater 1-3, 2-3, and an underground 4-4, making it completable.
Completing the game this way would give the "in another castle" message, but would return to the title screen as if 8-4 had been beaten; hard mode and the level selection become accessible, as well.
Off-screen wall climbing
This trick is trivial to perform. When there is a hole on the left side of the screen, you can cram Mario in between of the screen edge and the wall, and climb upwards the hole. Mario will be unable to fall down. It can be used to reach the ceiling of the dungeon in places where there normally is no route to the ceiling.
By jumping repeatedly and steering to the left, it can also be used to enter the wall.
Application: In 5-2 of SMB2j enter the pipe before the vine using this glitch and hold down. Mario will enter the pipe in reverse direction and appear in the warp zone to world 8.
Tricks considered too difficult but theoretically possible
Accelerating faster
When you need to accelerate from zero speed, you can do it faster if you jump a small jump backwards and steer to the opposite direction Mario is facing. This can be used to start a level faster, to accelerate faster after exiting a pipe and to complete a walljump faster.
Press "left" for 1 frame. Press the "A"-button for 3 frames to make a small jump to the right. This will leave you about two pixels farther than a normal start. (TODO: This method may be suboptimal.)
In an any% run, this would only be useful in 8-4 due to the framerule.
Flagpole glitch
Complete the level without lowering the flag by glitching into the base block of the flagpole and touching the flapole from inside. Doing so is faster than lowering the flag.
Going through walls as small Mario
Jump into a solid object below a floor
For the purpose of this glitch, any solid object (including pipes) counts as a floor.
It is really difficult to perform (much harder than the walljump), but here are the instructions.
1. You need proper speed. If the object is only 2 blocks tall, such as the pipe in the end of 1-2, you can not jump into it while running. Deaccelerate before jumping. If you have too high speed, you'll just find yourself standing on top of the object instead of inside it.
2. You need the right position. The right position is: as near as possible. You are too near, if when you jump toward the object, you'll bump into it without getting ejected pixel by pixel.
3. Immediately when the wall starts ejecting Mario, start steering away from it. This causes the wall to pull you in instead of push you out.
4. Immediately after your vertical movement stops, start moving to the direction you want to go. If the wall is ejecting you now, you failed some of the previous steps.
The easiest way to perform this trick is into 2-block tall obstacles at walking speed.
1. Do a minimal height jump (hold A for 1 frame) at the exactly right distance.
◦ You are too close, if you bump into the wall without a chance to counter the ejection.
◦ You held A for more than 1 frame (or your jumping platform was less than 2 block distance far from the floor), if you land on top of the floor.
2. When the wall would start ejecting, hold to the opposite direction from the obstacle.
3. Once Mario lands into the wall, start walking normally.
◦ If the wall just ejects Mario, you were too far from the wall when you jumped.
Jump into a wall just below a solid ceiling and walk through it
To perform the trick, do a walljump into the wall position right below the ceiling. When you get foothold, jump immediately. When you land, jump again. When you land again, jump again. Usually three or four jumps are enough before you can walk through the wall. Each jump takes you deeper into the wall.
During each of the jumps, you need to steer heavily to the opposite direction you're going to. Otherwise the wall will eject Mario.
Note: Steering only has effect during a jump (i.e. when Mario is not standing or walking). If Mario is standing, the direction of ejection is determined by the location of his upper body in relation to the left edge of the wall. (If it's partially out from the wall, he'll be ejected to the left (unstoppable unless you jump). Otherwise, he'll be ejected to the right (stoppable, speedable).
Jump into a solid wall and walk through it
It is possible to perform the wall-entry trick even without a ceiling. However, it requires extremely precise positioning and efficient speed. This is the hardest of all of the tricks.
Instructions: You will need to have a proper X-subpixel position value for this to work. A subpixel is a position component which is not rendered onscreen. In this game, 16 subpixels make up 1 pixel. Now when you jump into a wall (not doing this trick), you might be pushed out immediately without having entered the wall at all. At other times you might have been able to be inside the wall partially. This is the result that you want when optimizing your X-subpixel position. You can press "left" for 1 frame while running to the right to decrease your subpixel value by one unit. Do this until jumping into a wall will result in Mario being partially inside the wall. If this condition is met, you can follow these instructions.
1. Jump towards a wall, approach its edge as closely as possible right before you enter it, and become embeded in it as deep as possible at the first frame you have entered it. The required minimum depth is 3 pixels.
2. Immediately when the wall starts ejecting you, start steering away from it. This causes the wall to pull you in instead of pushing you out.
3. As soon as you land inside the wall, jump while moving away from the wall for 1 frame. You have to hit the block above you inside the wall. You may have to repeat doing this until you are so deep inside the wall that you will not be ejected out while you are walking forwards inside the wall.
◦ If you can't hit the solid block above when jumping, you will be ejected out. You will need to try again from the start.
4. After you have entered the wall deep enough, start moving in the direction you want to go as soon as you land. If the wall is ejecting you now, you failed the previous steps.
any% strategy
See andrewg's WR video for the general strategy. This only goes into detail on the non-obvious things going on.
World 1-1
When you go into the underground section, start holding right, when Mario has fallen about half the way down and try to touch the ground you jump to as far to the left as possible. The farther to the left you hit the ground, the sooner you start accelerating to full speed. When the pipe transition happens, you should have 380 on the timer.
Then just hit the flagpole at the top. If you have 370 remaining on the timer, the level is flawless.
World 1-2 (Warp to 4-1)
The first difficult part in this level is jumping over the Koopa with a Goomba directly behind it. The best way to do it is to run at full speed and do a jump where you hold A for 1 to 3 frames and then immediately jump again.
At the end of the level, when you go to the warp zone, you actually do not have to make tight turnaround. Unless you hit the pipe to the right on its very right side, you will not lose the framerule, if you do not otherwise slow down in this level. The timer will show 346 on a perfect run.
World 4-1
This level is by far the easiest of the run. Jump at the top of the flagpole and you have a perfect time (340 remaining on the timer).
World 4-2 (Warp to 8-1)
In this level you need to do an alternate pipe glitch. To do this, you must scroll the screen farther to the right than usual so that both level exits are on the screen at once.
To scroll the screen, you must jump backwards into the corner of a block. If you just want to get the glitch, you can do as many backwards jumps as you like and will get the trick quite easily. For a good time you need to limit it to 3 backwards jumps. To save another framerule, it must be only 2 backwards jumps, but this almost requires perfection. A perfect run will show 354 or 355 remaining on the timer.
World 8-1
Even if you do not slow down at all in this level, you may lose a framerule. To get a perfect time in 8-1, you need to have previously altered the walking animation by hitting the star block in the middle of this level. (TODO: The precise mechanism needs to be figured out/explained.)
A perfect run will show 200 remaining on the timer.
World 8-2
A perfect run will show 342 remaining on the timer.
If you have a lucky bullet bill spawn, you can save up to 2 framerules doing a flagpole glitch using it.
World 8-3
In this level you need to slow down to avoid fireworks. You should finish with 242 remaining on the timer.
If you know what framerule you are on, you can predict the pseudorandom enemy patterns. Otherwise you need to be lucky.
World 8-4
This is the only level, where the framerule doesn't apply due to how the run is timed, so every frame matters.
Room 1
Just go right and enter the pipe. The piranha plant will mysteriously vanish, when you touch it.
Room 2
This is room with the walljump. When you go out of the pipe and hit the ground at full speed, you only have 1 frame to make your next jump. If you briefly press left, you have more leeway at the expense of 1 or 2 frames lost.
The walljump is explained in detail above. You will save about 5 frames, if you do the walljump facing left instead of right. Depending on how well you do the walljump, you can expect to lose between 1 to 7 frames, if you do it backwards.
Room 3
This room has another alternate pipe glitch, but it is much easier than the 4-2 one. It is surprisingly easy to lose lots of frames in this room. At the minimum expect to lose 2-5 frames.
Room 4
Hold A while you wait for Mario to get out of the pipe, this will give you a perfect start. It is easy to lose time on the pipe exit, but losing 0-2 frames is also possible.
Room 5
Hope Bowser doesn't screw you over due to pure randomness and hit the switch as far to the left as possible. To beat the World Record or to get below 4:58, you need to have 314 or 315 remaining on the timer. 315 is not neccessarily faster than 314. The World Record lost 19 frames in this level. To get below 4:58, you may not lose more than 13 frames.
RTA WR and TAS comparison
RTA WR: 4:58.09 by andrewg
TAS: 4:54.03 by Happylee (converted to RTA timing)
human theory TAS: 4:57.77 by Happylee
RTA rules TAS: 4:55.61
It's important to note that RTA and TAS time the run differently. RTA timing starts when the timer appears in 1-1 and TAS timing starts on reset (197 frames difference). They both end on hitting the axe in 8-4.
Also TAS allows left+right, which is banned in RTA. But RTA allows waiting on the start screen for good RNG without time loss.
World 1-1
The TAS saves 1 framerule by doing the flagpole glitch.
World 1-2
The TAS saves 1 framerule by going through the wall and entering the warp pipe sooner. This may require left+right to do quickly enough (more testing needed).
World 4-1
The TAS saves 1 framerule by doing the flagpole glitch.
World 4-2
The TAS saves 1 framerule by using left+right to accelerate and change speed more quickly.
World 8-1
The TAS saves 1 framerule by doing the flagpole glitch.
World 8-2
The TAS saves 3 framerules in this level: 2 from the bullet bill glitch alone and an additional one from left+right acceleration
World 8-3
The TAS saves 1 framerule with left+right acceleration and thus avoiding the fireworks. This framerule can also be saved without left+right by doing the flagpole glitch.
World 8-4
The TAS saves 55 frames from better execution, left+right acceleration and left+right direction change. Off these 55 frames about 21 can only be saved with left+right.
comparison to the human theory TAS:
room 1: -7 frames
room 2: -5 frames
room 3: -16 frames
room 4: -3 frames
room 5: -5 frames