SM TASing crash course tutorial

From A complete guide to Super Metroid speedrunning
Jump to: navigation, search

TASing crash-course introduction/updating/resources for newer things: (from a personal message to Hoandizi)

Okay, I guess I´ll first try to get you up-to-date regarding all the new discoveries that have been made in the last few years and will link you a mass of stuff and tools (I assume you have the SMILE editor and know how to open it and quickly look through rooms, since the editor is an extremely handy tool for analysing SM hacks).



Lua Scripts and Hitbox Viewer:

On this page, one can find various Super Metroid lua scripts for emulators (on the japanese Wiki, which also has some other stuff on it, if you are interested).

In particular, the lua scripts for BizHawk are at the bottom of the page, including the hitbox viewer: Script Download openfile=SuperMetroid_HitBox2_Bizhawk.lua

Relevant Memory Addresses:

(I assume that you have used RAM Watch before and know how to use it)

Some of these following memory addresses should also be at the bottom of this page , but not all of them.

7E:090F - 7E:0910 Screen's subpixel X position

7E:0911 - 7E:0912 Screen's X position in pixels

7E:0913 - 7E:0914 Screen's subpixel Y position

7E:0915 - 7E:0916 Screen's Y position in pixels


7E:0AF6 - 7E:0AF7 Samus's X position in pixels

7E:0AF8 - 7E:0AF9 Samus's sub-pixel X position

7E:0AFA - 7E:0AFB Samus's Y position in pixels

7E:0AFC - 7E:0AFD Samus's sub-pixel Y position


7E:0B2C - 7E:0B2D Samus's vertical speed (1/65536ths pixel/frame). Unsigned

7E:0B2E - 7E:0B2F Samus's vertical speed (pixels/frame). Unsigned

- 7E:0B42 - 7E:0B43 Samus's horizontal speed forward. (pixels/frame)

7E:0B44 - 7E:0B45 Samus's horizontal speed forward (1/65536ths pixel/frame)

7E:0B46 - 7E:0B47 Samus's horizontal 'momentum' forward (pixels/frame)

7E:0B48 - 7E:0B49 Samus's horizontal 'momentum' forward (1/65536ths pixel/frame)


7E:0B64 Projectile X position in pixels

7E:0B78 Projectile Y position in pixels

7E:0B6E - 7E:0B77 Bomb X position in pixels


7E:0CD0 - 7E:0CD1 Current charge for Samus's beams

7E:0CCC - 7E:0CCD Cooldown counter


7E:18A8 - 7E:18A9 Samus's invincibility timer when hurt

7E:18AA - 7E:18AB Samus's hurt-timer (pushed back, unable to move) used for knockback Flash Suit.


7E:0643 Currently playing index of queued sound clips? For most of Samus?

7E:0644 Currently playing index of queued sound clips? For most of enemies?

7E:0645 Currently playing index of queued sound clips? Miscellaneous?

7E:0646 Current index of queued sound clips? For most of Samus?

7E:0647 Current index of queued sound clips? For most of enemies?

7E:0648 Current index of queued sound clips? Miscellaneous?

used for minimizing door load times.

It is mostly: If 7E0643 = 7E0647 and 7E0644 = 7E0647 as soon as both equal, door starts loading. And maybe in some rare cases 7E0645 = 7E0648 is needed too. Gate opening and heat damage sound are misc sounds as example, so if those are occuring then 7E0645 = 7E0648 is required.


7E:05E5 - 7E:05E6 Random Number

RNG values.


7E:0B3F Speedbooster Boost Counter

7E:0A68 - 7E:0A69 Samus's shinespark timer. Also used by crystal flash.


7E0F8C 2 bytes, unsigned First Enemy's (Most Bosses) energy


In here would be many many more useful memory addresses for different things.

For especially at the subsections "A. Samus (4A)" and "2. Movement (4A2)" and "3. Projectiles (4A3)" and "4. Bombs (4A4)" and "B. Enemies & Bosses (4B)" and "1. Current Room (4B1)".

And in here would be even more memory addresses, but it isn´t as nicely structured.


Now for the discoveries:

Rough, incomplete list of the new tricks:

  • Out of Bounds discoveries (OoB structure, Wraparound-shots, instabile blocks near the x and y axis of the room, arbitrary code execution and special OoB blocks with crazy properties, Wrongwarps and Tewtal´s Wrongwarp tool, and powerbombs explode 5 times but very slowly if one puts them at OoB)
  • ceiling-CF-clipping (with Grapple)
  • slopes allow Samus to move through them more easily than solid blocks in various circumstances
  • R(eserve)-Mode with Force-Stand property for ceiling-clips, and special behavior of CF and powerbombs in R-Mode, and faster X-Ray-Climb and enemies continue moving during Reserve-refill at the end of R-Mode
  • infinite Grapple-jumps for ceiling-clips (using sparks)
  • NTSC-PAL differences (Samus moves frame-wise faster and jumps higher in PAL)

BlueSuit methods (Gravity/Varia-BlueSuit with Bomb/PB/Grapple/X-Ray; R-Mode BlueSuit; Crystal Spark; Draygon BlueSuit methods; Rainbowbeam BlueSuit; Big Metroid BlueSuit; Elevator-Spark BlueSuit; Ceres-Ridley BlueSuit; BlueSuit via interrupted SpikeSpark variants; X-Mode BlueSuit)

  • Yellow Suit (which is basically another kind of temporary FlashSuit, which can be obtained during Varia-BlueSuit setup or X-Mode BlueSuit setup)
  • FlashSuit methods (R-Mode FlashSuit; Rainbowbeam FlashSuit; Big Metroid FlashSuit; old Draygon FlashSuit; Elevator FlashSuit; Spikespark and Slopespark variations where Samus´ feet are partially in the ground or below a frozen/solid enemy or in a door-shell; suitless Slopespark methods in water using R-Tanks or speed-echoes or BlueSuit; OoB-Elevator-CF FlashSuit)
  • Generalized Crystal Flash situations (CF can be started in very different ways and in different poses)
  • Midair Springball-jumps and chaining Springball-jumps infinitely high with IBJ-sinking, or starting it from a walljump suitless in water
  • X(-Ray)-Mode (moving completely through slopes in X-Mode; enemies cannot move during X-Mode; FlashSuit isn´t cancelled by X-Mode which allows Superjumps (more details concerning Superjumps can be found on this page: ) that boost Samus upwards with insane speeds, and storing them; heat/lava/acid doesn´t damage Samus in X-Mode; (almost) every X-Mode setup can be turned into a FlashSuit method and vice versa; entering transitions during X-Mode)
  • generalized Ice-Pixelwalk method (using frozen enemies to clip sideways through solid objects)
  • bomb-Grapple-hang teleportation using transitions
  • Grapple-bombjump-jump midair
  • G(rey)-Mode as important special case of R-Mode (every R-Mode setup allows for G-Mode; heat doesn´t hurt Samus in G-Mode and drops don´t spawn and door shells don´t open; all kinds of sand and crumble blocks and speed blocks can turn into air blocks in G-Mode if the PLM interaction-counter overflows; morphing without Morphball using G-Mode; indirect G-Mode where G-Mode is carried into a new room can prevent Gates from spawning and PLMs like Items won´t work/exist in general during indirect G-Mode; enemy projectiles cannot move in G-Mode; remote item collection)
  • snail manipulation
  • shorter TAS Short-Charges (by having Speedbooster turned off before the 1st magic frame and then turning it on; by using moonwalk before stuttering; by having Gravity off suitless in water before the 1st magic frame and then turning it on)
  • keeping the Boost counter´s value with temporary BlueSuit movement (even before having speed echoes)
  • moonwalking 1 frame before starting to run to start running with a higher initial momentum value, which especially saves a lot of time suitless in water
  • moonwalking off a platform for 1 frame without falling
  • perfect soft-unmorph/"slopekiller" to prevent slopes from slowing down Samus when running on them
  • shovel method (by perfectly soft-unmorphing into the ground via knockback, in PAL; by extending knockback-frames using R-Tanks)
  • Grapple-Supersink method to break the fall speed limit
  • Bowling Statue Skip and Spacejump Statue Skip
  • Stand-Up-Glitch via Spark
  • Rainbowbeam CF ammunition Underflow and Draygon ammunition Underflow

  • further stuff that is contained in my mega post on this page: (R-Mode light-pillar; surviving Rainbowbeam without Varia but with 5 tanks or with varia and 3 R-Tanks; floor clipping in R-Mode using a spark; spike-unmorph speedkeep with enemies instead of spikes, using R-Tanks; horizontal spark into a CF to shoot projectiles initially at high speeds in short distance; using Grapple-blocks to stand midair; paralyzing crawling enemies using Super Missiles; Grapple-Ruptur; Varia/Gravity Auto-Spark effects (also with Pause abuse and R-Tank refill); deep X-Ray-Climb inside shells to trigger transitions higher up without opening their shell; quicker "Game Over" screen by pausing when escape timer runs out; Spikespark Spinjumps midair (also with enemies using R-Tanks) and speedkeep using Spikespark jumps, and ceiling clips using Spikespark jumps and R-Tanks or Highjump and Speedbooster in PAL; speedkeep during bomb-Grapple-hanging for sparks and ceiling-clips; clipping through the ground with CF during Rainbowbeam; bomb-knockback at the ship to turnaround with temporary BlueSuit;

(I know it is tedious and takes time to go through this, but there really is important stuff listed and partially explained so I don´t need to repeat myself here)

  • "Lavakiller", i.e. preventing lava from cancelling the horizontal speed of shinesparks or Samus´ Speedbooster running speed
  • CF-Mode and its minor sound effects, which allows to keep a charged beam without holding Shot, using X-Ray
  • Door/Transition Skip methods
  • Hover-Mode to store jump speed while Samus is on ground
  • Shinespark Timer Extension (from 180 frames on NTSC up to 183 for every charged beam shot that is fired at least 4 frames before the shinespark timer runs out)
  • Using powerbombs to reduce sound processing time during door transitions in earthquake rooms
  • Bouncekiller/ball pump/soft bounce and ball hover
  • rapidfire-echoes


List of SNES9X 1.43 rr and SNES9X 1.51 rr movies that show new discoveries (for NTSC unless mentioned otherwise): (short charge that is 1.75 pixels shorter than Cpadolf´s old pattern) (short charge for PAL that is about 2.5 pixels shorter than Cpadolf´s old pattern) and and and (speedkeep and turnarounds at spike-unmorphing using moonwalk; as sidenote: Turning Moonwalk on takes 64 frames) and (comparison between normal running and initiating running via moonwalk) (combining moonwalk with Speedbooster off->on for a TAS short charge) (perfect soft-unmorph/slopekiller effect demonstration) (R-Mode FlashSuit method demonstration) (Slopespark variant where Samus´ feet are in the ground to land fast enough after a damage-boost, using bright sand) (X-Mode started using bright sand, since FlashSuit and X-Mode setups are (almost) equivalent except X-Mode can be started suitless in water without the help of speed echoes or R-Tanks) (Slopespark demonstration using a frozen enemy as stepping stone) (example of X-Mode started in water) (Slopespark using a solid enemy with Samus inside it) (the original Slopespark) and (door-shell Slopespark examples) (example of Superjump storage) (enemy Slopespark without a second knockback-source) (ground clip example for PAL, where Samus unmorphs faster) (excessive Ice-Pixelwalk and sub-pixel normalization by aligning to a frozen enemy to spark through the ceiling, in PAL) and (shovel method to clip through a thin floor) and and and (demonstrations of the Supersink method using the slopekiller state of Samus) (suitless Slopespark with BlueSuit at the end of it) (sniq´s Bowling Statue Skip) (demonstration of the Varia/Gravity FlashSuit method) (skipping the Spacejump Statue´s grab) (demonstration of the Shinespark method for Stand-Up-Glitch) (demonstration of the Draygon ammunition underflow)


Resource pages and places with visualizations and demonstrations of the new things: (mostly his latest videos demonstrate applications of new tricks) (not all, but most of these videos contain visualizations with explanations in the descriptions of new stuff) (starting from this page and so on, there are a lot of the new things listed and explained) (here are mostly discoveries concerning Out of Bounds and other major glitches)


Here is a bunch of mp4 clips that show different details or potentially interesting things: (strange refill bug heights) (Slopespark to get a FlashSuit) (Kraid lag reduction by shooting rocks and getting hurt so Samus is invisible every 2nd frame) (this shows a Slopespark variation using a door shell) (at the end in here, knockback frames are extended using Reserve-refill to get rid of invulnerability frames, for a Slopespark suitless in water) (another Slopespark variant with Reserve-refill and a Flatley-turnaround suitless in water) (damage-boost extension using bomb-knockback) (damage-boost extension using bomb-knockback and Gravityjump) (speedkeep during bomb-Grapple-hanging) and (speedkeep during bomb-Grapple-hanging to charge a spark, with direction switch) (a more complicated speedkeep setup including spike-unmorphing and moonwalk for a Spikespark) (suitless Slopespark, this time using speed-echoes to get hit 2 times in a row to extend knockback-frames) (a Superjump setup where Samus´ feet are in the ground to start X-Mode for it) (Draygon ammunition underflow example) (Ice-pixelwalk with frozen enemies to get through walls) and (using the Ice-pixelwalk principle to get into walls and combining it with the high speed of a spark with perfect release of X-Mode) (at OoB, one can create a block that gives Varia Suit (4 times) if one grapples it, and the centered pose from the Varia aquisition allows to move during Rainbowbeam) (a Slopespark example at the Zebetites) and (sniq´s funny video (but it is not a fake!) that shows that one can skip the Bowling Chozo Walk if one lets Reserves kick in during the grab, which enables free movement afterwards, but if one isn´t fast enough, Samus will be teleported back to the Chozo´s hands, and the spike blocks to the left in the ground are removed from the game while the Chozo statue is active which is why he can run down there) (activating a CF at the same time as collecting a Suit, and letting a bomb knock Samus out of that state for FlashSuit) (activating a delayed spark right before Rainbowbeam to not get forced into the crouched pose, for Stand-Up-Glitch to be able to kill MB3 faster) (suitless Slopespark using BlueSuit to extend knockback-frames)


RNG analysis:

This here describes how the random number generator calculates the next RNG value from previous ones: (it doesn´t matter much to understand what it does, though)

But it does roughly this: The RNG value at frame t+1 is given by:

r_{t+1} = 5*r_t + 273 (mod 65536) (this formula isn´t 100% accurate, but provides the correct result for all RNG values except about 700 RNG values)

The correct formula would be a bit more complicated (in its form using the game´s code):

But basically, there are 65536 different RNG values, and if one applies this RNG function to some fixed RNG value, it will produce a new one and then one can apply the RNG function to this new value and so on to get a directed path along RNG values.

And if one does this procedure for all RNG values, one will get this graph for the RNG values:

Every vertex in this graph represents 1 unique RNG value as one can see a bit more clear in this picture:

So there are 3 cycles consisting of RNG values and when the RNG arrives in those, it is caged in there (if no "XBA" happens and if no enemy forces some RNG value), and then there is many branches consisting of RNG value lists that lead into those cycles. But there is 3 enemies that force the RNG process to jump to a fixed RNG value in the graph at some fixed frame during a door transition into a room that contains such enemy. Those are: Beetoms, Sidehoppers (all kinds of them lead to the same RNG value), and Polyps (volcanic rocks). So all the RNG values have a representation in hexadecimal basis, since there is 65536 RNG values (from 00000 to 65536 - 1) and 65536= 16*16*16*16. So if variables V,W,X,Y that individually can have a value from 0 to 15, then one can represent every RNG value uniquely as 0xVWXY = V*16^3 + W*16^2 + X*16 +Y. And in this form, the RNG values that those 3 enemy types can force are:

Beetom: 0x17 = 0x0017 (where the "0x" part just means that it is a number represented with hexadecimal basis) = 1*16 + 7 = 23 = 00023 (in the range from 00000 to 65535 for the decimal/usual representation).

All Sidehopper types: 0x25 = 0x0025 = 2*16 + 5 = 00037.

Polyps: 0x11 = 0x0011 = 1*16 + 1 = 00017.

So the flow of RNG values can jump to such values when rooms with those enemies are entered. And now, there is another strange thing that can happen with the RNG, which we call "XBA behavior".

Basically for every frame in which Samus is in a room that has "Lava" or "Soda/Acid" set as its Layer 3 Type in the FX part in SMILE (i.e.: in every room with Lava or Acid in it, but not Water), the previous RNG value 0xVWXY will be swapped to 0xXYVW exactly once pre frame before anything is done with the RNG in that frame. In the graph of RNG values, this means that every RNG value 0xVWXY has a "partner" RNG value (namely 0xXYVW) with which it is connected, but the graph doesn´t show those connections because it would get very confusing. So in rooms with Lava or Acid, the flow of RNG values can jump around crazily.

So as a result, this means that in rooms without XBA behavior, he RNG can only take 1 fixed path and it can go this path slower or faster (if one e.g. kills some enemies so that drops appear which will advance the RNG), but in rooms with XBA behavior, not only the number of produced drops/killed enemies is relevant for the RNG but also in which frames those enemies were killed, because RNG can take a lot of different paths there. This means that RNG manipulation is easier (or has more freedom) in rooms with Lava or Acid.

For example, in the original game, one would get a map like this:

Blue means that no XBA behavior is happening in the room (and thus no crazy RNG value jumps).

Green (and Orange, but then not for all room states) means that XBA behavior happens in this room (due to Lava/Acid, even if it isn´t visible).

Purple (and Yellow, but then not for all room states) boxes at doors means that if one enters the room with that box from that door, then the RNG value will be set to 0x0025 (due to Sidehoppers).

Red boxes at doors means that if one enters the room with that box from that door, then the RNG value will be set to 0x0011 (due to Polyps).

Bright Blue boxes at doors means that if one enters the room with that box from that door, then the RNG value will be set to 0x0017 (due to Beetoms). - - -

Note to myself regarding all the hack TAS routes: There's this savestation glitch where Samus is facing left and crouching on the left-most pixel at which the savestation in standing pose can be triggered, and then one stands up by pressing left and saves, which puts Samus 1 tile further left from where one can x-ray-climb, so this might possibly in rare instances allow for new options.