Posts for merrp

merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
jlun2 wrote:
I'm not sure if this is the best place to ask, but is there a script that displays the current, and next several hundred frames of encounters? It has nothing to do with TASing; I just want to shiny hunt in R/S/E on emulator using either battle tower roaming bug, or normal wild battles. How are battle tower shinies determined? All 3 pokemon at the same time as the battle starts? What encounter method is it? Is it possible to have a trainer in battle tower with 2 or more shinies at the same time?
Gen3Tools can display that info, if you input the RNG state into it; usually I have that and the cycle count on screen and I input one or the other. For battle tower shinies, this function is how they're determined: https://github.com/pret/pokeemerald/blob/master/src/battle_tower.c#L1633 They're generated one after the other, but depending on how much other code runs that frame, it's probably any method between 1, 2, and 4, depending on the number of nature rerolls.
Finally, is the new mail bug for R/S possible to be used in Emerald for faster than Pomeg ACE?
As CasualPokePlayer said it is usable in TAS; I am going to work on that after finishing FRLG. It'll involve maining Makuhita (For Knock Off) and maybe Zigzagoon (for Pickup Candies) with the goal of getting Makuhita to level 28 and getting to Fallarbor Town for the Metronome tutor (Abra can learn it so no problems there). Then I'll need to find a suitable target that I can corrupt to acquire a glitch species for ACE. The current TAS gets to Fallarbor at around 33 minutes, so adding in a few minutes for Makuhita and leveling, the final time could be sub-40, I think.
How feasible would it be to make a low optimized/almost casual but occasional savestate use run as a proof of concept given almost 0 knowledge of the memory of this game?
The decomps really help with this, basically every symbol has been mapped out. I'd say it'd be pretty reasonable to make a savestate run where you maybe do some RNG manip.
Post subject: Any% Glitched
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Link to video Initial WIP for Any% glitched. Looking to get feedback on anything that I missed or can improve, besides what I already know has to change. The way this works is, I start out looking for Clefairy encounters ~70k RNG cycles into the run, for all 2^16 possible RNG seeds. This is the rarest event I have to manip so I figured it would be nice to narrow the pool as much as possible to start. Some constraints on this Clefairy:
  • It has to have Lonely or Naughty nature
  • 31 speed IVs, and 30-31 Attack IVs
  • 2-31 Sp. Attack IVs, for some Water Pulse KOs late in the run
  • Good HP, Defense, Sp. Defense IVs don't hurt; With better ones than I got I can take slightly more damage from the Mt. Moon trainers.
Then I take all of those TIDs and filter for a pretty standard Squirtle I think:
  • Mild or Rash nature
  • 13-31 Attack IVs
  • 31 Sp. Attack IVs
  • 14-31 Speed IVs
Then I take all those Squirtle and test Easy Chat word combinations that, combined with the TID and SIDs, can turn Squirtle into a glitch species capable of causing ACE later. I was left with a list of about 23 TID seeds that work, so I just picked the first one I could get. This will change in the next iteration because I'm going to grab the Magikarp from the salesman in the Route 4 Poke Center, and that will increase the target cycle for Clefairy. I also have to track Squirtle's friendship throughout the run, as certain values won't work for any combination of words, that's not too bad really. The way the actual glitch works, and the reason for using Clefairy, is as follows:
  1. Meowth consumes a berry (acquired via Pickup). The actual berry doesn't matter, it can be a status berry, HP, etc.
  2. Clefairy, holding mail, is switched into the same slot.
  3. Farfetch'd uses Knock Off on Clefairy. This removes its mail, but normally it would just be restored at the end of the battle.
  4. Clefairy uses Metronome -> Recycle, recycling the berry that Meowth consumed in the same slot (item usage data like this is tracked per battle position.
  5. Now Clefairy no longer has mail, but mail slot 0 is permanently filled.
  6. Giving mail to the rest of the party, when we give mail to what would be the seventh mail slot, we end up editing Box 3, Slot 1 of the PC!
  7. Deposit Squirtle and corrupt it with specially-chosen words, turning it into a glitch species with a really long name.
  8. When swapping, its glitch name will overwrite the function called to finish the swap, and this points into storage data.
  9. Slide through to box names and ACE
Huge thanks to luckytyphlosion (for discovering this Recycle interaction), gifvex, and BluMagma for their help in working out all of this. So, how to improve this (there's a lot; but redoing it now that I have a draft won't take long):
  • Picking up Magikarp from the salesman is faster than catching a pokemon, with the added bonus of letting me access faster RNG advances due to the extra cycle incurred every frame after entering a Pokemon Center.
  • I don't need to teach Clefairy Doubleslap; I originally intended to use it to KO the Mt. Moon trainers quicker, but it didn't save time.
  • Better defensive stats on Clefairy means I have more damage leeway versus Misty and the bridge rival.
  • Faster RNG advances means less real time waiting for an Abra encounter frame.
  • Most level 14-16 Meowth can survive an Ember from Ninetales or Rapidash, get burned, cure the burn via Rawst Berry, and be KOed by the other enemy's Ember. This saves a turn.
  • I forgot that you can run in all parts of the Underground Path lol.
  • It's possible switching to Fast speed text could be faster:
    • Upsides: Still investigating it, but I've heard that Mid speed text loses 1 frame per textbox. As to how many frames I actually lose over this run, I'm not sure.
    • Downside: Complex battle manips are more difficult and costly. In this run there's a bunch of places I want to manip the enemy's move and my own separately by slowing down or speeding up text; I can't do that with Fast text. Help menu costs about 18 frames to open and close for that, so I'm not sure which is faster overall
  • Gifvex discovered that using multiple mail word entries, you can actually create a pokemon in the empty slot of Box 3 Slot 1, give it a Super Repel, swap its moves, and acquire a glitch species. This would mean I don't have to catch a seventh pokemon, but it might not be faster than using Squirtle, I will have to test it.
  • Faster RNG advances from entering a Poke Center means less time to wait for the RNG to land on Recycle and the KO move for the double battle.
  • It also means way easier pickup manips for the 3 Rare Candies I need to get Farfetch'd to level 21.
  • luckytyphlosion helped me optimize the staged ASM payload that I enter, saving some frames.
  • The only other Recycle user is the ingame trade Mr. Mime, Mimien, who is all-around better to use than Clefairy, but takes 2 minutes to go and get it, so I'm not sure if it will be faster.
With all of this implemented soon, I expect this could save about a minute or maybe more. I'll be doing some postgame input as well via the ACE payload, since I wasn't able to publish it for Emerald. Hopefully this explanation is helpful and this WIP isn't too suboptimal, but let me know ! Thanks :)
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
KusogeMan wrote:
https://www.twitch.tv/videos/1973654509?t=0h59m47s new run by machwing using new glitch ACE for early finish, who's excited? https://docs.google.com/document/d/1atcW9i-FdKdhNsNqysDJbxMMjRJAE8fjF-x5nubXlG0/edit
I know I am :) Planning to pick this up this weekend or at least start doing initial research and seed-searching. For TAS we don't need the in-game trade as a corruption target or for Recycle: my plan is to get Clefairy to level 29 for Metronome -> Recycle using normal leveling and a small army of Meowth for Pickup strats (you need 7 pokemon anyway unless you do the double battle glitch multiple times which idk will save time). Clefairy can also be the corruption target and I'll be able to manip one that can be corrupted into one of the glitch species that can trigger grab ace, so no need for EV counting, you're just making a run straight to Celadon for mail. Box name payload will probably be custom and input-based like Emerald's, because the credits are a good place to do postgame input and I definitely want to include some this time!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
OtakuTAS wrote:
Even though dive is still required at this point can I skip the waterfall and thus the waterfall HM and walk into the Elite 4? And if there's something in there stopping you as a sanity check, glitch past that?
If I remember correctly, the guards in Ever Grande only check that you have the optional/out of order gym badges (Brawly and Winona), not any of the others. However you can't use mail tile corruption to glitch past the waterfall. Also as an aside, I looked more into the JP RS doll glitch, but i don't think it can be used as an ace vector. Basically, filling up your house and base with dolls and going to the toss screen lets you toss glitch decorations out of bounds, which basically means you can zero arbitrary bytes...but only up to 256 bytes away from the place where your base's decorations are stored in the saveblock, because the counter is a u8. The only interesting things of note nearby are TV shows, where I crafted a theoretical ACE payload that works by zeroing a nickname's string terminator and clobbering the stack when you watch the TV show. Unfortunately, you can't toss glitch decorations whose glitch name is long enough to overflow the string var it's expanded into. The game enters an irreparable state where all of RAM gets trashed. To zero out a string terminator you'd have to be able to toss decoration 0xFF. I tested all revisions of JP ruby and it isn't possible on any of them. Will test sapphire too at some point but I'm not hopeful. Anyway I would be surprised if mail glitch allows for a faster any% TAS, unless the time to setup is less than what you save from critical hits or it enables some additional sequence break or glitch.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
New encode of improvement! https://youtu.be/YTUgeJY9sYo Link to video
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Sorry that this has taken so long, but I've more or less completed the improvement I wanted to do! This is only a partial encoding and I'll be updating the submission in the next few days: https://youtu.be/Lf4mtodATYw Link to video The time is now 54:58.
After walking through the wall in Route 110 (as well as some other areas), if you keep walking left to "leave" the area, the freeze should happen.
I was able to replicate this! But it sadly doesn't seem to be exploitable.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
I made some progress mapping out the new route and examining the Mudkip I want to use. My finals are finally over so I plan to have this finished with the new method by June!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Reviving this to detail my research with JP Ruby glitches. I wanted to understand how the mail glitch worked, so I disassembled the ROM and have been looking at the functions involved. JP R/S lacks a check used in the localizations for Thief and Trick, that is supposed to check if a pokemon has mail and if so cause the Thief or Trick to fail. It's literally probably 10 assembly instructions missing that makes this possible. However I haven't see any other differences in how mail works meaning that if only that check were missing from the other R/S/E versions, this would be possible in all of them. Basically, the game has space for 16 mail slots. The first 6 are meant to be stored on party pokemon, the last 10 are for mail in the PC. Each mail slot contains some easy chat words, the player name, trainer TID&SID, a 2 byte species value for the pokemon holding the mail, and a 2 byte item ID for the actual mail item. When you give a pokemon mail, one of these slots is filled, and the pokemon's mail field is set to the index of that slot. This is normally fine, because you can't go above 6 within the party because you wouldn't be able to give any more mail. Using Trick or Thief bypasses this. It changes the item the pokemon is holding but does not clear the mail slot. This makes the game think that slot is still full, semi-permanently. So what happens if you fill up all 6 slots but can still give mail to a pokemon holding an item? Normally when giving mail, the game calls a function that counts up to 6, looking for an open slot. It can only count up to 6, so if all 6 slots are filled, it returns early, which means that the mail is not given. But, the game still thinks an item swap occurred, so it gives you back whatever the pokemon is holding, duplicating the item. On to tile corruption. Each party pokemon has a mail field which I mentioned earlier. In normal play, this can only be the values 0-5 inclusive, corresponding to the 6 mail slots, or 0xff, for pokemon that have had mail taken away/have never held mail. There is no function in the game that can assign any other value to this field. If all 6 mail slots are full, and you give mail to a pokemon without an item whose mail field is 0-5, it will bring up the easy chat words that were last written to that slot. If, however, you do this to a pokemon whose mail field is 0xff, the area of memory that's accessed in memory is way out of bounds of the mail slots. Specifically, it's a fixed location that lies right in the middle of map metatiles. Changing the easy chat words changes whatever metatiles (if any) are at that memory location. And this can be repeated many times because the mail is never actually given. The reason the tiles changed on each map differ is because they're stored with some padding that depends on the width of the map. There is no known way to change the metatiles that are accessed. If you could somehow get a pokemon whose mail field was any other value, different tiles could be accessed, but I'm pretty sure that isn't possible. That being said there are a few maps where the tiles you can change are walkable (Slateport City, Mossdeep, Route 110, Route 118 to name a few), but in my testing, none of them allow for sequence breaks. The tiles on Route 118 fall exactly one tile short of being able to cross the water and access Route 119 early, without Surf. It's kind of depressing. Now that I understand this better, I think I'm going to work on a JP Ruby TAS that does item duplication after Slateport. I'm not sure how much faster cloning rare candies would be though. I also investigated the cause of https://www.glitchcity.info/wiki/Excessive_doll_arrangement_glitch and can post that if people are interested :D
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Do you remember what phrases you used to make it do that? On Route 110? I've been doing research and found out the exact area it modifies, but I haven't been able to make it crash yet.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Yeah I think that having the disassembly will make inspecting the mechanics a lot easier.
I found a way to crash the game. If you do the tile glitch on Route 110 and then walk out through the tiles towards the left 4 tiles, the game will freeze. It works in a couple other places as well.
Did it freeze as in completely crash, or was the music still playing? If it completely crashed, it likely hit an invalid opcode, which means it executed something it shouldn't have, that might be exploitable. If the music still plays it's more likely it got caught in an infinite loop or a large area filled with zeroes.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
How are you planning to crack open JP Ruby? Is there a glitch that allows potential ACE?
There's this: https://glitchcity.info/wiki/Mail_and_Trick_glitches it can apparently corrupt metatiles. Which is really interesting and seems to me like it could potentially be more powerful. I've been working on disassembling and matching the ROM similar to what I did for Emerald, so that I can inspect what's actually going on. If, and it's a big if, there's a way to corrupt PC or party data, you could corrupt a PID and get a glitch species or move, and at least one of those could probably do ACE. It'd be like glitzer popping but without pomeg berries. We'll see!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
I don't even know what move キ is trying to use here.
Most glitch moves have really long, glitchy names that read from unintended areas of the ROM--so I'm not really sure where the name comes from exactly either!
I should mention that you could have used Mud Shot on Wally's Ralts to avoid the critical hit there
Was that mentioned in the last list you helped make of what moves to use when? I thought I copied it over and followed it pretty exactly but maybe I made a mistake.
Also, there was no need to use Water Gun on Magnemite before then; you could have just used Mud-Slap
Isn't the super effective message longer than the critical hit one?
I still think the strategy of glitching IVs to move (instead of EVs to move) could work.
It probably could but like you said, the planning and setup is huge for the relatively small payoff of skipping the vitamins. I'm not sure I'm interested in doing that right now, I've been working on trying to crack open JP Ruby lately, as well as whether sprite ACE could be faster on JP. But we'll see!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
キ is broken.
Did something break?
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Temporary encode is up, for anyone who wants to watch but can't play back the movie: https://www.youtube.com/watch?v=cY_O9nRwxc4
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
I'll have a temporary encode available for anyone who can't play the movie back soon!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Real time runners only have a strategy for ACE because I made them the strategy ;) It uses a different entrypoint, with a glitch species (specifically a glitched front sprite animation) instead of a glitch move. This is different from what's done in the TAS, and it was very recently discovered (or re-discovered; I reverse engineered and expanded on it based on a Japanese speedrunner's run) too. I likely will TAS this strategy at some point, but I don't think it will be faster. Even on JP, with its much greater access to opcodes and the ability to write THUMB, getting the glitch species requires either hatching an Egg or double corruption, neither of which are very fast. You need a way to play its front sprite animation, which you can't do unless it's hatched or corrupted twice to not be an Egg. However, the strategy I created for English is still a lot faster than the current RTA route, and they said they're Here is the payload in box names, which I use to input subsequent code: Hopefully it's at least vaguely understandable even with all the comments. 1. Setup key input 2. Write lower 8 bits 3. Loop unless L&R pressed
Box1: @ 02 4D 34 1D 05 DF 04 E0 (いぷゃへおkえl)
LDR r5,[pc,#8]  4D02 @ r5=REG_KEY_INPUT
ADD r4,r6,#4    1D34 @ r4=start of loop (SWI)
SWI #5          DF05
B Box3          E004
Box2: @ xx xx xx 30 01 00 04 (ぃぃぃぃあ え)
.space 3
.4byte 0x04000130 @ REG_KEYINPUT
Box3: @ 29 68 71 77 01 4B 04 E0 (るネムラ ゥぽ えl)
LDR r1,[r5]     6829 @ r1=keys
STRB r1,[r6]    7031 @ write keys
LDR r3,[pc,#4]  4B01 @ r3=0x300
B Box5          E004
Box4: @ xx 00 03 (  う)
.space 1
.2byte 0x300
Box5: @ 01 36 19 42 00 D0 20 47 (あょのぢ Vみび)
ADD r6,#1       3601
TST r1,r3       4219 @ Z=L&R
BEQ target      D000
BX r4           4720 @ loop to SWI
target:
I can also post the second or third stage payloads if anyone is interested, but they're a bit larger (I think about a hundred instructions or so).
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
What I'd really like to see in BizHawk is support for mGBA's breakpoints and debugger in Lua scripts. Sometimes there are scenarios that come in TASing that I can't test since I can't reproduce them in normal mGBA because of how specific they are. I can't inspect what's going on because I can't set breakpoints. Either that, or a way to export save states to mGBA would be great!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Alright! Super happy with this, saved almost a minute and a half off of the previous full TAS. 206563 frames @ 59.73 fps = 57:38.42 https://www.youtube.com/watch?v=9WNBmiVMdo8 Link to video Changes: - Better understanding of the timing necessary to align memory for Glitzer Popping. Using the Route 102 spinner allows me to advance the RNG to get the frame I want faster. The memory alignment depends only on the encounter frame *and* the tile it occurs on--tiles close to the spinner add, I believe, an extra RNG cycle, while tiles farther away do not. - Improved some very subtle mistakes in the PC button press timing. - Tried a few different Box naming orders--it's counterintuitive, but deferring naming Box 2 until after picking up the Egg doesn't save time. - New payload that wasn't shown in the last video. More fun--tricks the game into thinking A is pressed so that the final real press happens much earlier. - As mentioned earlier, Strength is not picked up in this run. Due to this, Marshtomp's EV distribution was altered, and I didn't have to use a Qualot Berry to get glitch moves that behaved nicely! TODO: - TAS the branch going from Wattson->Verdanturf->Fallarbor, and see if it's faster - Possible improvements on both the bootstrap payload, and the code that is input. Making it slimmer by 1 instruction would save 2 frames. - Encounter "pathing"--basically finding the fastest way to an encounter--could use work. - Suggestions?? Newly changed, not in this video: - Ralts fight optimizations--talking to Norman from the left saves 32 frames If I can save another minute, it'll be 20 minutes faster than the current fastest completion!
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
This has taken a while because of work and school, but I've started TASing the new route: https://www.youtube.com/watch?v=wzdV8BhJUQA Link to video After Norman, it comes out about a minute faster than my previous video, and that includes fighting an additional Solrock (for a total of 3), so I won't have to fight a Poochyena this run. It incorporates these changes: - Skipping Strength, thanks to research done by FractalFusion. This changes the route to skip going through Route 116 again entirely, instead backtracking through route 113/111. - Minor music fadeout abuse. The only location this really saved time for me was entering Meteor Falls. - Skipping naming Abra since I will need to name a Wingull, or something, instead later, as was done in the previous video. - Fixed a few small pathing errors. Since I started this branch from the Abra fight, there are 1 or 2 unchanged paths from very early on, that I didn't think were really worth changing. They're talking to Mom from the left, and talking to Norman from the right the first time. Since they're both pre-Ralts fight though, the timing is sort of synced to when the right Ralts can be encountered, so changing these paths will probably only save 4-8 frames at most, because I'll just have to run for longer in the grass to time the Ralts encounter *slightly* faster. TODO: - TAS to the end, to see how much faster the new route ends up being overall. - TAS a second branch, where I go to Verdanturf after Wattson instead of after Flannery, to see which is faster. - Other optimizations?? Lots of thanks to FractalFusion for research on a Strength-less route and calculating the necessary move order for fights, to have enough PP to beat Norman.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
In that case, you can find the address of gTextFlags (or any other global variable; static variables have to be temporarily made global, and the project re-compiled to show up here) in pokeemerald.map If frequent recompiling is an issue, you could make a script to parse pokeemerald.elf, I think all variables including static ones show up there. 0x03003014: gTextFlags for US
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
in JP, gTextFlags is at 0x030030B4 Or did you mean for US?
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
In gamedb/gamedb_gba.txt in your Bizhawk folder, search for emerald, you'll see that rtc_enabled is set to 1. I tried changing that by removing it, but it seemed not to have an effect. Maybe Bizhawk isn't actually using the setting? Random pokenav calls also seem to be RNG dependent, as usually if you run into one that's not scripted (your dad's call going to Dewford, Roxanne calling you after Brendan 3, Wally calling you before Route 113), delaying a frame or to to land on the tile you'd receive the call on skips it. The texbox stuff is great! From my limited scripting experience, I think message boxes can be closed once the script pointer moves on from the "msgbox" command, so looking at the address of the script pointer could be a viable option. The relevant script contexts are sScriptContext1 at 0x03000E40 and sScriptContext2 at 0x03000EB8 (for JP Emerald).
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
All of the stuff in emerald-jp is based off my disassembly of JP Emerald, which made finding the addresses a lot easier since you can compare functions to US Emerald (which is 99% decompiled and has most variables labeled) to find matches. That's located at https://github.com/arantonitis/pokeemerald-jp Quick Claw just looks at something called the "random turn number", which is pretty much only used for quick claw and set per turn. The battle damage and crit chances are based on the damage and the crit flags. It'd be nice to have one script that can examine almost everything, in or out of battle. I'm not very good with displays in lua.
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Well, that definitely sounds like the vblank interrupt firing in the middle of PID/IV creation. It still seems strange to me because in the pokeemerald Discord, we theorized that PID rerolling could not ever cause a variable frame delay. The loop itself is very fast, only about 50 instructions, and the longest possible re-roll for all 2^32 seeds is about 400 iterations of that loop. So the PID rerolling shouldn't influence the timing at all because the delay is negligible compared to a frame. I'm curious as to what that extra frame is caused by then. Maybe it's more complicated than I remember and the PID is saved somewhere and IV generation is delayed until the next frame? Yeah, bizhawk scripting all of my scripts gets really annoying. I run BizHawk through Wine so opening scripts can be buggy. I know you had some nice-looking ones that I'll check out. Some of the memory addresses would have to be changed to match JP's memory map--have you had any trouble doing that?
merrp
She/Her
Experienced Forum User, Published Author, Player (20)
Joined: 7/31/2019
Posts: 56
Oh, that. IIRC, that's not actually random, but can be predicted. I think it's due to the game rolling the RNG for something else. I'll look into how. Whenever I've simulated wild Pokemon, I've never had to deal with that, which is weird--either I got very lucky or I ended up factoring it in when I based the code off of pokeemerald. Just to clarify, do you mean a whole extra frame/VBlank, and not just an extra RNG cycle? If it's the former, that's very bizarre. If it's the latter, then it almost certainly has to be caused by something in the encounter "chain" of using the RNG because I do not think other random events (i.e random cries on a route) can occur when an encounter is about to happen. This narrows down the number of functions where the extra cycle is consumed since there are only a few calls to Random in the call chain for wild encounters.