Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/542a280f999d3f7bece2a0fe3569d474 to your computer and use it in GitHub Desktop.
Save anonymous/542a280f999d3f7bece2a0fe3569d474 to your computer and use it in GitHub Desktop.
Yu-Gi-Oh! Forbidden Memories - Explanation of RNG Manipulation

Streamkey here, this is an explanation of the newly found RNG Manipulation in Yu-Gi-Oh! Forbidden Memories speedrunning.

1. Introduction

Until now, FM speedruns have followed a similiar format:

  • Start new game
  • Check starting deck and hope it's good (reset if not)
  • Farm Rex for dragons/thunders (skip if extremely good starting deck)
  • Beat world tournament
  • Farm Isis/others for endgame equips/field spells/etc.
  • Proceed with mages and Final 6/7.

To understand the new RNG manipulation route, we must first understand what "RNG" is.

2. Random number generators

Skip this section if you already know the basics of pseudo random number generators.

Computers cannot generate truly random numbers. What you see as "randomness" is actually a mathematical algorithm designed to look random, but really isn't. This means that if you perform the same actions frame-perfect as another run, you will get the same starter deck, same enemy AI, same everything. This is what makes tool-assissted speedruns possible for almost all older games.

Nerd talk: FM uses the ANSI C default Linear congruential generator, m=2^31 , multiplier 1103515245, increment 12345.

3. How FM uses RNG

  • The initial RNG seed at game boot is 0x55555555 in hexadecimal.
  • RNG usually advances every frame. Known exceptions: Certain menus, intro cutscene, during a duel (!).
  • Your initial starting deck is determined when you progress past the last text box on the name selection screen.
  • If you start a duel with the same deck on the same RNG seed and perform the same actions, the enemy AI and final card drop will always be the same.

How can we use this information to break the game?

4. Putting it all together

Heishin 1 conveniently drops Meteor B. Dragon on S and A-Pow, albeit on extremely low "chances". So if we find a starting deck that can beat him, and a specific combination of starting RNG seed and duel inputs that makes him drop MBD at the end, we can repeat this process, and effectively start the game with three MBDs.

Such a setup has now been found. Here is a quick rundown:

  1. Start with a specific starting deck located at RNG frame 14810. (2 dragons, 5 thunders, Beast Fangs, Raigeki)
  2. Win a >900 ATK or >900 DEF monster from Heishin 1.
  3. Save and reset your console.
  4. Start a duel on Heishin at RNG frame 640 OR 642. Follow pastebin instructions to manipulate Heishin into dropping MBD.
  5. Repeat steps 3-4 for more MBDs.

From this point, the game effectively "becomes NG+ with a shitty NG+ deck" (quote by GFC).

5. Credits

Froggy25 - Initial research of FM RNG
GenericMadScientist - Further research into FM RNG & finding a starter deck + Heishin duel MBD setup
GCAH2006 - Working together with GenericMadScientist proving RTA viableness
Mergy - Supplying data to GenericMadScientist
Duke - Providing a JSON file containing all card data in the game

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment