Introduction

I always thought I wouldn't do a save-corruption run of this game. The fact that there is so little room for improvement that all runs would basically look the same, the fact that the published movie was done on a now-obsoleted emulator known to lag less so that every new run will likely appear slower, and also the bad submission history are not exactly inviting to take on this category.
After jlun2 raised my interest in save corruption lately, I experimented with the different game versions, and stumbled over a 10 frame improvement for the current Yellow run by optimized menuing (details below). But it felt cheap submitting a run like this, so I decided to look for more improvements, a different route that might be even faster and is worth submitting. After spending way too much time on it and many disappointing routes (I had an alternative Yellow route that is exactly 2 frames slower and a Red route that is 3 frames slower), I was about ready to give up and submit the 10 frame improvement (now with a little more confidence in its optimality) when I finally got it working. In the end it was a fun challenge, it basically comes down to a logic puzzle at this point that you need to solve, rather than playing a game.

Categories

  • Aims for fastest completion of the game
  • Heavy glitch abuse
  • Manipulates luck
  • Corrupts save data
  • Corrupts memory
Used emulator: BizHawk 1.8.0 (syncs on 1.1.0 - 1.6.1 and 1.8.0+)

About the run

Goal choice

This run tries to finish the game as fast as possible, with no restrictions.

Emulator Choice

This movie uses the pre-1.7 frame timing and syncs on all pre-1.7 versions as well as 1.8 which allows to adjust the timing method. Note that the emulator used in the published movie had less lag (due to emulation inaccuracies), which makes the total times not directly comparable. It can be best compared with Masterjun's submission, which is a re-sync of the published movie, making this run 66 frames faster.

Version Choice

I did quite a lot of testing with every Gen I version I could find. Firstly, the save corruption and the following memory corruption to end the game is possible in all of them, I'm pretty sure every single one can be beaten in less than 2 minutes. While the save corruption part is the same in all versions, the following memory manipulation to trigger the end of the game differs and makes some versions faster than others, due to differences in how the game memory is laid out.
The major difference is the memory alignment, separating between Japanese and non-Japanese versions. The general organization of the RAM is the same in all versions, but Japanese names only take up 6 bytes, while non-Japanese take up 11 bytes. This shifts all following data differently, and also makes switching the party Pokémon around behave differently (since the nickname and the OT name are being swapped as well). This happens to make getting the right bytes to the right places more difficult in the Japanese version, since the length of the Pokémon data (44), the length of the name (6) data and the length of the item data (2) are not relative prime, which means it's not possible to get any byte to any address just by switching these. It turns out to be a major problem for all Japanese versions, which makes their manipulation slower than the non-Japanese versions. (It's not impossible, though, you can always toss items or use the 1st Pokémon slot and use the species list to do exact byte manipulations.)
Since the relevant ROM addresses are the same for all international releases, the only question left is whether to use Yellow or Red/Blue. This really just came down to whichever version happens to have the faster route: R/B allows for more menuing optimizations and has a faster startup sequence, while Yellow's memory manipulation is easier. For the longest time I thought that Yellow would be faster, until I finally found a quick route for R/B, that turned out to be even faster.

How skipping to the end works

When resetting the game while saving, it is possible to end up with a loadable save state where the complete party Pokémon data is filled with 0xff. This makes the game think we have 255 Pokémon in your party, which allows us to swap Pokémon after the 6th and thereby manipulate the following RAM areas. Specifically, we can change the ID of the current map (at $d35e) and the pointer to the map script (at $d36e) to execute the Hall of Fame cutscene and end the game right away.
The Hall of Fame code is the same in all versions of the game, but can be located at different places inside the ROM. There are two possible ways to jump into it, either calling the HallofFameRoomScript to run the full cutscene (as seen in the current publication), or by jumping directly into HallofFameRoomScript2, which starts the Dex rating sequence immediately (as seen here). Note that it's not possible to jump any further into the sequence, such as executing the credits directly, since the ending bit of HallofFameRoomScript2 is actually needed to finish off the game as expected, by restarting after a button press (otherwise it would loop in the credits like seen here).

Memory manipulation mechanics

Memory manipulation will happen mostly by switching Pokémon in your party. When two Pokémon A and B are swapped, four things happen in this order:
  • The species is swapped (1 byte): $d164 + A <-> $d164 + B
  • The Pokémon data is swapped (44 bytes): $d16b + 44*A <-> $d16b + 44*B
  • The Pokémon OT name is swapped (11 bytes): $d273 + 11* A <-> $d273 + 11*B
  • The Pokémon nickname is swapped (11 bytes): $d2b5 + 11*A <-> $d2b5 + 11*B
Note that these memory areas are exactly back to back with 6 Pokémon in your party. With more than 6, however, they overlap, which can lead to some memory segments being moved around multiple times during one swapping operation, and allows more sophisticated memory manipulation.
Our goal is to change the following addresses:
  • The map script pointer at $d36e, which is affected by the 12th Pokémon data or the 23rd OT name or the 17th nickname
  • The current map ID $d35e, which is affected by the 12th Pokémon data or the 22nd OT name or the 16th nickname

Optimizations

This run uses a lot of minor time savers, especially while menuing, most of which involve pressing multiple buttons on the same frame.
In most menus, the game allows you to press the up/down key together with the A key to move one element while simultaneously confirming, saving some frames (the concrete amount depends on the scroll lag of the menu). This seems so obvious that I was quite embarrassed to find out about it only as of lately. Note that this only works in R/B and not in Yellow.
In some menus (specifically the item menu in this run), you can scroll faster by pressing other keys while scrolling up/down. This works because the game only checks for some newly pressed key, not the up/down key specifically. That means by pressing left and right alternatingly while holding up/down, you can save a frame for each scrolled item compared to tapping the up/down key. This does work in Yellow as well (and would by itself allow for a 10 frame improvement over the published movie).

Route

Intro

  • The Trainer ID is manipulated to be 0x64bd, which is used as the map script address later. Other values work as well, this one is the fastest to manipulate, costing 17 extra frames. This is the only luck manipulation in this run, and brute-forcing it accounts for over 99% of the run's rerecords.
  • The player is given a default name ("RED"), it is not relevant in this run.
  • The enemy is also given the default name "JOHN". Part of the name will be later scrolled through in the item menu, and JOHN causes less lag frames, saving 30 frames over the second-fastest option "GARY".
  • After the intro, the game is immediately save-corrupted and loaded up again.

Memory manipulation

  • Before the memory manipulation is started, I take a step downward. This changes the block-relative y coordinate from 0 to 1, reducing item scroll lag and therefore saving 8 frames.
  • First, the 4th Pokémon is switched with the 13th. This does not do any immediate good for us, but prepares important memory areas, specifically filling the 13th Pokémon data with all 0xff (from the save-corrupted 4th data) and filling the 4th nickname with all 0s (from the empty item list).
  • Next, swapping the 11th and the 12th. This moves all interesting bytes (including the manipulated Trainer ID) into the item data.
  • Next, swapping the 10th and the 13th. This uses the first preparation swap to do two things: It sets the item count to 16 (allowing us to swap items around) and it sets the number of caught Pokémon to 64 (which is important for Oak's Dex evaluation text).
  • Now, the items are moved around: the 1st item, containing what will later be the map ID 0xcf, is moved to slot 5, and the 3rd item, containing one half of the trainer ID, is moved to slot 13 to align it with the script pointer.
  • Using to more swaps (17 with 22 and 23 with 18), the aligned bytes are put in the right places, ending up with a map ID of 0xcf and a script pointer of 0x64bd.
  • After the menu is closed, everything is set up and the input file ends. Everything after this point does not need any inputs.

The end

  • Map 0xcf is the 2nd floor of the Silph Co. building, which happens to be on the same ROM bank (0x16) as the Hall of Fame room, so the script pointer 0x64bd executes code at $16:64bd, which is inside the HallofFameRoomScript2, starting the Dex rating sequence immediately.
  • Even though we have 255 Pokémon in our party, the first species is set to 0xff so that none are registered in the Hall of Fame.
  • The number of caught Pokémon is 64, which causes an Oak text that doesn't require any button presses. Also, it seems the first line was one character too long, and the translators thought "Hmm, what to do... I know! Let's remove one 't' from the word 'getting' nobody will ever notice". I guess I should be thankful, since this run depends on this text not being any longer :D

Noxxa: Judging.
Noxxa: Accepting as an improvement to the published movie.
Spikestuff: Publishing. Meow~


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15577
Location: 127.0.0.1
This topic is for the purpose of discussing #4431: MrWint's GB Pokémon: Red Version "save glitch" in 01:09.95
Experienced player (584)
Joined: 2/23/2008
Posts: 266
Location: CA, USA
I always knew those gold teeth had magic powers. Well done, yes vote!
Spikestuff
They/Them
Editor, Publisher, Expert player (2642)
Joined: 10/12/2011
Posts: 6438
Location: The land down under.
Oh so we are having Red to obsolete Yellow. Interesting. I'm giving it a yes... Now do see if you can update Green.... please.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 5/14/2007
Posts: 525
Location: Pisces-Cetus filament
So you have broken this game even further? I didn't expect it at all, so this has been a nice surprise. Also, I really like the fact this run was done on Pokémon Red Version. I suggest this screenshot:
hegyak wrote:
Walking down stairs is for losers. Winners just walk through their TV and then win.
AzumaK wrote: I swear my 1 year old daughter's favorite TASVideo is your R4MI run :3 xxNKxx wrote: ok thanks handsome feos :D Help improving TASVideos!
Active player (476)
Joined: 2/1/2014
Posts: 928
Temporary Encode: Link to video
Noxxa
They/Them
Moderator, Expert player (4124)
Joined: 8/14/2009
Posts: 4090
Location: The Netherlands
Zeupar wrote:
hegyak wrote:
Walking down stairs is for losers. Winners just walk through their TV and then win.
Pssh, walking through the TV before winning is passé. Taking a single step towards the window before declaring that you win is the new thing.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Joined: 11/20/2011
Posts: 27
Location: UK
Yes, for breaking the game once more. This should be quoted "This is getting even better!"
Ford
He/Him
Joined: 3/5/2013
Posts: 183
Location: California
lol if you continue to emulate this game after the victory screen, loading the saved game causes the game to almost immediately reset! That's awesome!
Joined: 12/29/2007
Posts: 489
^What causes that? Does "reset" mean "force the game back to the title screen" or "delete the save file"?
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
Ford wrote:
lol if you continue to emulate this game after the victory screen, loading the saved game causes the game to almost immediately reset! That's awesome!
Something similar happens in symphony of the night game end glitch/arbitrary code execution. After the credits play, you go back to the main menu, and your save file is now a clear file - if you try and load it right away (without reseting first), the game crashes.
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Great job improving a highly optimized run! Yes vote.
Zeupar wrote:
I suggest this screenshot:
As good as that frame would be for a screenshot, a publication screenshot has to be from the movie itself. Something like the glitched item menu at 3928 would probably suffice.
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
Color me surprised. I really did not expect that Red would be faster, even with the 0xc5 map ID at the right bank there which you don't need to manipulate into the data (and so you can use the whole trainer ID to do the precise jump to the last cutscene). I guess that was because I always used the SGB mode, oh well... Also, good time save with the menus. Yes vote.
Joined: 5/14/2007
Posts: 525
Location: Pisces-Cetus filament
CoolKirby wrote:
Zeupar wrote:
I suggest this screenshot:
As good as that frame would be for a screenshot, a publication screenshot has to be from the movie itself. Something like the glitched item menu at 3928 would probably suffice.
Are you completely sure about that? Is that stated anywhere? In any case, exceptions to every rule can and will be made. I would like to think this site isn't so stupidly pedantic about such a minor detail.
AzumaK wrote: I swear my 1 year old daughter's favorite TASVideo is your R4MI run :3 xxNKxx wrote: ok thanks handsome feos :D Help improving TASVideos!
Skilled player (1741)
Joined: 9/17/2009
Posts: 4981
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
This was unexpected. :o
It turns out to be a major problem for all Japanese versions, which makes their manipulation slower than the non-Japanese versions. (It's not impossible, though, you can always toss items or use the 1st Pokémon slot and use the species list to do exact byte manipulations.)
Does this mean the Green TAS can be obsoleted by this until a more entertaining version of it be made (not sure how, but hey, everyone also thought Yellow was fastest so...)
In some menus (specifically the item menu in this run), you can scroll faster by pressing other keys while scrolling up/down. This works because the game only checks for some newly pressed key, not the up/down key specifically. That means by pressing left and right alternatingly while holding up/down, you can save a frame for each scrolled item compared to tapping the up/down key. This does work in Yellow as well (and would by itself allow for a 10 frame improvement over the published movie).
Is that a new trick discovered for this TAS alone or for R/B/Y? Has it been/Does it apply to the other TASes?
Zeupar wrote:
So you have broken this game even further? I didn't expect it at all, so this has been a nice surprise. Also, I really like the fact this run was done on Pokémon Red Version. I suggest this screenshot:
I'm not sure if that can be used since it's post TAS, but maybe as an alt screenshot? It's hilarious given the context. lol
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Zeupar wrote:
Are you completely sure about that? Is that stated anywhere?
Maybe it's not a rule listed anywhere, but there has been some discussion about it (here, for example), and it seems at least a couple of publishers (the ones who put up the screenshots) believe it should be from the movie file. Also, a screenshot needs to follow these guidelines:
* Pick a screenshot that represents the movie or the game well. * It should give an idea of the genre of the game and the movie to an audience who doesn't know the game. * If the movie is atypical to the game (a highly glitched movie for example), the screenshot should display something atypical happening, but without conflicting with the earlier guidelines.
We don't want a screenshot that requires knowledge of the previous run to understand. I suggested 3928 because an item menu is typical of an RPG, and glitched graphics are typical of a highly glitched movie, so I feel it represents both the game and the movie well, especially to those who aren't familiar with the game (but can tell that those tiles aren't supposed to be there).
Zowayix wrote:
^What causes that? Does "reset" mean "force the game back to the title screen" or "delete the save file"?
The game loads the save and then resets to the copyright intro about a second later. The save file is still there when you return to the screen, and you can keep attempting to load it though it doesn't seem to ever open.
Joined: 12/29/2007
Posts: 489
^But there's nothing in that screenshot that would particularly differentiate it from the numerous other Pokemon Gen I videos that also abuse a glitched inventory. Screenshots are best when they substantially attract both someone with a minimal knowledge of the game and someone with a full knowledge of the game, if such a thing is possible (and here, it is). For example, the previous save corruption run (on Yellow) is a screencap of the "1 error." message, which has never appeared in any Pokemon submission before. In this case, I would fully support using the "geting even better" screenshot, as it 1) shows that the game has been beaten in 0 minutes, which is enough to attract the attention of someone with a passing knowledge 2) shows a different Pokedex completion message than any other SRAM glitch video, which is enough to attract the attention of those familiar with previous SRAM glitch runs 3) to top it off, contains a meta-reference to the goal of TASVideos itself, and has a strange typo to boot Using a glitched inventory screen would manage to reach goal (1), but would be boring and unattractive in the case of (2). It's similar to this movie (the recently published Gotta Catch 'Em All one). The publication screenshot used to be a simple Missingno. screenshot, which while a very well-known glitch from the early Red/Blue days, simply isn't anything special that shows off any of the newly discovered glitches abused in the run. The publication screenshot now shows off the Cooltrainer move display glitch, which bizarrely allows the player to encounter one species of Pokemon yet catch a different one, and has never been shown off before. This fits much better. --- Edit: On another note, there has already been at least one instance where a screenshot not from the TAS itself was used as the publication screenshot: The publication and its screenshot The actual scene Unfortunately I cannot find the exact post as it was from many years ago, but Bisqwit admitted to editing the screenshot to adjust the text box, Kamek, and the Naval Piranha's position so some elements would be framed better. No one complained. --- v Edit #2: "1 error." isn't the Pokedex rating; it looks like a failsafe string from where the game cannot load Oak's Hall of Fame speech. All previous SRAM glitch movies have used the 152-caught glitchy rating, which is the "TM8 TM8 nROCKET8 8 V8 iz $t 1 d" one.
Spikestuff
They/Them
Editor, Publisher, Expert player (2642)
Joined: 10/12/2011
Posts: 6438
Location: The land down under.
In the case of using that image as the screenshot I don't like it. All the other Pokemon TASes which actually had the 1 error (+ extra) could've been used as a screenshot but they weren't. Having just a plain one just doesn't seem interesting.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 5/14/2007
Posts: 525
Location: Pisces-Cetus filament
Meh, I guess it's time to fight pedantry with pedantry. -_-
CoolKirby wrote:
Zeupar wrote:
Are you completely sure about that? Is that stated anywhere?
Maybe it's not a rule listed anywhere, but there has been some discussion about it (here, for example), and it seems at least a couple of publishers (the ones who put up the screenshots) believe it should be from the movie file.
What two publishers? I only see one sharing your pedantic stance (that being ThatGugaWhoAgree, no less!). Anyway, don't you think coming up with good arguments for why screenshots shouldn't be taken after input (especially in this particular case) would be better than "HERP DERP, 2 publizeups agre with mah so imma r8, even thought dem 'proof' i Linc don't back it up"?
Also, a screenshot needs to follow these guidelines:
* Pick a screenshot that represents the movie or the game well. * It should give an idea of the genre of the game and the movie to an audience who doesn't know the game. * If the movie is atypical to the game (a highly glitched movie for example), the screenshot should display something atypical happening, but without conflicting with the earlier guidelines.
I'm well aware of those guidelines. Plenty of published movies feature screenshots I have suggested. Hell, I even created this page. Do I really need to list exceptions that have been made to every one of those points?
We don't want a screenshot that requires knowledge of the previous run to understand.
It doesn't. It's not necessary to be impressed by that screenshot. Just look at the second rectangle closely. By the way, I recommend you being careful when using sentences starting with "we don't want".
CoolKirby wrote:
Zeupar wrote:
I suggest this screenshot:
As good as that frame would be for a screenshot, a publication screenshot has to be from the movie itself.
CoolKirby wrote:
We don't want a screenshot that requires knowledge of the previous run to understand.
Those two quotes don't compute. Do you think it would be good or not? I'm confused. :/
I suggested 3928 because an item menu is typical of an RPG, and glitched graphics are typical of a highly glitched movie, so I feel it represents both the game and the movie well, especially to those who aren't familiar with the game (but can tell that those tiles aren't supposed to be there).
Yeah, and it's also typical to use Pokémon screenshots displaying garbled graphics. In fact, it's so typical it's pretty boring at this point.
Zowayix wrote:
In this case, I would fully support using the "geting even better" screenshot, as it 1) shows that the game has been beaten in 0 minutes, which is enough to attract the attention of someone with a passing knowledge 2) shows a different Pokedex completion message than any other SRAM glitch video, which is enough to attract the attention of those familiar with previous SRAM glitch runs 3) to top it off, contains a meta-reference to the goal of TASVideos itself, and has a strange typo to boot
Thank you very much for that list. You saved me some time. I thought the merits of my suggestion were evident, but apparently some people are too focused on being nitpicky to look at images. Anyway, I feel bad for turning this awesome run's discussion thread into this shit, so I won't post here anymore.
AzumaK wrote: I swear my 1 year old daughter's favorite TASVideo is your R4MI run :3 xxNKxx wrote: ok thanks handsome feos :D Help improving TASVideos!
ars4326
He/Him
Experienced player (777)
Joined: 12/8/2012
Posts: 706
Location: Missouri, USA
I like that suggested screenshot since it goes well with the context behind the TAS. If the screenshot rules aren't rigid in this area, I think it would be a good eye-catcher on the front page.
"But as it is written, Eye hath not seen, nor ear heard, neither have entered into the heart of man, the things which God hath prepared for them that love him." - 1 Corinthians 2:9
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
I agree with Zeupar. The screenshot is not part of the input, but it’s part of the movie; what does it matter if the input ends earlier? Great job on the improvement, MrWint. But I’m sad to hear such an obvious menuing optimization went unfound with all the drama surrounding the previous submission.
Zarmakuizz
He/Him
Joined: 10/12/2013
Posts: 279
Location: France
I support the screenshot suggested by Zeupar. It's really catchy, and the Prof Oak's commentary combined with the time and money completion is funny. Let's not forget that the only gameplay we saw from that movie was menus manipulation, and almost every game has menus, so showing a menu means nothing about the game itself. On top of that, starting the final sequence straight from the starting room is boss. Obvious yes vote.
Player (146)
Joined: 7/16/2009
Posts: 686
Nice work on this, yes vote. I also like Zeupar's suggested screenshot.
Noxxa
They/Them
Moderator, Expert player (4124)
Joined: 8/14/2009
Posts: 4090
Location: The Netherlands
Yeah, I also agree with the suggestion of the "Ho! This is geting even better!" screenshot.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Techokami
He/Him
Joined: 6/23/2008
Posts: 160
Aw, I liked the "catching 152 Pokemon with ERROR" ending :( Yes vote nonetheless!
Experienced player (588)
Joined: 2/5/2011
Posts: 1417
Location: France
Yes vote, GG
Current: Rayman 3 maybe? idk xD Paused: N64 Rayman 2 (with Funnyhair) GBA SMA 4 : E Reader (With TehSeven) TASVideos is like a quicksand, you get in, but you cannot quit the sand