Submission #2728: andymac's GB Super Mario Land 2 - 6 Golden Coins in 21:43.52

Game Boy
(Submitted: Super Mario Land 2 - 6 Golden Coins)
baseline
VBA-rr
78211
60
23406
Unknown
Super Mario Land 2 - 6 Golden Coins (UE) (V1.0) [!].gb
Submitted by andymac on 7/4/2010 12:19:30 PM
Submission Comments
Super Mario Land 2 is easily one of the greatest games for the game boy. The game takes place immediately after super Mario land, where Wario has taken over Mario land and brainwashed the inhabitants. Wario's reign is short lived, as only 21 minutes later, Mario has regained full control over the entire island. Sucks to be Wario today I guess.
Normally I would put my thanks at the very end of my comments, but this time, I think MUGG deserves thanks right at the top. without him, none of this would be really possible. He invented the basis for the pixel trick, he watched all of my WIPs and critiqued them, and was my main motivational drive to finish this run.

A note about improvements

The improvements in this movie were largely due to two tricks. The pixel trick, and the pipe glitch. Both saved enormous amounts of time during the run.

The timer

There is a timer in this game which increments by one every frame, whether you are on the map screen, or playing a level. The only times that it does not increase, are the frames where there is lag. The timer controls how Mario accelerates, and determines which frames Mario can use the pixel trick It also controls enemy movement/acceleration, spin jumping graphics, and I wouldn’t be surprised if it controlled Mario’s running animations as well. Since it rolls over levels, and is so intrinsically linked to Mario’s speed, this makes things like hex editing virtually impossible, unless you happen to enter a level on the same frame (mod 8).

The pixel trick

This little gem, originally discovered by MUGG allows for an 8.3% increase in speed on average in ideal situations. Originally, it was performed by repeatedly ducking, however, later experimentation proved that ducking was not required to perform the trick. After some more experimentation it was discovered that the pixel trick could be done in the air as well as on land, and some further improvements were made which meant that on land, the pixel trick could be accomplished absolutely invisibly. The glitch works because it abuses the weird speed calculation method in Super Mario Land 2.
Super Mario Land 2 does not have subpixels, So if the programmers wanted to have a speed of 1.5 pixels per second, then they would need to oscillate between two pixels per second and one pixel per second. Alternatively, more complicated speeds such as 1.125 pixels per second, an 0.75 pixels per second can also be achieved through various different oscillations for example speeds of (1,2,1,1,1,1,1,1) and (1,0,1,1,1,0,1,1) are on average 1.125 pixels per frame and 0.75 pixels per frame. Basically Super Mario land 2 uses different 8 frame oscillations for all of the different speeds required in the game. (A200 is the memory address you want to watch for this, A202 is Mario's speed)
The aim of the pixel trick is to increase Mario’s speed over this regular top speed of (1,2,1,2,1,2,1,2) pixels per frame. You will notice that all the 2's are in even positions (i.e. the 2nd, 4th, 6th and 8th numbers are all 2), and all the 1's are in odd positions. The pixel trick is a way of inserting a 2 into an odd position every 8 frames, this is done by craftily switching between the oscillation (1,1,2,2,1,2,1,2) and (1,2,1,2,1,2,1,2) with perfect timing. The only limitation it seemed was that I would have to jump and land on even numbered frames. (For those wanting to TAS this game, this is an oversimplification of reality, and you should study my TAS to see how the pixel trick works and why.)

Moonwalking

Much like the Apollo missions to the moon, it turns out that it's faster for Mario to jump repeatedly while in space. This is based on Mario's funny oscillating speeds again. You can gain a pixel every time you jump using this trick. Normally, on land, Mario's speed is (1,2,1,1,1,1,1,1), but in the air, it's possible to change it to (1,1,1,1,1,1,2,1). By switching between these two oscillations every time Mario jumps or lands, you are able to save 1 pixel per jump.

The "new" pixel trick

This idea came about when I was trying to prove that the maximum time possibly saved using the pixel trick would be 1 pixel every 8 frames. The problem boiled down to whether or not you could change the number at A200 from D0 to CC in exactly four "moves" using only +4, -4 and -C, OR +8, -8 and +0. This is quite obviously impossible, as no matter how many times you apply +8, -8 and +0, you will never change D0 to CC, and if using +4, -4 and -C, you can only reach CC from D0 in odd moves. This seemed like case closed to me until I realise that if I could use all of +4, -4, -C +8, -8 and +0, the problem was gone.
Although the above paragraph makes little sense, let me try to explain. D0 and CC represent different 8 frame oscillations. If I were to be able to change between D0 and CC in exactly 4 frames, then I could save 2 pixels per 8 frames. On land, I can add or subtract 4, or subtract C from D0 once per frame. In the air, I can add or subtract 8, or keep the value the same once per frame depending on what buttons I had pressed. Normally, It would be a fair assumption that it would be impossible to be on land and in the air at the same time, so it would be fair to say that I couldn't use +4, -4, or -C along with any of +8, -8 or +0. This is of course false. If I decide to jump during the period of time where I am changing between D0 and CC, then I have the opportunity to use all of +-4, +-8, -C, and +0 within that window of time. Similarly, landing on the ground presents a similar opportunity. This would mean that I could save an entire pixel every time I jumped, much like the moonwalking technique described above.
This would logically mean that I would necessarily be jumping around as much as possible all the time. Perhaps in the future a run with this technique can be used, but for now, I enjoy the relative freedom of using a slightly outmoded version.
I must admit, I use this trick ONCE in the run: in pumpkin zone 1 near the end, it allows me to land on an odd numbered frame. However, this was just luck, and I had no real idea what had happened. I actually discovered that it could save time much later on.

The pipe glitch

If you exit a level while going down a pipe, the next time you start a level, Mario will go through the floor as if going down the pipe. Some of the time, Mario can reach some "garbage" blocks. These can be any type of blocks, and some of them can be manipulated to be exits. This can be a quick way of completing some levels.
This glitch was originally controversial, and many TASers still have it in their heads that the pipe glitch in it's entirety is an emulator bug, and not a glitch in the actual game. I assure you, the pipe glitch is very possible on a real gameboy, and the results of using the pipe glitch on the gameboy have been replicated in this movie. Later VBA versions have fixed the error that meant the pipe glitch was illegitimate. The reason that the pipe glitch was an emulator bug before was the echo RAM (E000-FDFF) was being treated as separate memory addresses to the part of RAM it was copied from (C000-DDFF). Basically what this meant before was that by default, E000-FDFF was filled entirely with 00's, which meant that when the pipe glitch was performed, Mario would encounter a wall of breakable blocks. In later versions of VBA where this bug has been fixed, Mario encounters the lower two thirds of the same level, except with no objects or enemies, and the last two lines of level are filled with garbage. Due to the layout of some levels, the pipe glitch cannot be done in those levels.

Corner boosting

Jumping so that Mario just misses the block means that you will be pushed forwards an extra pixel. However, with the pixel trick, many corner boosts cannot be done. There are three main reasons for this. The first is that because of Mario’s higher speed, sometimes he will miss the corner completely. The second reason is that sometimes, Mario will get a corner boost, but because he does, he cannot save a pixel by using the pixel trick. The third reason is that because of the limitations brought by due to the pixel trick, i.e., that you have to land and jump on even numbered frames only, that the level design sometimes prohibits Mario getting a corner boost.

Swimming

I’m assuming that this is why a lot of time was lost in previous runs of SML2. Sometimes, the top speed in water is (1,2,1,1,1,1,1,1). Sometimes it is (1,1,1,1,1,l,1,1). This is completely dependant on what frame you start accelerating in water. It is ALWAYS favourable to get the (1,2,1,1,1,1,1,1) oscillation over the other one, and sometimes frames need to be sacrificed in order to get that oscillation in water.

The bell glitch.

This is only used in space world to skip an autoscroller. Basically, if you exit a level using start/select on the same frame that you get an object, the object will activate itself on the next level. So by activating a bell on space world 1, and then entering space world 2, I activate the bell in space world 2. As soon as I die, I then start from the halfway point.

Accelerating faster

You can accelerate faster in the air compared to on land. That’s why I usually do a small jump at the start of each level. I don’t do a jump right at the start, since you can’t get running speed in the air. You need to get to a certain speed on the ground before you can jump.

Decelerating faster

Instead of just pressing the opposite direction, it’s faster to stop if you press forwards without pressing B for one frame before pressing the other direction. Pressing a direction without B will instantly slow Mario down to walking speed.

The route

The route was initially made by MUGG. I tested a number of different routes around the overworld but none of them that I found were faster. Initially I was planning to do macro zone before tree zone at the end, so I could initiate the pipe glitch in macro zone, instead of trekking back to pumpkin zone. This would have been a few hundred frames faster. Unfortunately, I found that completing the secret exit in macro zone does not count as a level completion, and you need to have a level completion in order to exit a level prematurely, which is required for the pipe glitch. This meant that the route logically came back to MUGG’s original plan.
Another "improvement" to MUGG’s route would have been to use the pipe in Mario zone in order to skip the levels in turtle zone. Unfortunately, this was slower as well.

ROM version

I use the US version of the game. This will make a lot of people happy. For some reason, Soulrivers thought that the glitch that made bosses disappear off screen quicker was exclusive to the J versionn. This is not the case. Not only that, Soulriver’s V1 and V2 synch on the US version as well as the J version.

99 kills

As soon as Mario kills 100 enemies, a starman powerup will appear. This is useful in wario’s castle when you need to quickly dispose of the weird ball things.

The score

I don’t know about you, but although I like the tune of SML2, I also like variety. The same song, or variants of it are played in every single level without fail. I think after SMB1, Nintendo decided that they would be in this for the long haul, and so they decided to conserve music, and only use one track per game.
Well, anyway, enjoy the run!

klmz: Hi, I am aderikato. I have replaced the movie with a new one 27 frames faster by the same author.

Nach: Fantastic job. Good usage of bugs in the game. Much more polished than the last TAS of this game. Accepting.

Flygon: Processing with my über dial-up powers.
Last Edited by Flygon on 7/7/2010 8:30 PM
Page History Latest diff List referrers