Chamale
He/Him
Player (182)
Joined: 10/20/2006
Posts: 1355
Location: Canada
Looks excellent, good improvement and good job making the new WIP so fast. I seem to recall a discussion several pages back about speeding up the run by having Charmander not evolve, but no effective method was found. But I suppose this works as well as anything. Looking forward to the next .vbm :D
Active player (487)
Joined: 2/19/2007
Posts: 114
Very impressive. Edit: Six escape ropes? Did you miss this, or am I missing something?
Thomaz wrote:
Darn, I was play-testing with my French Yellow for some tricks and stuff and I completely forgot that the glitch city glitch wears off when entering a building (I assume that that is the reason). I visited the Old Mansion (and Escape Roped out) after leaving the Safari Zone and never got called back. ;( ... Edit: scratch that, it's the Escape Rope that resets it, leaving the Old Mansion via the other route works fine (although it doesn't give me enough steps for Blaine. ;_; )
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
Hmm. Yes, I did miss that. Shit.
primorial#soup wrote:
Here's the game plan. During the first 500 steps, bike back down to Fuschia Gym, fight Koga, and walk back out. This take 192 steps. While there, be sure to get poisoned, and to take full damage from an Explosion from Koga's Weezing. Then Fly to Celedon and do the Gym there. This take 130 steps. The rest of the steps could be used by burning off hit points biking around below the Gym there. In the meantime, bike down to Cinnibar, and then Fly to fight Sabrina, being sure to pick up poison from Sabrina's Venomoth. During the second 500 steps, do the Cinnibar mansion. This takes 222 steps. Then do Cinnibar Gym, 104 steps. Once again, a little time will need to be wasted afterwards, but I think that this is the best usage of time possible.
I plan to test this to make sure that it isn't just Pokémon Yellow specific, but it seems likely that it's not. If it is in fact the case the using Escape Rope cancels the Safari Zone glitch, I think there's only two options. The first would be to proceed as I had planned, but wait to set up the second WTW glitch until after the Cinnibar Gym. This would mean biking around for 500 steps doing absolutely nothing; there's nothing left to be done. The second would be to do the WTW glitch three times, once for Sabrina, once for Blaine, and once for Victory Road. The only time difference between these two is walking through Cinnibar Mansion, and setting up the WTW glitch an additional time. My gut feeling is that walking through the Mansion will still be significantly faster, although I'll need to take a measurement of this. Additionally, I've hit another road block. I had planned to save Bubblebeam for Mew, and complete Cerulean to Vermillion with Gyarados having just Bite, Dragon Rage, and Hydro Pump. However, Bite isn't quite as effective as I thought it would be, and is causing numerous 2HKOs where Bubblebeam didn't even need to crit. Not only does this waste a lot of time, but I won't have enough attack PP to make it the whole way. This means that I need a different TM for Mew. In order to make it through the Elite Four, it needs to be an attack with at least 10 PP, which excludes Fire Blast. Right now Psychic is looking like the best option. I had concluded that it was too far out of the way, but it looks like I'll have more than enough time to burn.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (487)
Joined: 2/19/2007
Posts: 114
Can you do the Mansion after Sabrina then initiate the second 500 steps then pick up TM whatever and do Blaine? You might want to check using dig in place of the escape rope, though that might be a bit hopeful. EDIT: A slightly more controversial suggestion might be: Don't catch a Mew, instead get a fly slave. Don't fight Koga straight away. Get Surf. Initiate the first 500 steps. Fly to Palet and surf to Cinnabar then fly back and do the coast glitch for your main battler, get the key from the mansion. Do Safron Gym. Then set up the second 500 and do the remaining three gym's (Blaine, Koga and the grass one). You loose a lot of time getting surf but you don't waste 500 steps doing nothing, plus you save on battle cry time and shouldn't need to go TM hunting. EDIT 2: Ignore this, I forgot you need a ledge to jump over...
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
TheRandomPie_IV wrote:
Can you do the Mansion after Sabrina then initiate the second 500 steps then pick up TM whatever and do Blaine?
This is quite a bit better than the two suggestions I proposed. I would have to walk out of Cinnibar Gym, but from step count, that shouldn't be a problem. I would probably do Blaine first, and then pick up the Psychic TM, considering there aren't any ledges in Cinnibar though. This also means that I have too many Escape Ropes. Fortunately, Route 3 and Mt. Moon are relatively painless. I'll take this opportunity to see if I can shave off a few frames.
TheRandomPie_IV wrote:
You might want to check using dig in place of the escape rope, though that might be a bit hopeful.
Also not a bad suggestion. I'll be testing this tonight. EDIT: Confirmed. Using either Escape Rope or Dig cancels the Safari Zone glitch, so I indeed have one too many Escape Ropes. If I didn't need to access the item menu after using the last one, I wouldn't worry about it, and just continue on from where I am, but I do, to teach Mew her last TM. New course of action will be exactly as TheRandomPie_IV suggested, to do the Mansion directly after Sabrina, and to activate the second WTW glitch after that. EDIT2: Actually, I'm going to continue from the old run. I got very unlucky on the random encounters in Mt. Moon, and I'm already 15 frames behind myself at the Gyarados roll. Buying an item you don't use may look sloppy, but not having it would have only saved 10 frames in total.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
So. I'm currently trying to manipulate an Abra encounter, and as could be expected, not having any luck whatsoever. Basically, which pokémon you see on what step is for the most part set in stone. Back when I was doing my original Mew run, I did a rather thorough analysis, and found that the only option I had was to go back and save time. In this run, I've already redone Nugget Bridge three times, saving a total of 14 frames, but it wassn't enough. On a happy note, Nugget Bridge is within 3 frames of optimal though. I was doing some experimentation to see if there was another way to manipulate this, and once I managed to shift the rotation by a significant margin. If I had been thinking clearly, I would have saved it immediately so that I could analyse what I had done, but I overwrote it because I thought I could reproduce it. I wasn't able to. I was testing the effects of holding down A while walking to the grassy area, but apparently, I must have done something else that I didn't realize. I decided to disassemble the ROM to see if I could find any clues. This is what I found:
...
78CA:F0 D4     ld   a,(FFD4)     ; FFD4 stores the number of valid pokémon for the area, times 2 minus 1
78CC:47        ld   b,a
78CD:21 18 79  ld   hl,7918
78D0:2A        ld   a,(hl)       ; load a with whatever happens to be in 7918
                                 ; NOTE! 7918 is a ROM address, not far from the code currently executing!
78D1:B8        cp   b
78D2:30 03     jr   nc,78D7      ; if a <= b, move on. if not, increment hl and try again
78D4:23        inc  hl
78D5:18 F9     jr   78D0
78D7:4E        ld   c,(hl)       ; load c with whatever hl points to (7918 + #iterations), now a value <= b
78D8:21 88 D8  ld   hl,D888      ; D888 is the current pokémon map; levels and types valid for the area
78DB:F1 5C C4  ld   a,(C45C)
78DE:FF 14     cp   14
78E0:20 03     jr   nz,78E5      ; if (C45C) == 20, use an alternate pokémon map at D845 (water?)
78E2:21 A5 D8  ld   hl,D8A5
78E5:06 00     ld   b,00
78E7:09        add  hl,bc        ; add c to hl, and use that to extract the pokémon level and type
78E8:2A        ldi  a,(hl)
78E9:EA 27 D1  ld   (D127),a     ; set pokémon level
78EC:7E        ld   a,(hl)
78ED:EA 91 CF  ld   (CF91),a     ; set pokémon type for graphics
78F0:EA D8 CF  ld   (CFD8),a     ; set pokémon type for everything else
...
So all we need to do is figure out a way to manipulate 7918, and we're set... which makes absolutely no sense, because 7918 is a ROM address and shouldn't change, right? If you want a real brainfuck, monitor this area of the ROM while walking through a grassy area. Not only does it change, but this whole region changes a lot, and frequently. It'd be nice if a way to manipulate this could be found. Feel free to experiment, or rather, please do. Here's a WIP with saves states that you can use, with progress through Nugget Bridge, now 1082 frames (18.0s) ahead of the currently publish run.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (287)
Joined: 3/4/2006
Posts: 341
The correct address to look at is FFD4, and I think FFD3 may be somewhat related to it too. This is mostly just based on what I remember from my brief look at this after you posted your earlier analysis. I know Z80 assembly language (and the GB isn't much different), so I may briefly look into it later if I get bored.
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
You're right. I've picked apart the code a bit more, and I've come to a few conclusions. If FFD3 is less than or equal to D887, you will have a random encounter. This suggests the gamesharks codes 010087D8 to never have random encounters, and 01FF87D8 to always have random encounters. Useful for testing purposes. When the code I posted above is active, the current ROM page is always 04, which happens to have a nice table located at 7918:
32 00 65 02 8C 04 A5 06 BE 08 D7 0A E4 0C F1 0E FC 10 FF 12
If FFD4 is between 0 and 50, you will encounter the first pokémon in the table, between 51 and 101, the second, etc. Something I've also noticed is that pressing A on the frame when movement input is accepted has a noticeable effect on both FFD3 and FFD4. This must have been what I accidently did while experimenting earlier. Unfortunately, this seems to slow you down by two frames, but if it allows one to manipulate encounters, it's a fair trade-off.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (287)
Joined: 3/4/2006
Posts: 341
That explains it. I had noticed that the code that changes FFD3 and FFD4 doesn't change their sum by much during each frame, so I figured the sum was used to determine which Pokemon to encounter. Now it's clear that this dependence is solely due to the constraint on FFD3 when you get into an encounter. I posted the code here for convenience. FF04 seemed to be a hardware register that was used as a source of entropy.
F0 04    ld a,(FF04)
47       ld b,a
F0 D3    ld a,(FFD3)
88       adc a,b
E0 D3    ld (FFD3),a
F0 04    ld a,(FF04)
47       ld b,a
F0 D4    ld a,(FFD4)
98       sbc a,b
E0 D4    ld (FFD4),a
C9       ret
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
Ok, I think I've got this figured out. FF04 is not a static variable, but rather increases steadily at a rate much faster than once per frame. If between the calls to load this value, it happens to increase, then the sum of FFD3 and FFD4 decreases by one. On average, this seems to happen about once every 1.37 frames. This can be luck manipulated, however. It seems that everything else that has an effect on randomality (when a button is pressed, how long it is held, etc), can have an effect on the sum, probably because it moves the time when this procedure is called by a few clock cycles. I'm not yet certain to what extent this can be manipulated, but I've measured a difference of 9 after as little as 150 frames after a button press. In my current progress, this sum is C7 when I get to the patch of grass. I'd need it to be at least D7 though, and preferribly closer to E4. I'm going to redo nugget bridge another time to see if I can accomplish this.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (287)
Joined: 3/4/2006
Posts: 341
At the risk of boring everyone else reading this thread, the carry flag can be set or clear when that routine is called. This happens in the previous routine called, and the result depends on CFCB. If CFCB is anything other than 0 or 1 (usually 0xFF), the carry flag will be set, and the sum of FFD3 and FFD4 has a chance to increase. If CFCB is 1, the carry flag will be clear, and the sum of FFD3 and FFD4 has a chance to decrease. I haven't looked at the case when CFCB is 0, but it only lasts 1 frame anyway.
Emulator Coder
Joined: 6/8/2005
Posts: 236
Location: Madison, Wisconsin
On the contrary, all this assembly chat is hot.
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
Nitrodon wrote:
At the risk of boring everyone else reading this thread, the carry flag can be set or clear when that routine is called. This happens in the previous routine called, and the result depends on CFCB. If CFCB is anything other than 0 or 1 (usually 0xFF), the carry flag will be set, and the sum of FFD3 and FFD4 has a chance to increase. If CFCB is 1, the carry flag will be clear, and the sum of FFD3 and FFD4 has a chance to decrease. I haven't looked at the case when CFCB is 0, but it only lasts 1 frame anyway.
I can confirm this. During battles, the sum of FFD3 and FFD4 (I'm just going to call it the D-sum from now on, kk?) seems to steadily increase, and outside battles it steadily decreases. I was in fact able to increase the D-sum enough to catch an Abra on the first step by manipulating the dialogue presses of the last two battles on Nugget Bridge. I'm currently in Vermillion Gym, attempting to manipulate a 1/256 miss. As soon as I manage this, I'll post another WIP. Upon entering Vermillion, I was 2098 frames (34.97s) ahead of the currently published run. Once again though, I'm having no luck. I've already spent over 1800 re-records without success. Before I waste any more time, I'd like to understand this as well. I have a very strong suspicion that critical hits and battle damage are also dependent upon FFD3 and FFD4. It's likely that one determines a critical hit, and the other miss/damage. I believe this for the following reasons: If you observe these two values at a specific frame count, pressing the last button press on a different frame changes these values entirely. However, holding the button press longer has a very minor effect; the values are typically the same, although each may be as much as 4 higher or lower. This is consistent with previous findings, that pressing a button at a different time changes things completely, and that holding a button press longer will usually preserve a critical hit, but can affect damage and whether it misses. I wouldn't be surprised if these two values were responsible for every aspect of radomality in this game. My assumption is that if FFD4 (or perhaps FFD3) is zero, this will generate a 1/256 miss. Logically, this means that if the original roll was ouside the range of FC and 04, then holding the button press longer has basically no change to produce a miss. However, FFD3 and FFD4 change several times per frame, so there's really no way of knowing what the original roll was. My hope is that perhaps this value is temporarilly stored in a different location where it could be observed. I haven't had any luck finding this though. Nitrodon, perhaps you could give it a look as well? EDIT: Also, while calculating damage, the value seems to be temporarily stored in FF95 and FF96, if this helps your search any. EDIT2: How damage is calculated in this game is crazy, but it does depend upon FFD3. Basically it works like this. Load FFD3. rrca. If a > D9 (217), move on, otherwise update both FFD3 and FFD4, and try again. At the end we have a value greater than or equal to 217. So far so good. Unfortunately, this value is stored only temporarily in FF99, and is immediately destroyed by the algorithm that calculates the damage. I was also unable to locate the critical hit and miss conditions, but it's likely that they don't leave any residue either. It seems that I have no choice but to brute force in this case. EDIT3: Updated WIP, with progress through Vermillion Gym. I picked up another 4 seconds in Vermillion, and am now 2338 frames (38.97s) ahead. Now for the fun part :)
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Joined: 5/9/2007
Posts: 93
Location: The Netherlands
Hm, seems like I've been away for a while. I've started recording my regular speedrun (no TAS) and I'm pretty much 2/3th in the game. I'm saved with a Poisoned Mew in the Safari Zone at 1:03. I poisoned Mew with one of the Bikers on route to Fuchsia. In the first 500 steps, I defeat Koga, Erika, get Ice Beam and a Max Ether (exactly 500 steps, lol). Then, I use the glitch to get to Sabrina. After that, I get Surf, Escape Rope out, make my way to Cinnabar Island and get the Key, Escape Rope out and set up the glitch in the Safari Zone again. I pretty much only defeat Blaine in the next 500 steps and bike a lot, I teleport back to Viridian City and bike all the way to the League. That's pretty much my route. I have no idea if this is the fastest, but yeah.
Chamale
He/Him
Player (182)
Joined: 10/20/2006
Posts: 1355
Location: Canada
Hot damn, go away for a few days and there's a 6 minute SM64 run and a new WIP from Primo. Nice work.
Joined: 11/11/2006
Posts: 1235
Location: United Kingdom
Chamale wrote:
Hot damn, go away for a few days and there's a 6 minute SM64 run and a new WIP from Primo. Nice work.
This must mean you are a progress-limiting human charm. Please feel free to go away more often.
<adelikat> I am annoyed at my irc statements ending up in forums & sigs
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
I've got some bad news. Although I have a new WIP, I'm going to need to redo quite a bit of it. The reason is that the planned route has a major flaw. If, while performing the Snorlax skip, you have a random encounter (such as the planned encounter to see a pokémon with a special of 21), it deactivates the glitch. I was aware that a trainer battle did this, which is why I fought the unavoidable Gambler beforehand, but I never thought to test random encounters. A rather disappointing result, considering how long it took me to manipulate that Meowth encounter, but I suppose that's the consequence of unthorough testing. So we need a new plan. Fortunately, I don't think I'll need to redo too much. I'm still convinced that using Gyarados for the first half is still the way to go, and Mew for the second. The best course of action I think of is to catch the Abra in the patch of grass west of Nugget Bridge, and then use the Youngster with the Slowpoke on the way to Bill's. This would mean doing this glitch a total of four times throughout the run, but I still think it would be faster than using Charmander across the bridge, and taking over with Mew from there. Of course, I could be wrong. If I find that my Mew run was in fact faster entering Vermillion, I'll probably go back and do that again.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (487)
Joined: 2/19/2007
Posts: 114
I'm again thinking that Cinibar coast might be better. If you set up the first 500 steps then just do gym 4. Fly to Pallet as normal (time lost catching a fly slave and going out of your way to get poisoned (?)) bike to Cinibar then fly to the old man and back catching whatever (time gained from not teaching thunderbolt to Mew, getting and teaching phychic, battle cry savings and possible slow animation savings, time lost from being forced to take a longer name) then continue as planned. You have to do Koga during the second 500 steps but you should have enough steps for both him and Blaine.
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
TheRandomPie_IV wrote:
I'm again thinking that Cinibar coast might be better.
I had also thought about this. Unless I've missed something, the two options for a Cinnibar flyer are Pidgeot, and Aerodactyl, the latter being clearly a better choice. This would of course mean redoing the entirety of the run. However, I'm not convinced that this would actually be faster. I plan to continue with the run I have, glitching a Mew in Cerulean, and just schlepping him along for a while. Afterwards, I will try another run with the Cinnibar tactic, and submit whichever is faster. The reason for this, is that the rest of this run should be fairly enjoyable to make, and I think completing it will help me plan future runs better, as well as uncover any other flaws the route might have.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Active player (487)
Joined: 2/19/2007
Posts: 114
Why would you need to catch a flying pokemon from the Cinibar coast? You need a fly slave just to perform the glitch don't you? I agree with your plan of finishing this run though.
Player (88)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
While performing the WTW glitch, you can only have one pokémon in your party. After the glitch is activated, you can't enter a building, such as a Poké Center, to withdraw a flyer. This implies that the main battler needs to be able to use Fly, which is what made Mew so appealing.
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Joined: 8/11/2007
Posts: 27
Here is a possible idea of how to get all the needed HM's onto one pokemon (requires cinnabar surfing glith): 1. Do the Old Man trick 2. Fly (or Teleport) to Cinnabar Island, and use Surf. 3. If you keep a space in your name, you can catch a level 0 'M. Find one and catch it. 4. Now here's where it gets good. Teach 'M both Cut and Fly. Then give it a Rare Candy so that it grows one level. Upon growing one level, it evolves into Kangaskhan. Now you can teach it both Surf and Strength. 5. Congragulations. You now have a total HM user other than Mew. Quick Edit: Here are some other things to note about 'M: 'M has a base attack stat higher than any Pokemon (even Dragonite, 136 to be exact) 'M starts out with Sky Attack, a whopping base 140 power attack 'M's speed is subpar (a mere 29). You'd need Carbos and X-Speed if you planned on keeping it as is. If 'M's level exceeds 137, it also gets a nice Pound attack in its arsenel. Check various sites for TM compatability.
Player (21)
Joined: 10/14/2005
Posts: 317
TheRandomPie_IV wrote:
I'm again thinking that Cinibar coast might be better.
The idea keeps coming back from time to time, such as here, here, and here. However, any thorough analysis or testing has shown that this method doesn't come close to breaking even (including when Tilus's run had the wasteful stop on Victory Road to catch an Onix). There are just not enough battles left in the game to make up for losing more than a minute to perform the coast trick, even if you take into account short cries. Now that Silph Co., Viridian Gym, and a couple rival battles will also be skipped, the deficit is even larger. One cool-looking thing about the coast trick now would be doing it on the bicycle instead of using Surf. However, this one second less combined with the time saved from not teaching Thunderbolt+Psychic is not enough to tip the balance.
Active player (487)
Joined: 2/19/2007
Posts: 114
primorial#soup wrote:
So we need a new plan. Fortunately, I don't think I'll need to redo too much. I'm still convinced that using Gyarados for the first half is still the way to go, and Mew for the second.
Watching your WIP again I'm not convinced Gyarados is good at all, I suspect that, if you not going to use Mew straight away, a level 100 Gengar/Nidoqueen would probaly outperform a L7 Gyarados even though you'd still have to get Mew. Gyarados has five two hit battles, tons of level up music and has to take Bubblebeam insted of mew. That said I believe just using Mew straight up would probably be better still.
Chamale
He/Him
Player (182)
Joined: 10/20/2006
Posts: 1355
Location: Canada
Randompie, take a look at Primo's Mew TAS, and compare it to the Gyarados TAS. Gyarados blasts through nearly everything. Gengar and Nidoqueen would reduce 10 hits, however, it would take 12 hits to get them at level 1, plus a bonus to take them to level 100. EDIT: Wait a minute. Reading your post again, I noticed that one major point: Level up music. Perhaps, because of that, a level 100 Gengar would be better. Hang on while I go get all the info I accumulated while proposing a run with level 100 Snorlax. ENCORE: Yup. 2.5 seconds for the music to play. That's around 35 seconds lost so far. Maybe level 100 Gengar isn't a bad move after all.