Posts for entrpntr


Experienced Forum User
Joined: 7/10/2016
Posts: 10
EDIT: Never mind, there was a mistake in my routing, you're still outsped.
entrpntr wrote:
Minor possible routing improvement: I took a quick look at the Tauros part of the route, and it appears with a 15 speed DV Tauros, you are speedtied with Agatha's first Gengar at L44. This makes the Rare Candy appear unnecessary at first blush. It's not clear if you considered this, because you actually don't achieve the speedtie on your original route (Viridian Rival's Blastoise team gives less speed stat exp, and it just happens to matter in this situation). Benefit: - Not having to use the Rare Candy (or swap it up in the inventory) Drawback: - 1 bad levelup (after Lance's Dragonite) Not sure if I missed something because I mostly just glanced through the battle scenarios, but that stuck out as a very plausible time save.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
It warms my heart to see this TAS. Red/Blue always seemed like the most fertile ground of the Gen 1-2 glitchless runs to test out alternative routes, and I was disappointed when only Nidoran was pursued originally. Some notes from the RTA perspective:
  • For mainswitching, the Safari poke of choice was usually L33 Nidorino (then immediately evolved into Nidoking). Clefable had also been considered by some as an intermezzo between Squirtle and Nidoking; certainly interesting to see it came out a bit faster in a TAS setting.
  • Leaving aside the question of RNG manipulation, the biggest issue for non-Nidoking pokes has been "safe redbar" for the lategame. Nidoking is rather uniquely suited to keep redbar for the entire lategame, due to several places with consistent AI abuse to help setup on fights. (Tauros has some additional issues, being underlevelled and vulnerable to encounters in Celadon Mansion and Victory Road.)
  • Here is at least 1 Squirtle -> Tauros run on the JPN boards: https://www.speedrun.com/pkmnredblue/run/mexnr22z
Out of curiosity, did you attempt a full-game Nidoran TAS? I wouldn't be entirely surprised if there were 52 seconds to save on the published TAS from fully bruteforcing the luck manipulation, but from the writeup it seems like it would have run counter to your objectives with this TAS. (Edit: TiKevin83 says he'd estimate 15-20 seconds from bruteforcing, and he'd know better than me.) Regardless, as someone whose foray into speedrunning was attempting to break up the "tyranny" of the Nidoran route, I'm happy to see this as the route that made it to the workbench. There are a lot of creative routing ideas out there for Red/Blue Glitchless in particular, and this hopefully will inspire more of them.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
I'm not too likely to search for a faster one, but it's not impossible I'll give it a try. That bit of knowledge about the bootrom only became "complete" a few months ago. Thought I should mention it before anything was submitted, and it's probably good to have the idea documented in general.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
There are also options for inputs in the bootrom that only delay by cycles rather than frames. There are 6 unique RNG outcomes without wasting any frames, described below by the "methods" to achieve them: (1) no inputs in bootrom (as is done in the posted userfile) (2) "tapping a palette" (press and release) at first possible input window in the bootrom (3) pressing/holding one of A/B/Start/Select in the bootrom (4) "holding a palette" through the bootrom The last two are complicated to explain; the easiest way to achieve them involves (a) holding a dpad button in the first possible input (frames 0-11 in TAStudio), (b) specific inputs during a 16 frame window in the middle of the bootrom (frames 70-85 in TAStudio): (5) Hold the dpad input through the bootrom, add A or B as a held input starting sometime between frames 70-85 and hold it until the end of the bootrom (6) Hold the dpad input during frames 0-11, release it frame 12, hold dpad input again starting from frames 70-85 and hold it until the end of the bootrom Hopefully I explained the methods well enough. There are other ways to achieve the same RNG as one method or another, but ultimately there are only 6 unique cycle offsets to exit the bootrom from without losing frames. Also worth noting that for GBC, method 2 results in unique "RNG", and for GBA, method 3 results in unique "RNG". Since GBC in GBA bootrom is just +4 cycles compared to GBC, the other methods have a correlate between the two platforms, as all methods finish the bootrom at consecutive multiples of 4 cycles apart (fwiw, the order of fastest to slowest method is 2->6->1->4->5->3, but I think that's just "luck" in where it escapes the final waitloop in the bootrom). This also means we could verify that previous userfile (or most other GBC movies) for GBC-in-GBA; method 1 in GBC matches method 6 in GBA, for instance. (For TAS, this stuff really only matters for the Red/Blue "SRAM glitch" run to my knowledge, since TID is the only hard luck manip requirement that exists. For RTA, this consistent source of variance is a blessing.)
Experienced Forum User
Joined: 7/10/2016
Posts: 10
Alyosha wrote:
There are 4 places you can delay to do TID manipulation, from masterjun's old submission here are the values we want for the second byte (the birst one needs to be 0x64): 0x11, 0x13, 0x15, 0x16, 0x17, 0x1A, 0x1B, 0x1D, 0x5A, 0x71, 0x76, 0xCF, 0xD0 and 0xEA. Also in Mrwint's submission we see that 0xBD is possible as well.
These are specific to the Pokémon Yellow TAS menu swaps; those are map ids for maps in bank $16 (2nd byte gets swapped to current map where the Hall of Fame scripts are located). For the Pokémon Red/Blue TAS menu swaps, the 2nd byte of the TID is used as part the map script address (map still in bank $16, but it's set from other memory). The 2nd byte can be one of: 0xBB, 0xBD, 0xBE, 0xC1, 0xC2, 0xC3, 0xC6. The following image shows why: Note that 0xBB is 3 frames slower than the others due to the Delay3. Also 0xC3 will leave the A and B buttons disabled, so you need the shortest Hall of Fame Text (TAS timing aims for this anyway so that inputs stop earlier). Predef $55 corresponds to HallOfFamePC.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
Interesting, I definitely had different numbers in mind for the timesave. The Rock Tunnel one in particular; I guess that one is only big in Gold, since there are 4 trainers on Route 9 (so the Rock Tunnel route is taken instead). Still, I thought Abra was a consideration at one point for Crystal RTA; I can't figure out why it would be with your reported numbers. The technical note on AI definitely doesn't matter so much, and I figured you might catch it by how your brute forcing works. The AI decides its move between turns, so it's possible something on the final turn leaks back into previous turns, but I imagine you search enough to avoid any significant frame loss. Anyway, it's one of the more non-obvious things to account for in a Gen 2 TAS, which is the only reason I mentioned it. I guess one other note: not sure how much hard luck manip there is in the run, but adding A presses to overworld movement doesn't lose frames in Gen 2 (most of the time) and can affect RNG relatively significantly in a handful of settings (e.g. it offsets the subframe Random calls if you press A on the tile you load a random NPC). Again, probably doesn't yield a whole lot of frames saved, but probably can't hurt to include in your searches, if you aren't already.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
Very cool to see this TAS has been made. The Alfred thing, as well as the Victory Road rival are both obvious optimizations over what RTA routes currently do; I'm not sure how no one had caught them, but fresh eyes are always nice for these things.
MrWint wrote:
It would be interesting to hear about the different strategies that were considered. Since I made this basically in a bubble, I only used and tested the strategies I could come up with, and I can tell you whether I actually tested it and determined it being slower or just not thought about it at all.
I had given some thoughts to gifvex and TiKevin83 when they brought up a Crystal glitchless TAS before, but I would have bet the losing end of both the Totodile/Cyndaquil and Entei/Raikou decisions. I hadn't put a whole lot of thought in to either though; only that getting Hidden Power for Raikou (as the RTA route does) would be slower than Entei for TAS. But Raikou appears to lose far less time in battles than I would have guessed without Hidden Power. One idea I don't see mentioned is catching an Abra, which I'm almost certain is faster. You get to save 1 trip from Goldenrod <-> Route 36 (teleport to Violet after Squirtbottle most likely), and you can enter the center next to Rock Tunnel to teleport there later on for the EXPN Card quest. I don't know which Kanto route is faster; you can go through Rock Tunnel instead of Route 9, which puts you right next to the center, but you fight a different trainer going that route (Hiker Jim's Machamp instead of Camper Dean's Golduck). If I get a chance, I'll try to take a deeper look to see if anything else stands out, but catching Abra is the only obvious thing I can see right now.
MrWint wrote:
I did some testing for any sprite lag differences when investigating this because I thought something like this could be the case, but I couldn't find any conclusive evidence. Girl was faster some of the time, Boy was faster other times. Just because I couldn't find any bias in my tests doesn't mean it doesn't exist of course, just that it's hard to control for all the other variables, and any effect is likely very subtle.
The specific lag is backsprite lag in battle, since the girl's backsprite is not compressed, and doesn't need to be decompressed. Luckytyphlosion indicated in the past that this did result in taking a frame longer for the boy each instance, but I am not 100% sure how he came to that conclusion. One other minor note, that your botting setup may take care of anyway, is that switching AI is bugged (due to CheckTypeMatchup), and code flow depends on the type of the move the AI selected (rather than the player's type). In some cases, this can cause the amount of lag to vary by up to 6-7 frames after the player selects a move (FindEnemyMonsThatResistPlayer and FindAliveEnemyMonsWithASuperEffectiveMove are computation-intensive routines that may or may not be triggered). I'm not actually sure which battles are relevant in the route, but at least being aware of this may help avoid losing frames in a handful of places.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
^ I'll chime in to give a bit more clarity to what's going on in the above run (which has already been beaten). I have a mostly tenuous grasp on the mechanics, but hopefully the explanation is sound. Glitch maestro luckytyphlosion was re-visiting an old item of intrigue to him this weekend, and discovered an exploit based on string printing and faulty error checking in mobile code that was introduced in Crystal (the exploit doesn't exist in Gold/Silver). I'll paraphrase his explanation:
Char15 calls some mobile function which lands on a jumptable: https://github.com/pret/pokecrystal/blob/51bad5a606d7b2e8f72638a3c688e9792ca60944/misc/mobile_5f.asm#L3732. It has some error checking defined, but it missed the case for 0. The dec a is after the cp $10 so it'll read a garbage jumptable address, which conveniently jumps to 0:cd52 To have Char15 printed, we corrupt the Pokémon nicknames as early as Cherrygrove so there's no terminator, and thus it will read past the allocated memory for the Pokémon nickname on the Pokémon screen. And through magic, we set up a $15 $00 in memory through some item tosses to have the game jump to cd52. Conveniently, the game eventually reaches a ret nz that will always be there and will always be executed. Even more conveniently, Game Freak pushed the address of the string buffer address onto the stack before executing the jumptable (so it could pop it off when the function is reached). And even more conveniently, the memory right after the memory address where we set the $15 $00 is the TempMon.
Cyndaquil is used as the nickname-corrupted clone, as it is most expedient in exploiting the glitch. By having its move order be Tackle/Smokescreen/Leer and a trainer ID of either 09947 ($26db) or 09979 ($26fb), we end up executing code that looks like:
ld hl, 2b6c
...
ld h, db
This sets hl to db6c (or fb6c), which is just before box names in wram. By having Cyndaquil's experience set to exactly 233 ($e9), the game calls jp hl, and thus we get classic Gen 2 ACE through our mischievously renamed boxes. The final piece: we "pretend" to toss 21 Antidotes to get 0x15 into wItemQuantityChangeBuffer, select CANCEL to exit the item menu (which puts 0x00 into wItemQuantityBuffer) and then check the clone's stats to trigger the Char15 exploit and execute the game-breaking code we wrote out in box names. (EDIT: The reason this doesn't work in Gold/Silver is because the GS string printing code terminates if it hits a 0x00 character. This changed in Crystal, which prints ?, and thus allows for the game to continue reading past the buffer into the 0x15 0x00 character.) As a side note that may be of interest to tasvideos, the bright minds over at PSR have worked in recent months to patch libgambatte for RNG accuracy on Gen 1/2 Pokémon games with respect to official consoles. These RNG patches in conjunction with MrWint's JNI libgambatte bridge have allowed us to efficiently find several RNG manipulations that are RTA viable. The TID manipulation used for this run was found through one such bruteforce search; the hunt for a 1/32768 TID would likely not have been too pleasant otherwise.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
Yeah, there is only the concept of eggs, no bad eggs (nor "glitch eggs" as Bulbapedia seems to think). Eggs are coded with a species number of 253 (0xFD); this value normally only exists in party/box metadata, and the Pokémon that comes out of the egg is determined by the species byte in the Pokémon's data struct. The run abuses the 7 Pokémon trick to change a Pokémon's species byte value to 0xFD, and abuses the daycare to reset the metadata and turn something into an egg (it's the same mechanism that is popularly used to turn Sneasel into Celebi). Using TM36 calls somewhere in ROM code (specifically, $698a in bank 3) that leads into the "throw Pokéball" function, and the catch animation plays out with garbled graphics from the item menu. It should act like a standard catch; I have tried a couple hundred times to catch something but haven't been successful yet. Someone else who was testing this out said they were able to successfully catch a Bulbasaur after fighting a trainer whose final Pokémon was Bulbasaur. At best, this would have limited applicability for a TAS (same goes for the glitch Pokédex mode), but I figured I would mention it for the sake of completion.
Experienced Forum User
Joined: 7/10/2016
Posts: 10
grassini wrote:
are there tricks enough to do a legit complete pokedéx with one game only?One of the tricks used to get coin case ACE doesn't register the pokémon but i remember the bad egg corruption did make it possible(beat up sneasels trick) so i can only imagine these being possible with gold or silver.What are the limitations? (i'm asking both for a speedrun or playthrough,i remember beatin blue using ditto tricks and trainer fly for pokémon who were unacessible)
I hadn't realized this had been discussed on tasvideos until randomly poking around the forums today, but yes there are enough tricks to catch all 251 Pokémon (without ACE or Pokédex flag corruption). I did an initial, mistake-ridden RTA run with a preliminary route on Gold version last month that finished in 10:57:28 (Twitch VOD). The main glitch for acquiring Pokémon is the standard Celebi trick concept (using index values of items/moves and shifting them into the species byte), with an extra step thrown in to turn the Pokémon into an egg (hatching means it gets registered into the Pokédex). Even when glitching for minimum egg cycles (hatch within 256 steps), this trick is slow enough that it appears to be clearly not worth it for most Pokémon, at least as far as RTA is concerned. The combination of an instant victory glitch (by abusing a Pokémon with species 0xFF) and a map distortion glitch (using TM47 from the key items or balls pocket) allow the player to skip most of the game content. The run I linked only completed 4 gym badges and defeats exactly 1 trainer legitimately after reaching the daycare. Those corruptions follow from a standard bad clone / key item underflow / key items pocket glitch procedure that allows the player to perform the 7 Pokémon trick, obtain any item of their choosing, and perform other assorted glitches. Off the top of my head, there were two glitches that lacked real-time viability, but could potentially be useful for a TAS: (1) Setting the Pokédex mode ($d67e) to $D8 allows you to trigger some ROM code that writes $46 to a whole bunch of memory locations, and can achieve some massive map corruption; (2) using TM36 from the key items or balls pocket triggers some ROM code that throws a ball outside of battle, and apparently can allow you to catch the previous enemy Pokémon fought, which the player might otherwise not have convenient access to (there appeared to be an extremely low chance to catch something without RNG abuse at the player's disposal). I am skeptical that a TAS applying current knowledge would be very entertaining, but it also should not be an extraordinarily long run (I imagine it could clock in somewhere around the 150 glitchless co-op TAS time). Besides the two glitches mentioned above, there are a number of additional possibilities with the 7 Pokémon trick by virtue of having precise knowledge and control of Pokémon data. I am guessing a TAS would still minimize use of the Celebi trick, as the setup is rather slow and you have full control over the Pokémon you encounter in the wild. If someone is interested enough to look into TASing the category, I'd be happy to do whatever I can to help out. Luckytyphlosion and I compiled an abundance of information over on the PSR wiki (link), though a lot of it may not be pertinent for a tool-assisted run.