Game: Super Mario Flash
Platform: Flash
Version: 3.0 (The 2.0 and other versions lack certain levels, 3.0 is the final version of the game ever released)
Super Mario Flash is a flash game popular for its level editor. When it was released, Super Mario Maker did not yet exist, so this was the best way to create and share Mario levels. Within the speedrun community, the game is also famous for its brutally hard single-player built in levels. The ten levels test a player's skill and reaction time to the limit, and the simplicity of the physics has led to some extremely optimized records. Now, I have taken the optimization to a level above what humans are capable of replicating.
!! Game objectives
- Complete the game as fast as possible. This is defined as triggering Princess Peach's dialogue after Koopa Castle, the final level.
!! Game rules
- Forgoes the use of Permanent Invincibility Glitch.
- Forgoes the use of [
https://www.speedrun.com/super_mario_flash/guide/ey2aa | speed glitch].
- Forgoes the use of the cheats menu. While the game tells you how to access the cheats menu, the run becomes equivalent to good menuing followed by a Koopa Castle level speedrun.
!! Notes
- Takes damage to save time
!! How this TAS was made
This game is made using Flash, and so no external tools exist to TAS it, with the possible exception of [
https://github.com/clementgallet/libTAS | libTAS]. However, I was unable to use libTAS with this game. Instead, I made my own TAS tool by decompiling the code of the practice hack made by ThePianoEnthusiast (available on the [
https://discordapp.com/invite/b6nm2dj | SMF speedrun discord]). I added the capacity to play back a given set of inputs, but no tools such as savestates or slowdown were used in the making of this TAS.
!! Changes made to the game
I started with the practice tool rather than a fresh .swf of the game because of the limitations imposed by the JPEXS flash decompiler (certain expressions such as the [
https://en.wikipedia.org/wiki/%3F: | ternary operator] could not compile, so they were replaced with equivalent if/else statements).
Other changes made to the game include:
- Adding an array of inputs that the game reads from every frame, instead of polling the keyboard.
- The ability to automatically enter levels (This could not be done with the input array as Flash does not support global classes, so this fix was needed instead)
- Removing collision with hammers from Hammer Bros. and Bowser (Since random number generation using Flash is not the same every time the same inputs are played, this workaround was needed to make the TAS play back with 100% consistency)
- Similarly, some values that are normally random have been set to fixed quantities (for example, by giving Level 5 Bowser maximal delays, he doesn't appear at all)
- Bowser in Koopa Castle was immobilized to allow the TAS to get past him consistently.
!! How to run this TAS
First, you should download the standalone flash player pinned in #general in the [
https://discordapp.com/invite/b6nm2dj | SMF speedrun discord]. Next, open the TAS .swf with the standalone flash exe.
Once you do so, you need to quickly click on "1 Player Game", then pick a character. I recommend Luigi since the timing to click on Mario is much harder.
If you miss this timing, you can press control+R to try again.
If Mario/Luigi walks down on the overworld and then stops moving, you timed the start fast enough. If he either doesn't move or moves down and then immediately left, you should try again.
The TAS will now play itself, with no input needed, until the end of Level 5. After grabbing the axe, hold down the space bar until Mario opens the chest next to Toad.
There are two more inputs required by a human to finish the TAS, both of them to enter Passage 1. (Yes, there are two levels called Passage 1, more on that below.) After finishing level 9, hold down the space bar until Mario enters the pipe. If you hear a "bonk" sound on the overworld, you did this wrong and you'll have to try again. (I know, this is quite painful, but I couldn't get Mario to enter pipes automatically without re-entering pipes immediately.) The same needs to be done for the second Passage 1. Note that you can't just buffer a space press after finishing the level/entering the pipe, as that will cause you to re-enter that same level. Personally, I use the overworld music as an audio cue to start pressing space.
Once you've entered Koopa Castle (assuming you've done everything correctly), the TAS will run itself, and no further input is needed.
!! Final time
Using a video editor and frame counting, the final time was precisely determied to be 8:23.884 with TASvideos timing (8:21:43 using RTA timing).
!! Rerecord count
I did not have a way to keep track of the rerecord count since I was not using an emulator, but I would estimate that making the tools and TASing the game took about a month when put together.
!! Comments
The route used in this TAS was the same one used by the [
https://www.speedrun.com/super_mario_flash/run/z57d54nm | speedrun world record]. Mario plays Levels 1 and 2 as small, and picks up a mushroom and fire flower in Level 3. Since we have to wait for a moving platform to be reachable, we can grab both powerups while waiting, therefore avoiding the need to slow down to do so. Fire is used until Level 9 to clear out enemies in Mario's path, saving a few seconds. In room 1 of the Koopa Castle, Mario damage-boosts past a fire bar and a koopa, saving about half a second over waiting of the fire bar to move out of the way. A mushroom is picked up in room 2, allowing us to damage-boost past another firebar in room 3, saving about 1.46 seconds. The rest of the level is played as small Mario.
Both characters are identical, so picking Mario or Luigi has no impact on the final time RTA. However, Luigi is in a better spot, so he can be selected before Mario on the character select screen, saving a bit of time with reset timing.
!! Stage by stage comments
! Level 1
The underground section of Level 1 was used to save a few seconds over taking the above-ground route. After leaving the underground section, Mario performs three frame-perfect jumps in a row to avoid hitting an enemy and to get a 7-block jump, saving about a second.
! Level 2
Level 2 is significantly more challenging than Level 1, since it requires Mario to slow down and corner boost. Since Mario runs at 6 pixels per frame and the first elevator platform has an early cycle with a 2-pixel window, Mario needs to slow down slightly before loading the elevator to make it onto the earliest platform, saving 0.3 seconds. If Mario jumps into the corner of a block from below, he gets pushed forward up to 7 pixels. This was used only on the block before the final pipe, since any other corner boosts would throw off Mario's pixel alignment, causing him to have to slow down more. After going through the pipe, Mario does a frame perfect koopa bounce to avoid slowing down, saving 0.3 seconds.
! Level 3
Level 3 is another challenging level, as it includes corner boosts, turnbacks to grab powerups, and platform movement. Near the start of the level, a slowdown is required to clear the pipe jump, and then a turnback is needed to obtain the mushroom. When on the platform, Mario needs to jump off from as far to the left as possible at full speed (since riding platforms is slightly slower than walking). For the fire flower grab, Mario walks over to the right side of the bricks each time, since going left would despawn the platform, costing some extra time. Mario also jumps on the flying koopas at the end of the level to skip using the platform. This was also attempted with the koopa on the first platform, however, he is too far from the platform for Mario to make the jump. At the end of the level, Mario performs a bullet jump instead of waiting for the bullet to pass, saving about 0.3 seconds.
! Level 4
Level 4 is not particularly challenging. As Fire Mario, we cannot do a corner boost under the cannon platform (our hitbox is taller, so the corner boost timing is different, causing Mario to fall into the gap after a successful corner boost).
! Level 5
Level 5 requires corner boosts, slowdowns, and platform optimization to get past. The pipe jump at the start of the level can be done faster as Big or Fire Mario, since you don't need to slow down to avoid the plants. A corner boost is used on the platform with the (?) block and again on a firebar and another (?) block before the moving platform. A final corner boost is done below the Hammer Brother.
! Level 6
Level 6 is quite challenging when done in real time, but less so when completed with TAS tools. It is possible to go under the blocks at the start (instead of the over route), however this causes Mario's pixel alignment to be incorrect, slowing down the ending stairs. A corner boost is used on the (?) block before the platform with a red koopa and a cannon. At the end of the level, a slowdown is required to get past the stairs.
! Level 7
Level 7 is another challenging level when done optimally. After the first few platforms, Mario reaches a platform with an (?) block in his path. By ducking for 2 frames, we can avoid bonking and only losing our speed. However, ducking requires Mario to only hold down (we can't hold right), so we do still lose some speed. In this level, fire is used on the three piranha plant jumps to save time, and corner boosts are used throughout to save frames. Mario once again slows down before the stairs underground, but a frame perfect koopa bounce avoids the need to slow down on the overworld stairs.
! Level 8
Level 8 is the second-most challenging level in the TAS. At the beginning of the level, a first frame jump is required to clear the koopa on the second platform. Mario has to slow down on the (?) block before the hammer brothers, and a corner boost is used after passing the koopas. Another koopa bounce is used to save 0.3 seconds compared to riding the elevator. A double koopa bounce here could save a significant amount of time, but it seems infeasible unless Mario slows down. Next, Mario spawns the horizontal and vertical moving platforms at the end of the level with a precise frame offset. By then jumping off of the vertical platform on the last frame and at full speed, and then moving right on the platform as it comes back to the left to gain a few pixels, we can jump to the final platform without needing to wait for the horizontal platform to come back, saving about 1 second.
! Level 9
Level 9 is a bit challenging, though not as much as Level 8. Mario has to turn around and climb blocks while Lakitu is throwing spinies at him. Corner boosts were used at the start of the level on the first (?) block, on the blocks after the buzzy beetles, and on the (?) block above the goombas at the end. Additional corner boosts were considered, however Mario would have to slow down to avoid dying, thus nullifying the time they would save. At the end, a slight slowdown is needed to avoid bonking on the stairs.
! Passage 1
While Passage 1 seems like a piece of cake, the first Passage 1 used requires Mario to do a 2-frame jump to get onto the brown blocks and enter the exit pipe without slowing down.
! Koopa Castle
The final level, Koopa Castle, is by far the hardest level in the TAS. In the first room, Mario has to get up into the spinning block section while losing the minimum number of frames. A damage boost allows us to get past the firebar immediately, saving a few frames over waiting for the firebar to move and killing the koopa. In room 2, we encounter a moving platform with an additional challenge: We also need to grab a mushroom here to use in the next room. A frame perfect jump is used to clear the piranha pipe and red koopa. In room 3, we do a corner boost off of the blocks the hammer brothers are standing on, and a frame perfect jump was needed to clear the gap after the bullet bill without waiting for the blaster to shoot. We also take damage on the fire bar after the gap, skipping the need to slow down. A potential skip was considered here: If we can find a way over the gap to Mario's right after he enters the pipe (potentially using a bullet bounce), we would be able to skip room 4 and go straight to room 5, saving about 20 seconds. However, the gap seems too large to be crossed, even with a good bullet bill shot and optimal speed. In room 4, a slowdown is required on the red koopa platform to avoid falling off, and an extremely difficult jump on the block that the piranha plant is on avoids the need to fall into the gap and do an extra jump, saving a significant amount of time. A corner boost on the (?) block is then used to save some additional time. In room 6, we do another corner boost. Once we clear Bowser, we walk over to the princess, thus beating the game.
!! Useful links
Video of the TAS being played back (uncommentated version): [
https://youtu.be/f-d1UCr-fAM]
Video of the TAS being played back (with audio commentary from myself, rayyaw): [
https://www.youtube.com/watch?v=5y9c3U2wcTY]
How to run flash games: [
https://www.youtube.com/watch?v=-Cr4_K53aSA]
How to play back the TAS: [
https://www.youtube.com/watch?v=BPBUEWY1GLw]
How the TAS tool was made: [
https://www.youtube.com/watch?v=YhzdfYgfTq0]
My Twitch channel (has videos of the TAS development): [
https://www.twitch.tv/rayyaw]
The Super Mario Flash Speedrun Discord, with the links to the practice hack, original game, and standalone flash player: [
https://discordapp.com/invite/b6nm2dj]
My own discord, with a download for the .swf of this TAS: [
https://discord.gg/9Ewpwyu]
For more info on this TAS, you can DM me on Discord at rayyaw#9909.
!! Other comments
This TAS may be over, but I don't feel entirely satisfied with it. I did not achieve a time of 8:19 or better (RTA timing), which was my original goal when making this. While I've optimized every section of the TAS multiple times, it is possible that more timesave will be found. Currently, the most promising timesaves seem to be a double koopa bounce in Level 8 (this is infeasible by about 3-4 pixels and would save at least a second) and skipping room 4 in Koopa Castle through the use of a bullet bounce (I've tested this, and the gap seems to be too big, but it would save 20 seconds). Other than this and maybe a few frame optimizations on things like stairs in level 6 or more corner boosts, I don't see the time going much lower, even if new tricks are found. Since this is any% glitchless, it is highly likely that new tricks would be banned from this category, leading to a TAS that will (probably) never go below 8 minutes or even 8:20. I'd love to be proven wrong though!
There's also another side to speedrunning this game, the any% category. Currently, the RTA world record is very unoptimized due to the difficulty of speed glitch, but this category seems well suited to TAS as Mario can gain hyperspeed and even clip through blocks if he goes fast enough, leading to a very entertaining showcase of the game. I do plan on making an any% TAS of this game in the future as well, but for now I'm taking a break from TASing this game.
!! Credits
Thanks to ThePianoEnthusiast for developing the practice hack
Thanks to the makers of JPEXS decompiler for making the TAS possible
Thanks to L2000, afnannen136, and ThePianoEnthusiast for contributing new strategies and inspiring me to run this game RTA (and later, to TAS it)
Thanks to 1ted59 for inspiring me to start TASing
Thanks to everyone who's supported me while I was making this TAS