Exarion

The problem of Gen 3 RNG manipulation

Dec 31st, 2015
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. Hi. I'm writing this in attempt to solve one of the biggest problems in Pokemon speedrunning: RNG manipulation in Generation 3.
  2.  
  3. EDIT: Day 1 discoveries show a much more consistent method for Sapphire: http://pastebin.com/X4p7R3f0
  4.  
  5. Our current knowledge of Gen 3 manip is this: The RNG advances once per frame after a certain starting point, and once whenever the random() function is called in the code. In Sapphire, the starting point is a soft reset. In Emerald and FireRed, the starting point is when you name your character. Each frame corresponds to a unique set of stats for your starter Pokemon, and we have access to entire lists of starter stats by frame. You generate your stats when you select your starter. So if you select Mudkip 8000 frames after soft resetting Sapphire, you will receive the Mudkip that corresponds to 8000 plus the number of times random() was called.
  6.  
  7. Sapphire, Emerald and FireRed run at 60 frames per second, so hitting a single frame consistently is unrealistic. However, if you aim for the center of a cluster of good Mudkips -- for example, Mudkips 12779 to 12784 -- you should never miss the cluster.
  8.  
  9. Unfortunately, even the best runners have frequently missed large clusters of Mudkips when doing attempts. Runners will say "that felt good" in reference to their Mudkip timing, then be surprised to receive a Mudkip that is 5-10 frames off (and sometimes 15-20). This is likely because the random() function is being called many times during the opening cutscenes that precede the starter selection menu.
  10.  
  11. This would be only a minor nuisance, except that all three games require excellent stats to achieve optimal times. In Sapphire, Mudkips with godly Speed can use extremely fast strats that save minutes, and they also finish runs consistently. In Emerald, good Sp. Atk is required to use a fast strat on Tate & Liza that saves 30 seconds. In FireRed, godly Sp. Atk saves minutes. Without consistent RNG manipulation, it would take dozens of hours to get on a run with the necessary stats and a reasonably lucky early game.
  12.  
  13. In this stream, I will attempt to figure out 1) what causes random() to be called, 2) whether this can be tracked, and 3) whether this can be manipulated. I doubt my findings will make RNG manip as clean as it is in Gen 4-5, but I hope they will make the games runnable again.
  14.  
  15. Testing a game's code is not my strong suit, so any help in solving this problem is greatly appreciated. Just post in chat and we'll figure it out together. :)
  16.  
  17. Google spreadsheet: https://docs.google.com/spreadsheets/d/1-xWnAFoh780JbB9OCwW2jFcphOLtMcnDmXW2Zd7H-NA/edit#gid=0
Advertisement
Add Comment
Please, Sign In to add comment