Jump to content

How to switch between RNG methods

Recommended Posts

Hi all,


I'm working on a TAS of LeafGreen (on an emulator), and as part of my route, I need to catch a Pokemon with specific IVs generated by Method H4 at a specific RNG frame (frame 93395, to be exact). However, I am only able to make the encounter generate with IVs generated by Method H2. I know that it is theoretically possible to change the RNG Method for the encounter because I have done it before, but not in any sort of reliable way. I just sort of threw inputs at it until something different happened. That has not been successful thus far. Is there a way that I can get this encounter to happen with the RNG Method that I want? It's been driving me insane

Link to comment
Share on other sites

You'd need to influence the vblank to occur at a different time while the game code is executing. Emulators don't all behave the same way (timing/efficiency). Different inputs on prior frames may cause extra/less code to be executed, altering the timing in which the vblank interrupt occurs relative to the PIDIV loop code.

Think of it as two parallel processes; vblank and game-loop. vblank executes X frames per second, and the game loop gets paused whenever vblank is triggered, and a rand call happens.

There is no reliable advice besides input spam on prior frames, to shift when a vblank happens. Nobody has profiled the game loop to show what player inputs can modify the assembly instructions executed per frame, or estimating when a vblank will occur based on the game loop code.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...