Submission #3203: p4wn3r & Mukki's SGB Pokémon: Red/Green/Blue/Yellow Version "Gotta Catch 'Em All!" in 3:20:46.17

Super Game Boy
(Submitted: Pokémon Blue)
Gotta Catch 'Em All!
VBA-rr v22
722770
60
267861
Unknown
Pokemon - Blue Version (UE).gb
Submitted by Mukki on 6/30/2011 9:12:53 PM
Submission Comments
-?zcrEV: Hi Mom, I'm going out on a quest!
MOM: Sounds interesting. What are you going to do?
-?zcrEV: I'm going to become the world's strongest trainer and catch every single pokemon in this region.
MOM: OK, but be back for dinner.

Foreword

We're proud to present the final result of our work, a movie of the American version of one of the two games that launched one of the most successful franchises in the world. Pokémon Blue has a long tradition of glitch research and countless hacks of it have been made through the years. With all this background, it's one of the most traditional RPGs in tool-assistance, with several publications in TASVideos.org
This movie aims to obtain 151 pokémon registered in the Pokédex and complete the game using only "light" glitches (we'll elaborate better on this later in the submission). The purpose of this is to show many aspects of the game, as full completion runs are supposed to do, using a sufficiently precise definition of the goals to avoid being arbitrary. Regarding the abuse of programming errors, it's an unfortunate reality that a game starts spawning many categories when it achieves some TAS maturity, the goals we achieve are impossible to do without glitches, while exploiting the game's flaws to its fullest would completely kill the purpose of the movie and make it too similar to other existing publications.

SPOILERS AHEAD

Now, we may proceed to the tale of -?zcrEV, the boy who managed to complete the research of a renowned professor in around 200 minutes, doing things that apparently make no sense like constantly fleeing from trainer battles, importuning an old man to teach him to catch a Weedle when he already had over 100 species caught and throwing poke balls at bunches of garbage blocks. Witnesses appear to have seen him cycling over water and rooftops, but that's not confirmed. What is known, however, is that he bears no respect to guards and is constantly sneaking into areas of restricted access and is also accused of entering the prestigious Pokémon League having only six badges, while the required amount is eight. Nevertheless, he has the respect from Prof. Oak, who considers him a caring trainer, despite the fact that he only uses his lv100 pokemon (that got there by an unseen form of training) and his methods to obtain pokémon are less legit than those of Team Rocket (which he didn't even bother defeating) and lets most of his pokémon rot in a computer box shortly after forcing them to eat dozens of Rare Candies.
  • Aims for fastest completion of the game and relevant sidequests
  • Heavy glitch abuse
  • Heavy luck manipulation
  • Takes damage to save time
  • Uses death as a shortcut
  • Contains speed-entertainment tradeoffs
  • Uses VBA-rr v22
  • "100% completion"

Glitches and exploits

  • Trainer-Fly
Simply the most important and most useful glitch in the game, it's more known for allowing the player to catch Mew. Given the actual circumstances necessary for the bug to happen, one constantly wonders how the glitch was found. However, the name of its discoverer is, like Jack DeVries from IGN says, a mystery for the ages. There are references in the internet containing the description of the method to catch Mew since May 2002, but at the time, this was probably considered one more of the countless rumors that existed that made catching Mew possible, and it was unnoticed until it was posted in a GameFAQs board by TheScythe in April 2003. It shocked the pokemon community at the time. Shortly after, White Cat deduced enough of the glitch's mechanism, which allowed one to catch any pokemon in the game, in this aspect, this run is a little late, coming eight years after this challenge was proven possible. The implications of the Trainer-Fly glitch also allow a lot of shortcuts and sequence breaks.
To do it, walk in front of a trainer that can see you from the maximum distance possible, open the menu and use a warp move, like Fly, Dig, Teleport or Escape Rope. The trainer will notice you but you'll have warped before he has a chance to battle you. After this, your buttons are frozen and your actions are very limited, it's impossible to open the menu, for example. You can restore them by entering a trainer battle, letting the trainer walk at least one step to fight you (the game will lock up if you talk or walk directly in front of the trainer). When you return to the area you canceled the battle, your menu will open by itself and upon closing it, you'll face a wild pokemon whose ID will equal the special stat of the last pokemon you fought (or more precisely, its remainder by 256).
This happens because the game uses the same memory region to store the next battle you'll face and the stats of the last pokemon battle. When you return to a region where you used Trainer-Fly, the game will try to resume the canceled battle, even if the previous values were already overwritten with something else. The species is determined by the special stat of the last pokemon and the level by its Attack modifier, a number from 1 to 13 that it initially set to 7 and reduces when Growl is used and increased when Swords Dance is used.
During the making of this run, it was revealed to us by Potato Stomper that Trainer-Fly can be initiated a little earlier than in the current route by fainting from a wild encounter taken on the step that a trainer would be fought. We were already late in the movie when we took notice of this and it wasn't rigorously tested, but it seems that the extra time taken to do this variant of the glitch is likely too big to compensate for the benefits of an earlier Trainer-Fly.
Additionally, some legendary battles, like the Articuno one, seem to mess up Trainer-Fly. We found this out the hard way...
  • Old Man glitch
Trainer-Fly may be more useful, but this is certainly more famous, it was discovered by countless people shortly after the release of the games. It was fixed in the subsequent Pokémon Yellow. It works by talking to the Old Man who shows you how to catch a Weedle. After this event, the game replaces your name with Old Man and puts your original one in the list of pokemon wild encounters for the current area so that it can retrieve it. This is extremely crappy programming but it works because you talk to him in a city area and there's no tall grass in Viridian City. Besides, it's overwritten when you enter a route that has tall grass, so there shouldn't be a problem. However, they made a mistake in the east Cinnabar coast, there are encounters there but instead of looking at data for water routes, the game uses the data for tall grass. It's now easy to exploit this, talk to the Old Man, your name goes to wild data, fly to Cinnabar, you haven't passed through tall grass areas and your name is still there, get yourself an encounter at the coast and you can have a battle with a pokemon defined by your name. Most of the alphabet characters will generate Missingno., that's how this glitch pokemon was first found. Today, it's one of the most famous video game glitches.
To find which pokemon you'll encounter, it's sufficient to look at the IDs of your name's characters and know that the 1st character in the name doesn't matter (it's probably a sentinel in the list), the 3rd, 5th and 7th determine species and the 2nd, 4th and 6th determine levels. For implementation reason, the name contains twelve characters, although only eight are necessary, the unused ones will be filled with zeros, that give the glitch pokemon 'M.
  • Item duplication glitch
Directly related to the glitch above, when you encounter a glitch pokemon, like Missingno. or 'M, the item on your sixth slot will have more 128 copies of it, no one knows for sure why this happens. Players often use this to get more Master Balls. From a TAS perspective, however, every ball is a Master Ball, so we use this once to clone Pokéballs so that we don't need to get money to buy them and twice to clone Rare Candies, which we use to quickly level up our pokémon.
  • Experience underflow glitch
We don't know who originally discovered it to give credit, it was brought to TASers' attention by dfhuiwefhdasasasas, this allows us to destroy story battles easily. There are four formulas that control level-ups in this game. It's only important to know the one for fading growth pokémon, which is this one: E = 1.2L³ - 15L² + 100L - 140
Notice that for L=1, E=-53.8, the game truncates this to -54. Experience should never be negative but L1 pokémon aren't supposed to exist as well, so apparently no problem. However, with Trainer-Fly we can get a pokemon at level 1 by using Growl on the opponent six times to lower its Attack modifier to 1. The consequence is that the number containing experience will underflow, it'll contain the max experience it can hold minus 54. Since it's a 3-byte integer, that means over 16 million exp points, more than enough to surpass the L100 cap. However, the game will only check experience again when your pokemon gains experience, so the only caution necessary is to give it 53 points or less and the game will innocently give it an astounding L1-100 level up.
One should be careful to never let a pokemon at L0 or L1 in a box, as the game will freeze when it's withdrawn. We also found this out the hard way...
  • Pewter Skip glitch
Found by hanzou, this one releases us from the obligation to fight Brock, since his badge is not checked when going to the league with the walk through walls glitch. To perform it, cancel the conversation with the Pewter guard using B, this gives you time to open the menu and save the game. Reset, when the game reloads he'll walk away, thinking he already took you to Brock's gym. Now simply hold right and you'll progress to Mt. Moon.
  • Snorlax skip glitch
There's a moment in the game where the player is supposed to obtain a Poké Flute to wake up a Snorlax to gain access to Fuschia or take a long way through Rock Tunnel to arrive in Lavender. None of this happens here. Snazzypadgett from SDA reported that after performing Trainer-Fly, Snorlax had disappeared. Shortly after, many were able to reproduce this glitch and sequence break the game. It happens because Trainer-Fly is basically a simulation of a legendary battle. Every legendary battle is hard coded to eliminate the missable object at the first position of the list in the current area. This is done to prevent the player from repeating the fight, obviously, and assumes that the first missable object is the legendary pokemon, carefully put there by the programmers.
When you change areas, the list of missables is only updated if the new area has any missables on it. Now it's simple to use it to move Snorlax out of the way. First, enter the area of Snorlax and perform Trainer-Fly without ever walking through places with missables, enter the glitched battle. The game then will look at Snorlax data on the missable list and remove it so you can pass. One just needs to be careful to not get wild encounters, as they will cause the game to allocate much memory to start the battle, overwriting the list.
  • Cloning trick
A recurring trick in the pokemon series, present in the first, second and third generations. Often hidden by other bugs in 1st gen, and by the fact that the timing needs to be more exact. For a TASer, the timing presents no challenge whatsoever. The trick is to save the game and deposit a pokemon of the party in a PC box and do a box switch. The game will require you to save to do this. When it starts saving, however, it saves first the box configuration, so if you reset the game at the right point, your box will suffer alterations but your party won't. The consequence is that the pokémon deposited will be present in the box and in your party, thus being cloned. We use it to clone Eevee and Poliwhril.
  • Walk through walls glitch
Developed by hanzou, this is the most sequence breaking glitch in the run. It's a variation of the Glitch City bug, but much more useful. First, enter Safari Zone, try to leave it and say No when the clerk asks if you want to leave. Save and reset the game, when you try to leave the clerk will think you're trying to get in and ask if you want to enter. Say No again and leave it. Now, you're still under the 500 step counter, you just can't see it and will be called back by the P.A. when it runs out. The key here is to get ding-dong'ed mid-air, while you're jumping off a ledge. When you get called back, you can walk through walls. However, upon exiting the building, you'll lose that ability. The solution is to faint from poison inside there, you respawn at a Pokecenter and can walk though walls in the overworld. However, when you enter a house or face a trainer you lose that ability, so careful planning is needed.
We use this bug to visit Cinnabar before getting Surf, sneak into Sabrina's gym without beating the rockets at Silph, get inside Unknown Dungeon before beating the league and finally to get to Indigo Plateau having only six badges.
  • Luck Manipulation
The RNG in this game is a pain to manipulate because it uses a hardware register for entropy and it's nearly impossible to track its behavior, in order to do this run, we relied on some brute force Lua scripts. Annoyingly, there's a bug with VBA that will cause desyncs when a script loads a savestate, so even with the script in control, we had to do manual rerecords. Luck is extensively manipulated, from everything to critical hits, damage variation and, especially, random encounters. There are many instances where we need a certain special stat on a pokémon to use Trainer-Fly for another, so even their DVs (values that cause differentiation on the stats of Pokémon) needed to be manipulated at times. In other cases, it was required that we caught the pokémon at highest level of an area, to minimize Rare Candies. Often this caused the probability of them showing up to be 1/256, the overall rarest event manipulated here is the Tentacool encounter. An encounter on the first step in a water tile is 5/256, getting a L40 Tentacool is 1/256, and having the right DVs is 1/16, for a grand total of 5/1048576.
In order to manipulate it, we used some knowledge of RNG mechanics, like the "D-sum". Although the RNG behaves chaotically, the sum of the two bytes tends to steadily increase or steadily decrease, depending if you're on a battle or in the overworld, since the species and level of pokemon encountered is closely related to this sum, we can get some expectation on what we'll find by getting this value in the appropriate range.
The only other aspect worth mentioning is the annoying 3-step rule, that doesn't let a wild encounter happen unless you walk a minimum of three steps since the last battle.

Speed-Entertainment tradeoffs

  • Banning strong glitches
This game's poor programming allows for severe exploits. Practically any goal imposed could be achieved by using them, it would reduce a lot of the movie's length but would give little similarity to a high completion movie, so we chose to not use them. Those bugs generally involve using save corruption or the ZZAZZ glitch to explode the inventory counter, giving access to important parts of RAM. It's even possible to program in the game, because there's a way to force the game to call the function you want. One who knows GB opcodes could stuff a loop that overwrites pokedex addresses in RAM and force the game to call that function, for example. Given the impact on gameplay this has, it was banned here.
  • Avoiding the near-death sound
When your pokémon is in critical status (red health bar), a warning sound starts. When this warning is playing, the game doesn't play pokémon cries and battles go much faster. However, it's impossible to tolerate three hours with that noise on, so we didn't use it.
  • Route planning
This is a pretty extensive subject and one we spent a lot of time on. It's near impossible to verify the optimality of a route and small changes to it may introduce gains in time, adding this to the fact that this is the first submission for this category and there was a lot of groundwork to be done makes planning very hard.
The complicated part comes from the amazing amount of pokémon that need to be glitched in order to complete the pokedex, Trainer-Fly is the main tool we have for this and it requires fighting opponents with a given special stat, however some stats are very high, making it impossible to find in the wild. And even the ones that can be found are somewhat tricky to plan their order without screwing up your progression through the game.
To overcome this difficulty, we used a bot that took all pokemon data in the game from wild encounters and trainer battles and ran a simulation of their stats to find which pokémon they triggered, with this it was significantly easier to plan things out, we found a lot that could be glitched by careful manipulation of the DVs. However, the situation remained the same for pokemon with very high IDs. The standard mathod people use for this is to raise a pokemon until it has the necessary stats, let a Ditto transform into it and do the glitch. This, however, is slow, our alternative here is to carefully choose the protagonist's name so that it generates hard to get pokemon with the Old Man glitch. Here, ?z generates a L230 Oddish, which, with the right DVs can be used to glitch a Machamp, cr gives a L162 Squirtle that's used to glitch a Porygon and EV generates a L131 Alakazam that's used to glitch an Ekans.
There were other potential candidates for this glitching procedure, but the Old Man method is still very slow because we need to visit him every time we do the glitch, initially there were seven repetitions of this, using alternative methods to catch hard pokémon we saw that by visiting Unknown Dungeon we could reduce this and through the cloning trick, only three (the minimum) repetitions are required. We are very content with the final route, as it turned up efficient and interesting to watch.
We could flood the submission with the route details we discussed. Our PM box is filled with them, but since we don't want the submission text to be excessively long, we intend to release a subtitle Lua script to be played with the movie.

Special thanks

Everyone that contributed a little to the weird science that's glitching deserves recognition, the total time of this is much less than people at the time of Trainer-fly's discovery would expect. Also, during the making of this movie, many people expressed full support of this run, bumping the R/B thread when we were late with updates, or asking us on IRC about the progress. Most of this was done in a very busy period of our lives and we consider it a victory to have finished such a big project. A special mention goes to the japanese community, one of our WIPs was uploaded to nicovideo and, despite lasting almost an hour, hit more than 100000 views, that was the greatest encouragement we could ever hope for.
Those that offered direct help were:
  • primorial#soup - He attempted a "catch'em all" run much time ago, when most tricks here weren't available, his discontinued WIP was the only startup for a TAS that we had.
  • Thomaz - We discussed some ideas, he had gone really far on a real-time speedrun, but unfortunately had to cancel due to a deleted segment, he restarted it and is currently working on it, his progress can be seen in his Youtube channel. Good luck, man! We look forward to your run.
  • upokecenter.org - We used this site a lot to look up the data we needed in order to plan the run and execute luck manipulation.

Suggested screenshot

[dead link removed]

Nach: So this run annoyed me. I was in middle of a date with this cool lifeguard type, when I had to be interrupted to review and judge this run - which may explain the bias I'm about to elaborate on.
This run is long, repetitive, and a bit boring. For entertainment rating, it should get a 0.1 score. But it seems everyone in the discussion thread loved its strange technicalities so much that it somehow gets a perfect 10. So despite my personal feelings, I look at this from afar, and I sense an oncoming fight approaching if I reject it. I'm probably better off running away, growling about it a bit, then doing something random and pleasantly unexpected.
I guess I'm forced to admit that the route planning was quite thorough and well executed, to TAS precision, which is not something you see every day. I'd give it that, the run fits TASing like a pair of nice and comfy shorts. This run is also the only Pokemon TAS we've had that actually completes the objective that appears on the box, a nice touch. It also had nice shock value, like when you go to sleep in middle of the road, only to wake up elsewhere and finding yourself with some strangely named kid pelting you with whatever stone equivalent he has handy.
So even though this run is toxic, and you need an announcement in conjunction with it, I went into judging this run all thirsty, but for some reason I'm just not thirsty anymore. I guess I'll have to let it through.

Brandon: Publication underway.
Last Edited by adelikat on 9/22/2023 2:48 PM
Page History Latest diff List referrers