Submission Text Full Submission Page
Resetting the game while saving is bad, but in a TASers point of view it can be very useful. This TAS uses this to corrupt save data and complete the game.

Game objectives

  • Emulator used: lsnes rr1-Δ17ε3
  • Heavy glitch abuse
  • Corrupts save data
  • Manipulates luck

Comments

This run uses the same strategy as the currently published run. It uses a more accurate emulator, which is the reason this run looks slower. However, if you take away the frames that are lost due to emulator differences, you can see that this run basically saves 2 frames from better luck manipulation (which also depends on the core used).

What is happening?

Resetting while saving

If you reset the game while saving it normally either doesn't let you CONTINUE at all, or it shows that The file data is destroyed, but if you reset just at the correct frame you can continue a save where every address starting from $D162 to $D2F5 is filled with 0xFF (dec 255) which will make the game think you have 255 Pokemon. Since the game normally thinks of you having only 6 Pokemon, it will overwrite other addresses when you switch Pokemon.

Important addresses

Trainer ID (2 bytes): $D358 Current map: $D35D Map function (2 bytes): $D36D
In the game code the current map will load a bank and then it will jump to the address that is stored in the map function address. If you overwrite the map address with a value that loads bank 0x16 (which are 0x11, 0x13, 0x15, 0x16, 0x17, 0x1A, 0x1B, 0x1D, 0x5A, 0x71, 0x76, 0xCF, 0xD0 and 0xEA) and then you overwrite the map function address with a value that eventually reaches the rating routine, you can finish the game. These addresses can be manipulated by switching Pokemon and Items.
To make this faster, it is possible to manipulate the Trainer ID (TID) to get the values faster. The rating routine is at 16:6439 (bank 0x16, address $6439) but the TID can only manipulate 2 bytes, the bank (in this case 0xD0) and the higher byte of the address that will be jumped to (in this case 0x64). So we currently will jump to 16:64xx. The xx will be the byte before the TID which is 0x01. Jumping to 16:6401 executes some instructions and then happens to come across 16:6439, the rating routine! Now we need to place these values, we have to move the values from:
  • $D357 to $D36D
  • $D358 to $D36E
  • $D359 to $D35D

The process

  • Swap one of the first few Pokemon, in this case the 7th, with the 10th Pokemon. This will overwrite addresses like the item count with 0xFF. Now the game thinks that you have 255 items (there is also a side effect that the Pokedex data is filled with 0xFF, so we have seen and caught 152 Pokemon).
  • Swap the 12th Pokemon with the 13th so that the 0x64 goes to $D384 and 0xD0 goes to $D385.
  • Swap the 13th Pokemon with the 11th so that the 0x64 goes to $D32C and 0xD0 goes to $D32D. Here a 11 byte data overlaps and causes 0x64 to go to $D342.
  • Swapping Pokemon always moves big chunks of bytes, swapping items makes finer steps. So move the 0xD0 from $D32D to $D331.
  • Swap the 11th Pokemon with the 12th. This causes 0xD0 to go to $D35D (current map) and the 0x64 goes to $D36E, since there is a 0x01 before the TID it is now at $D36D.
Closing the menu will make the game see the 0xD0, load bank 0x16 and thus jumps to 16:6401 which executes some instructions until it executes the rating and the credits routine starting at 16:6439.

Manipulating the TID

The TID is changed by the internal gameboy timer which only allows waiting a frame to change it. It also isn't possible to predict that value so you can only brute force the best output. The TID is determined after you chose NEW GAME so you have to wait frames before that. There are 4 different places where you can wait:
  • at the GAME FREAK scene
  • at the little running Pikachu scene
  • at the title screen
  • at the "New Game" menu.
Since I already had a version where I waited 9 frames in total I just had to test every possible way where I waited 0, 1, 2... 7 or 8 frames. The formula for a given number n of total frames I have to wait is 1/6*(n+1)(n+2)(n+3) so I just had to test 495 inputs and I didn't find any better solution. The brute force lua script for this (for Bizhawk) can be found here.
The previous run waited a total of 11 frames where this run waits only 9 frames

Other comments

Screenshots

[dead links removed]

Thanks to

p4wn3r and gia which did a great job exploring the game, optimizing the runs and finding new strategies to completely skip the game.

Noxxa: Judging.
Noxxa: This submission has led to a lot of heated discussion and debate as to what should happen if a run is "resynced" on another, superior emulator, even though it does not actually improve upon the previous run by p4wn3r. I do not consider this run a real improvement upon the previous run, because the two-frame improvement only exists because of the change in emulator core. It cannot be replicated on the same emulator as that of the previous run.
So, what to do with resyncs? I do not believe in obsoleting runs with new runs that do not contain an actual improvement - it is not fair to the original author to do so. So, I think the previous publication should remain, and thus this submission shall be rejected. There can be discussed about adding credit to Masterjun for his resync efforts in the current publication - it seems the majority of people wish for something like that to be done - but there is another topic for this discussion. I agree in giving Masterjun credit for his work in resyncing this run to the Gambatte core, and putting a note in the current publication, but it does not warrant a new publication. Rejecting this submission.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15577
Location: 127.0.0.1
Joined: 3/9/2009
Posts: 530
Active player (264)
Joined: 4/15/2010
Posts: 197
Location: England
Tangent wrote:
I have the strongest sense of deja vu. http://tasvideos.org/forum/viewtopic.php?t=13898&postdays=0&postorder=asc&start=0
This run is actually faster (not just due to emulator differences), which Masterjun put a lot of work into in order to do. Yes vote.
Retired smw-96, smw any%
Joined: 3/9/2009
Posts: 530
bahamete wrote:
Tangent wrote:
I have the strongest sense of deja vu. http://tasvideos.org/forum/viewtopic.php?t=13898&postdays=0&postorder=asc&start=0
This run is actually faster (not just due to emulator differences), which Masterjun put a lot of work into in order to do. Yes vote.
From his description, it sounds like all he did was resync it due to core differences, which happened to get to the desired RNG two frames faster. Which would mean that again, all that changed was the emulator.
Masterjun
He/Him
Site Developer, Skilled player (1987)
Joined: 10/12/2010
Posts: 1185
Location: Germany
Tangent wrote:
bahamete wrote:
Tangent wrote:
I have the strongest sense of deja vu. http://tasvideos.org/forum/viewtopic.php?t=13898&postdays=0&postorder=asc&start=0
This run is actually faster (not just due to emulator differences), which Masterjun put a lot of work into in order to do. Yes vote.
From his description, it sounds like all he did was resync it due to core differences, which happened to get to the desired RNG two frames faster. Which would mean that again, all that changed was the emulator.
yeah so?
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Experienced player (520)
Joined: 11/2/2010
Posts: 359
Masterjun wrote:
yeah so?
From the last submission
AnS wrote:
Input resyncing is not TASing. Ideally it should be done automatically, with minimum human involvement. In fact, in TAS Editor 1.0 you can already do it semi-automatically, so once it's ported to Bizhawk (TAStudio) you can expect an avalanche of dummy submissions, which take only a couple of hours to produce. This submission definitely can not be "accepted as an improvement", because it fails to beat the old record. It only makes the old record sync with another emulator, similar to how the author of NESBot had to pad FM2 movies with blank frames in order to sync with the real NES. However, such kind of submissions can be accepted as "movie conversions" (so that old authors remain, and the new author is only mentioned in the description). Well, seeing as here the new author didn't simply copy the old Input but recreated the Input while trying to improve it (thus wasting more than ~2 hours) I wouldn't object against adding him to the end of the actual authors list as a consolation. Just, when writing the judge decision, make it clear that you are not encouraging submissions that fail to improve.
Masterjun
He/Him
Site Developer, Skilled player (1987)
Joined: 10/12/2010
Posts: 1185
Location: Germany
goofydylan8 wrote:
AnS wrote:
the new author didn't simply copy the old Input but recreated the Input while trying to improve it.
And not only trying but actually improving.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Joined: 3/9/2009
Posts: 530
Masterjun wrote:
goofydylan8 wrote:
AnS wrote:
the new author didn't simply copy the old Input but recreated the Input while trying to improve it.
And not only trying but actually improving.
In specifically what way, independent of emulator choice?
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
Can you explain this a bit further: "However, if you take away the frames that are lost due to emulator differences, you can see that this run basically saves 2 frames from better luck manipulation (which also depends on the core used)." -If the core used is determined by what emulator is used, how is that frame saving/loss not also due to emulator differences? -Would you have saved a similar amount of frames if you did this TAS on the same emulator as the current submission?
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
Joined: 5/14/2007
Posts: 525
Location: Pisces-Cetus filament
This run is suboptimal anyway because the author didn't use Pokemon Stadium 2's Dodrio GB. :)
Masterjun wrote:
goofydylan8 wrote:
AnS wrote:
the new author didn't simply copy the old Input but recreated the Input while trying to improve it.
Gotta love that way to "quote" posts...
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!
mklip2001
He/Him
Editor
Joined: 6/23/2009
Posts: 2227
Location: Georgia, USA
My first reaction upon seeing the submission text was "Wait, lsnes runs Game Boy games??" I know I'm out of the loop on this, but the name of the emulator just seems badly-fitted for being the preferred emulator for GB/GBC. Anyway, good job with the improvement in technique.
Used to be a frequent submissions commenter. My new computer has had some issues running emulators, so I've been here more sporadically. Still haven't gotten around to actually TASing yet... I was going to improve Kid Dracula for GB. It seems I was beaten to it, though, with a recent awesome run by Hetfield90 and StarvinStruthers. (http://tasvideos.org/2928M.html.) Thanks to goofydylan8 for running Gargoyle's Quest 2 because I mentioned the game! (http://tasvideos.org/2001M.html) Thanks to feos and MESHUGGAH for taking up runs of Duck Tales 2 because of my old signature! Thanks also to Samsara for finishing a Treasure Master run. From the submission comments:
Shoutouts and thanks to mklip2001 for arguably being the nicest and most supportive person on the forums.
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
It looks like you want to obsolete the run on a newer emulator. Fine, you have the right to do it, but allow me to clarify stuff a little. Please don't say that you improved luck manipulation by 2 frames, I brute forced all methods and know that reset + 10 frames is optimal on VBA, and I reversed to find out that other input ways don't affect timing and have no influence. By definition of comparison, you have to be running on the same core to be able to compare the results. In this core you get delay because of extra lag, you can get away with it because you want to use a supposedly more accurate core, but I find extremely biased that you don't excuse the previous run for taking 11 frames, when you can do 9 simply because you're in a different core. You didn't improve the luck manip in the previous run because your comparison is null, I'm certain you know this, because you explicitly wrote in the submission that the difference is because of the cores. I'm asking you not to induce people who don't know about this fact to think this run features improved luck, which is what seems to be happening. I'll totally vote Yes if you can convince me that lsnes has more chances of synching an RBY movie on console. A small difference in the capacitance could introduce timer inaccuracies and make the movie desync. Also current accuracy tests to dismiss VBA are moot for RBY, since they test hardware corner cases that don't happen in RBY and sound registers that don't affect the internal game state in RBY; Also which accurate emulator is better, Bizhawk or lsnes? I suppose lsnes would make some difference if you emulate SGB, which you don't. I'll be sincere, it totally looks like you're picking cores at random to claim non-existent improvements on the published run, and I don't like the smell of that. I had a chat with turska, here's how it turned out:
<turska> p4wn3r: submissions with no improvements would generally be rejected, yes
<p4wn3r> independent of the emulator?
<turska> p4wn3r: I'd say yes
<p4wn3r> thank you
So, it's at least consistent with site policy to accept runs based on their improvements, not on the emulator they're running. I vote No.
Experienced player (588)
Joined: 2/5/2011
Posts: 1417
Location: France
YES. Just Yes
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
Joined: 2/20/2010
Posts: 209
Location: I'm in space
What I don't get is whether or not this run would be faster IRL, i.e. console-verified. If I have two GBCs, plug the previous Yellow input file into one and this into the other, and start them simultaneously, does this one get to the credits first? EDIT: Thanks Patashu and p4wn3r for the responses. I'm voting yes primarily because I figure that although the # frames saved simply by using an alternative emulator is only 2, all that really matters -- to me at least -- is that this run is faster, and *theoretically* could be console-verified, albeit in practice this would be incredibly difficult. As I understand it, the nature of the GBC hardware implies that, in general, the overall length of a GBC TAS is dependent not only on the ROM and input, but also on the host emulator's deterministic implementation of the GBC's nondeterministic elements, and therefore, this sort of emulator-only obsoletion is just going to happen every now and again. ... or maybe I've got it completely wrong. =^P
Oh, play it cool. Play it cool. Here come the space cops.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
goldfish wrote:
What I don't get is whether or not this run would be faster IRL, i.e. console-verified. If I have two GBCs, plug the previous Yellow input file into one and this into the other, and start them simultaneously, does this one get to the credits first?
There will never be a console accurate emulator (and thus never a console-verified TAS) for pokemon rby/gsc due to how insanely hardware-implementation-defined the RNG in those games is.
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
Expert player (2567)
Joined: 12/23/2007
Posts: 830
I'm a little confused. I think p4wn3r's got a point there. Will vote after someone answers Patashu's questions.
Recent projects: SMB warpless TAS (2018), SMB warpless walkathon (2019), SMB something never done before (2019), Extra Mario Bros. (best ending) (2020).
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
goldfish wrote:
What I don't get is whether or not this run would be faster IRL, i.e. console-verified. If I have two GBCs, plug the previous Yellow input file into one and this into the other, and start them simultaneously, does this one get to the credits first?
Well, what would happen is that only one run would sync until the end, or none would (probably none). The great villain is timing differences between the gameboy LCD screen and the CPU clock. The RNG routine updates a 16-bit value 4 or 5 times a frame, so it probably uses timer interrupts to work, it gets the value of a hardware timer and updates the RNG. If because of some timing inaccuracies, the RNG routine runs before an LCD interrupt when it should run after, the value of the timer will be different, and will give a different RNG. Things like that occur rarely, but in a short movie like this, there will be around 16000 RNG updates and it's very unlikely that all of them will sync with the LCD's vblank. Also, iirc, the game uses the timer uninitialized at startup and there are 65536 possible values for it. It's hard enough to get the timer right at the beginning without the LCD desynchronization. What we know is: doing a brute force to manipulate the RNG in VBA gives 11 frames, in lsnes it gives 9. Since Masterjun shared his code, I dug out my old script: http://pastebin.com/kidvX2mw (I coded it when I was learning to program, it's a bit hacky, because I also used it to manipulate battles, but mostly because there were lots of bugs with VBA's lua engine that caused desyncs, so I had to register a function, use global variables to hold state, and run an autohotkey script to press f1 periodically to load savestates). That's why I think it's not accurate to say there were improvements, it's just statistical noise from switching to another core, in a situation that's extremely unlikely to be verified. The optimization strategy for both runs is exactly the same. The only motivation for publishing it is to change the emulator used, that's all.
Joined: 3/9/2009
Posts: 530
From the other thread
Mothrayas wrote:
I personally wouldn't accept movies on new emulators that don't include any improvements to the runs themselves. That opens up a very nasty can of worms, and I've already seen posts from some users essentially stating they will exploit this, if a precedent like this is accepted. Accepting runs like that are both disrespectful to the original authors, as well as negatively impacting the site's credibility as a record compendium. After all, if runs get obsoleted by slower runs time-wise that are not faster in any way, their records just stop making any sense at all.
So it seems academic anyway unless he's changed his mind. From comments though, and at least one direct claim, people seem to think this run is meaningfully different in some way besides a slight resyncing it to a different emulator, again, which I find irksome.
Joined: 1/17/2008
Posts: 133
My vote is no, because a more accurate emulator is not used, so the slower time is not justified. As an aside, I feel it is appropriate to credit a previous author in the "by" if a substantial portion of their work and input is being used.
Masterjun
He/Him
Site Developer, Skilled player (1987)
Joined: 10/12/2010
Posts: 1185
Location: Germany
DRybes wrote:
My vote is no, because a more accurate emulator is not used, so the slower time is not justified.
cool when did the vote question change to Do you want this movie accepted? ? also lol @ not using a more accurate emulator which I totally didn't
DRybes wrote:
As an aside, I feel it is appropriate to credit a previous author in the "by" if a substantial portion of their work and input is being used.
good thing I didn't use the input.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Experienced player (690)
Joined: 2/5/2012
Posts: 1795
Location: Brasil
yes for frame advantage
I want all good TAS inside TASvideos, it's my motto. TAS i'm interested: Megaman series, specially the RPGs! Where is the mmbn1 all chips TAS we deserve? Where is the Command Mission TAS? i'm slowly moving away from TASing fighting games for speed, maybe it's time to start finding some entertainment value in TASing.
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
Tangent wrote:
From comments though, and at least one direct claim, people seem to think this run is meaningfully different in some way besides a slight resyncing it to a different emulator, again, which I find irksome.
I feel there's some extreme urge to obsolete older emus, people base this on accuracy when, at least for VBA, most arguments are simply FUD. Just look at how everyone bashed Mupen, and its SM64 movies could be verified. In the past, there used to be a clear policy that runs that differ only because of emulator differences aren't accepted, and that you should offer substantial improvements in the case of different emus. Nowadays it seems increasingly hard to get people in this site to agree that we shouldn't obsolete movies based on illusions of accuracy, and there's at least one admin post encouraging people to obsolete movies on that manner: http://tasvideos.org/forum/viewtopic.php?p=342110#342110
Masterjun wrote:
cool when did the vote question change to Do you want this movie accepted? ?
It was "Do you think this movie should be published?" before. The question as it currently stands is a joke. I'd find a video from a good stand-up comedian entertaining, not sure how that would help a judge determine if he should publish such video if it was submitted.
also lol @ not using a more accurate emulator which I totally didn't
That's right, you didn't. If you think otherwise, please link us to something that proves lsnes/bizhawk emulates this game any better than VBA. Your emulator does a lot better in sound, but it's just output stuff. You could just fix that in VBA and the published run would sync with no problems. There's a timing test that VBA fails that make some difference if you play awesome games like "Mary Kate and Ashley", but make no difference here. The timing in VBA was a lot worse in previous versions, such errors were fixed, and old RBY movies still sync if you make reset input compatible with the new version. The curious thing is that the only evidence I've come across for the claimed accuracy difference are these tests. It would be nice to know that much stuff that someone would consider critical for accuracy, like LCD screen rendering, goes wholly untested in those test sets, but let's obsolete old runs any way with emulators that have better sound. As for the difference in lag frames, I want to call attention to the difference of almost 90 seconds between the time shown in the vbm and the end of the encode of this movie: http://tasvideos.org/2824S.html This happens because VBA doesn't count frames that have no output on the LCD, but it outputs those extra frames into the encode anyway, so the encode ends up longer. I don't know how lsnes/bizhawk handle the timing, but the order of magnitude of the alleged extra lag frames could be because vba didn't count blank frames, but still would output the correct amount, and even then, no one measured the timing of the real GBC with sufficient precision, so we don't know if lsnes/bizhawk timing is correct either. It's definitely OK to criticize VBA's accuracy, but do it based on something solid so that the people who spent time improving it don't get upset. Just because a software is a tasvideos pet project that hacks a lot of independent cores together doesn't mean that it's better in any objective sense.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Good thing I didn't pick it for judging. I agree with BOTH sides!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Masterjun
He/Him
Site Developer, Skilled player (1987)
Joined: 10/12/2010
Posts: 1185
Location: Germany
If VBA is so good then why is it deprecated for TASing GBC games ?.?
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
Good question.