Author Topic: Guide to RNG Manipulation in Touhoumon  (Read 9142 times)

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Guide to RNG Manipulation in Touhoumon
« on: August 28, 2014, 09:21:15 PM »
Hey guys, DoctorShanks here, and today, we're gonna try to do some "cheat'n." I have no plans on sleeping properly for the next week or so, so I'm going to keep a promise I made approximately one year ago by writing this guide on RNG Manipulation.

To most players, obtaining a flawless Pokémon, or a Shiny Pokémon is either a dream come true, or a lack of sleep consisting of hours starting at a computer screen and sore thumbs from holding down spacebar. Personally, I wanted to try and escape this, and thanks to RNG research provided by Smogon, and the various researchers across the net, and visual guides by a Youtuber by the name of Samura1Champloo, I decided to make RNG Manipulation work out in Touhoumon. I succeeded, and I take absolutely no credit for anything in this post since I am actually terrible with computers.

This guide will cover various methods of RNG Manipulation that I've understood.

This guide will include:

-Seeds. These will be covered in the OP.
-Method 1, H-1, H-2, and H-4 encounters on Fire Red and Emerald. Simple, but not likely to produce competitive spreads all the time unless you find a good seed with a comfy frame. This is the only available Method which you can use for obtaining Flawless DDC Puppets in Doesnt's unnamed hack.
-Emerald Eggs. I recommend learning this above all else. It is the easiest, and causes the least amount of headaches. The only downside is that Shiny Eggs aren't exactly easy to manipulate for (see below).
-Shiny Eggs. As a consequence of the fixed RNG patch that Agastya applied to his hack, we can't do anything in the same way that vanilla Emerald players do. However, with a bit of TASing, and looking into the game's memory, Shiny Eggs are very possible, but relatively tedious. Regardless, they are covered in this guide.

What this guide will not cover at all:

-Fire Red Eggs. Unsupported by RNG reporter. By hitting consistent seeds and documenting inheritence, we can probably force Triperfects or Quadperfects at the very least, but you'd probably have better luck with random wilds in that regard. Do your eggs on Emerald. You can trade eggs over to Fire Red if you want them to have a Japanese name/OT. If you want a flawless DDC character in Doesnt's hack, then you'll have to stick with Method H-1 spreads.

==================================================================================

Things you'll need: Download containing everything below

-VBA rerecording (any version; I used v22 which I've included in the download. It's an outdated version, but works perfectly. Newer versions might have sync issues, which is really only important when dealing with FR Seeds). If you're using VBA Link, you can freely change your .sa1 file to a .sav file, and switch back when you're done if you want to trade or something. While I personally recommend the V22 as opposed to the latest version due to how awkward I find the later versions, the latest version can be downloaded HERE.
-The Various Lua Scripts available either in the download I provided or online HERE. (Note: The Lua Scripts are selected in VBA rerecording under Tools > New Lua Script Window > Browse > select appropriate Lua Script > Run)
-RNG Reporter. Available in the download full of stuff that I'm not even sure I'm allowed to redistribute. You can also download it separately (which will probably contain the latest version) over here.
-A Puppet with Nature Power. Chibi Sanae or Chibi Daiyousei are both good.
-Patience.

=====================================================================================================

Seeds

General:

Based on the initial RNG seed the game has chosen, wild puppet spreads will be cycled through at around 60 frames per second. Since we have frame-by-frame emulation on our side, this isn't as big of a deal as it sounds. What is a big deal, however, is actually hitting a good seed to use in generating a good puppet.

Purple:

In order to figure out your initial Frame in Purple, reset the game while Paused and with the Lua Script on, and advance to Frame 6. If you don't see it there, you're either using an old version of the emulator (like me), in which case, just keep advancing one frame at a time until a four-digit hexadecimal number appears. My seed tends to appear on Frame 12; I don't know if this means I'm using a crappy emulator, or if my computer is crappy. In any case, that's your initial seed, and this is the number that you enter into RNG reporter's main page in the "Seed (Hex)" Field.

In Pokémon Emerald, the initial seed is always 0. In Touhoumon Purple, however, seeds will by cycled through in an awkward pattern every minute unless your Real Time Clock is off (not recommended), and as a result, you can only "control" your seed if you are willing to fiddle with your computer's internal clock. Even if you wanted to control your seed, you would need to figure out the formula for how Emerald determines the seed. Unfortunately, the initial seed formula is NOT the exact same thing as it is in Ruby/Sapphire, so we're out of luck.

Fire Red:

I don't fully understand how the game selects its seed, but the important thing is that it does, unlike vanilla Emerald... From what I've learned, there's a timer that runs at 256Hz; 65536clks, and all 1, 2, or 3 button presses used to get to the continue screen matter.

On Fire Red, seeds can actually be controlled to a certain extent. By Pressing A on the exact same frames every time, you will hit the exact same seed every time. Three A presses are required to start up the game at most; one to skip the game freak logo, one to skip the Charizard (Reimu) animation, and one last press to get to the continue screen. For example, if you Pressed A on Frame 200, 300, and 400, you would get the same seed every time. If the seed is any good (a good spread shows up on a good frame), you can take note of the A presses required, and hit to seed again to get that same spread over and over. On Fire Red, your initial Seed is view-able on memory address 0x02020000 once you are on the continue screen.

The least confusing way to hit consistent seeds in Fire Red would probably be to wait until the Reimu screen has finished loading completely, without a single A press from the reset time all the way until Reimu is done loading. For me, Reimu finishes loading on Frame 1724, but probably happens at a different time for everyone else. Starting up the game this way is more likely to produce seeds that can be shared with other players, and it may even be possible to hit these seeds on physical games, which is why I'm bringing it up. If by the time this guide is completed, I may or may not have a list of seeds to share.
« Last Edit: November 22, 2014, 04:33:13 AM by DoctorShanks »
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #1 on: August 28, 2014, 09:21:43 PM »
============
Part 2
============

Hitting Method 1 spreads

Method 1 is the method that the game uses to generate most stationary Pokémon/Puppets in the third generation. Method 1 also includes Gift Puppets like your starter, as well as Namazu and Magic Stones.


With the above in mind, the only preliminary that's actually needed for Method 1 is to save in front of your puppet (and orbs, if you're going for a "legendary"). I'm going to use Kikuri as an example for this Method 1 RNG demonstration. For those unaware, Kikuri is found in Cerulean Cave in place of Mewtwo, or found in Navel Rock in Touhoumon purple.

Next, you should decide on a list of spreads that you wouldn't mind having for your puppet. Depending on the puppet, this could be easy or relatively hard. As Kikuri is a defensive puppet, I was okay with accepting any Defensive nature, with either Attack or Special Attack being lowered.


This is the spread I decided to use. I knew the A presses required to hit this seed, and the target frame is below 1 million, so I wouldn't have to wait too long for it to show up. If you don't have a personal seed bank, you can blindly soft reset and enter the seed you get to see if there is a nice looking spread for you to use. Soft-resetting for seeds takes an embarrassingly long time for a good spread to show up, though.


Kikuri's spread generates right after pressing A on her dialogue (shown in the screenshot above), and most FR legends generate this way. Make a save-state here, pause the game, load the state, then advance to the next frame while holding down A. We are doing this to calibrate how far off the video frame is from the actual RNG frame, since they are not the same.


Pressing A on Frame 1200 gave me the above spread. In order to find out how far off we are, we just need to enter the spread into the RNG Reporter.


RNG Reporter insists that this Kikuri was generated on Frame 850. VBA tells me that I'm on Frame 1200. Obviously, RNG Reporter is right, since not only is my emulator outdated, but this particular Lua Script gives me the Video Frame as opposed to the actual RNG Frame.

This isn't a big deal at all. All we need to do is adjust our Target Frame by subtracting the frame we landed on with the frame we pressed A on. This gives us a difference of 350. Since our Target Frame is 644262, we need to add 350 to that, which gives us a new Target Frame of 644612. At this point, leave the game on Turbo, and depending on how far away your Frame is and how powerful your computer is, you may want something else to do to occupy your time. (HINT: The game moves faster when the Lua Script is disabled; just be sure to check back often and make frequent save states!)

10 minutes later...



Once you are close to your Target Frame, it may be within your interest to advance more slowly towards it. You can pause the game, and advance the frame one at a time until you are finally there. Once you are on the Target Frame, advance to the next frame while holding down A, and this should trigger the battle.



And as expected, we have our Kikuri! Stuff like this takes a lot of patience, from the seed hunt, the spread hunt, and the wait times, but it is the price that must be paid for perfection. You may be wondering why I opted to go for a Special Attack reducing nature for Kikuri, and that is because I have no plans to use her Special Attacks, and I plan to use her as a Doubles supporter. Also, she learns Explosion.



Speaking of Explosion... I decided to Master Orb it to make the battle less of a headache. I know that we technically have TASing on our side for catching puppets, but I was dead tired by this point.



In the end, Fire Red spreads let you catch a Puppet in a unique Orb with a Japanese name + OT. It looks very pretty when transferred over to Emerald, especially since ENG games can read Japanese names. I think I'll try her out in the Battle Frontier sometime soon.
« Last Edit: September 03, 2014, 12:46:04 AM by DoctorShanks »
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #2 on: August 28, 2014, 09:22:29 PM »
============
Part 3
============

Method H-1, H-2, and H-4 Wild Puppets (but mostly H-1/H-2, hopefully).

Method H-1, H-2, and H-4 are the methods that Fire Red and Emerald use to generate their wilds. Fire Red uses H-1, Emerald uses H-2, and both games use Method H-4 when they're drunk.

If you are RNGing in a quiet zone where there are no/few moving NPCs, then it's usually safe to just ignore Method H-4. However, if your calibrated/target spread isn't showing up on H-1/H-2, then check if the spread you did hit is an H-4 spread. If it is, well, I don't know what to tell you other than "it doesn't happen often."

For my Method H-1, sample, I'm going to be RNGing a flawless Lyrica in the "Pokémon" Tower. I figured out the A presses needed for me (emphasis on me) to hit a seed where a flawless Timid spread would generate somewhere around frame 780,000 on Encounter Slot 4. With this in mind, I went up to the floor in the "Pokémon" Tower where Lyrica generates on Encounter Slot 4, saved the game, performed a reset, did my TASing to get my seed, and...

(Note: Since this is Fire Red, you can perform mindless soft-resets until the game spits out a seed with a favorable spread on a reasonable frame)



The first thing you want to do when you get in game is open the start menu, get to your Nature Power slave, hover over Nature Power, then make a save state. From here on out, the calibration process is basically the same process as shown in the Method 1 tutorial.



A few calibrations and 780,000 Frames later, and I manage to encounter my desired Lyrica. Again, the main point of Fire Red RNG is special Orbs (Poké Balls), and a Japanese name/nickname, as well as the odd feeling of owning a legit flawless vanilla puppet.



This is what she looks like when transferred over to Touhoumon Purple. Here we can see the hard work Agastya did in his hack by manually replacing most note-worthy instances of Pokémon with Puppet, and not simply doing an automatic find & replace (did I mention I know nothing about computers?)

----------------------------------------------------------------------------------------

So anyway, now I have a Sand Veil Lyrica on Touhoumon Purple and no Sand Stream Suika to abuse her with. For My Method H-2 demonstration, I'm going to generate a wild Yang (Female) Suika with an Adamant nature. I'm keeping it simple for this example since we're gonna get into Egg manipulation real soon. Also, I'll include a few more screenshots for this one.

In the folder I have included in the download, there should be a list of Touhoumon Purple's encounter slots. By using the CTRL+F function, I find that Suika can spawn in Jagged Pass in Encounter Slot 9 and 11, giving her a total encounter ratio of 5%. You might be thinking, if I just wasn't so goddamn lazy, I could just encounter a Suika like a normal person, but it really doesn't hurt to get a good head start on breeding.



Next, grab your Nature Power user, get to your spot, then save the game. Now, pause and reset the game using CTRL+P. Now, advance the frame slowly using the "\" key or "CTRL+N," and on the 6th RNG Frame, you should get the seed that you are required to work with (remember, we can't control our seed in Purple, though we can get a new seed if we reset every minute). As you can hopefully see on the image on the right, I have my initial seed as 5D98. My Initial seed occurs on Frame 12 in this Lua Script + Emulator, but it will more-than-likely be different for you even if you are using the same emulator.



Before you unpause the game, set up your RNG reporter with the Method as Method H-2, and do a search using your initial seed. I set up my RNG Reporter to search for a Female Adamant puppet in Encounter Slot 9 or 11. I also searched for Ability 0, which is Sand Stream, but I didn't actually need to do that as you'll see later.

Frame 59776 gives me an Adamant Female Sand Stream Suika with a perfect Defense IV, which is a really nice bonus to get a head start on breeding her. Keep in mind that the more specific your search is, then you will need to wait longer for your desired spread to show up.

If you don't see a spread that you like in a certain range of frames that you're comfortable with, you can reset the game, and if a minute has passed since your last reset, you will get a different seed. Once you see a spread you like, un-pause the game, and get to your Nature Power slave. Pause, make a Save State, and advance to the next frame while holding down A.



Pressing A on Frame 800 gives me a Chibi Lily Black with a spread of 25/23/18/28/11/3. Clear out any specifics in the RNG Reporter, and do a search for the exact spread you landed on.



RNG Reporter gave me three different possible Frames that I may have landed on. I lucked out, because since Chibi Lily Black is in Encounter Slot 0 in Jagged Pass, I know that I actually encountered my puppet on Frame 1030. Calibration complete; simply subtract the Frame that you landed on with the Frame that you used Sweet scent on, and that's how many Frames you should subtract your target Frame by. For example, 1030 - 800 = 230, and since my Target Frame is 59776, we just need to subtract that by 230, which gives me a new Target Frame of 59546.



And as expected, pressing A on Frame 59546 gave me the Chibi Suika that was shown in the RNG Reporter. If my Method H-1 RNG demonstration was confusing, then hopefully this demonstration helped to clear up that confusion.
« Last Edit: August 28, 2014, 10:44:20 PM by DoctorShanks »
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #3 on: August 28, 2014, 09:22:59 PM »
============
Part 4
============

Egg manipulation in Touhoumon Purple.

Not only is this the easiest type of RNG Manipulation in the 3rd generation, but is also the most rewarding, giving the user access to egg moves and flawless puppets while rarely ever having to wait more than 100,000 frames. An absolute dream-come-true. Some basics in regards to Emerald Breeding are:

-When eggs are generated in Emerald, the PID, Gender, Ability, and the Nature of the puppet are all set in stone; this makes things much easier and much faster
-When the Female (Yang) holds the Everstone, there's a 50% chance that the egg will be generated with that parent's nature
--This makes the preliminary egg generation phase a lot quicker
-The First Puppet you deposit will have a value of "A" and the second Puppet will have a value of "B"
-The more perfect IVs that your parents share, the better the odds are at finding a flawless spread (at least three perfect IVs between the two parents are required)

In my personal experiences, eggs are generated on the following two Methods: Emerald Splits (Split spreads), and Emerald Alternate. I have no idea what causes the game to pick one or the other, but I think it has something to do with the difference in the RNG Frame and the Timer Value. I may be wrong on this, but if you're getting to the Day-Care-Man dialogue as soon as you start the game, then there is no way to control whether you land on a Split spread or an Alternate spread. Still, a 50% chance to get a flawless puppet is better than a 0% chance. It's actually a bit better than 50% in my experiences; I believe its safer to assume that you will land on an Alternate spread by default. Even still, you can always do searches for both Methods on the same seed, since you'll have to wait a whole minute for the next seed to show up anyway.



Put your desired puppets in the Day Care. If this is your first time abusing eggs or you don't have a puppet with more than three perfect IVs as a parent, then flawless eggs will be impossible unless you breed/catch a 2IV or 3IV Yin puppet first (thankfully, you'll only have to do this once, and you can follow this demonstration to get that puppet). For this example, I am using a pre-bred Flawless Yin Chibi Momiji to breed with the Chibi Suika I caught earlier.

The next step, which screenshots really can't explain, is to ride around until you get your desired egg. If you don't have the Mach Bike, go get it now, and register it to Select. Open up the other Lua Script that came with the Download called "Emerald Egg Tracking RNG Suite.lua," and ride your bike until the Lua Script tells you that an egg has been generated (this happens on Step Counter FF). If the generated egg has the nature you want (the Lua Script will tell you this), then go in front of the Day-Care man, and Save the game. Take the egg and run it through the incubator, and if it doesn't have the Gender and/or Ability that you want, then Reset the game, refuse the egg, and start riding again. If the generated egg DOES have your preferred Ability/Gender, then Pause and Reset the game, and we are now ready for the next stage.



Reset the game with the Lua Script enabled, and take note of your initial seed that appears on the 6th* RNG Frame (again, the Initial Seed may appear on a different Frame for you, depending on the Emulator(?)). Take that seed, and put it in the RNG Reporter. In the Method Tab, select either Breeding (Emerald Alternate) or Breeding (Emerald Splits), select your desired stat spread (if Flawless, click "==31" for each tab), then hit "Generate."

In the Image above, I did a search for a Flawless Physical spread for my Suika. My Initial Seed was 5B43, and a desirable spread was shown to me on Frame 59518S (The S stands for Split). I was actually quite a few attempts in at this point, landing on Splits spreads when I wanted Alternate, and vice versa, so I had my doubts that this spread would work, but since it's here, I figured I have to try it. (Note: If you are RNGing for your first 3IV Puppet, you can take just about any spread with three "31's")



Load the Emerald RNG Suite, un-pause the game, make a Save State (optional), and get into the Day-Care man's dialogue immediately. When he says "Take good care of it," pause the game and make another save state here.

Calibrate by pausing the game and advancing to the next frame while holding A. Run the egg through the Incubator, and put the exact stats that the egg generated with into the RNG Reporter. It helps to know the exact stats that your parents had, but it's not required to know anything about them other than their perfect stats. If the RNG Reporter doesn't give you a result that's anywhere near close to the Frame you pressed A on, then try searching in the other Method (if Emerald Alternate didn't give you a result, try looking in Emerald Splits or Emerald No Splits). Once you have performed a Calibration, you should never have to do so ever again so long as you get into the Day-Care man's dialogue immediately after loading the game; the Frame difference should always be the same. My difference is -8 Frames, and its never been anything different.

Speaking of my difference being -8 Frames, since my Target Frame is 59518S, I would have to press A on Frame 59526 as a result. So at this point, advance to your Target Frame with the spacebar. Once you are getting close to your Target Frame, pause the game and you can advance more slowly using "CTRL+N" or the "\" key. Once you're on your Target Frame, Advance to the next Frame while holding down A, then run your Egg through the Incubator. If all goes well...



...then you should see your desired Puppet on screen. If the stat spread is a lot wonkier than you anticipated, then search for the exact spread you got in a different Method. If this spread shows up in a different Method on the exact same Frame, then fret not! You did everything right, it's just that the game has trolled you. Simply reset and try again, and remember, you shouldn't have to do the Calibration stage more than once.



Someone should really praise my superior nicknaming abilities!

On a more serious note, if you ever have any problems with this type of RNG manipulation (or any other type posted in this thread), leave a reply and I or someone else will get to you as soon as possible. This forum might look dead, but me and the main guys on the Shoddy server check very often for new posts.
« Last Edit: August 29, 2014, 09:08:15 AM by DoctorShanks »
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #4 on: August 28, 2014, 09:23:32 PM »
============
Part 5
============

Shiny Eggs.

(Note: This portion of the guide assumes that you already know how to trade between two save files. It's also quite complicated, especially since I'm not the greatest at explaining technical stuff. I really, really don't know anything about computers... honestly.)

Shiny Egg RNG is really just an extension of the previous post, and I'm sure at least one person other than me wanted to know how to do this. This post is going to be really "talky," because not only do I want to teach people how to do this, but I want to run everyone through how I figured this out.

Smogon actually has a Guide on how to RNG Shiny Egg PIDs on Pokemon Emerald, but this doesn't apply to us seeing as Touhoumon Purple has that "fixed RNG" patch. As consequence of not being able to use a custom seed in the 3rd generation Time finders, we are, as they say, shit out of luck in that regard. So we're gonna have to get a little creative here. We need to understand how Shininess is determined.

Smogon has a well-written Guide on how the game generates Shinies, but I'll try to summarize it as best as I can. Shininess is determined based on a combination of PID and Trainer ID/SID. So, because we an see the Egg's PID via Lua Scripting when it's been generated, if the Egg has a desirable Gender, Nature, and Ability, then we only need the correct Trainer ID/SID in order to hatch it Shiny. That's right. Since we can't hatch this egg Shiny, we're going to have to create the Trainer who can.

Since RNG Reporter doesn't support Emerald ID's, it seems as though we are again, as they say, shit out of luck. I was pretty butt-frustrated at this point. Screw this, we're gonna figure this out manually!

My research lead me to tasvideos.org, where, much to my surprise, I learned everything about Emerald ID's that I need to in order for this to work.

Quote from: TAS Videos
Trainer ID number (Emerald)
The trainer ID is determined in two separate parts: the visible ID and the secret ID.
The visible ID is determined after you leave the naming screen for your character. The game creates an initial seed with the same value at that point as well. It does so by taking the bottom half of the value at address 0x4000104 at the time.

Address 0x4000104 is an entropy byte, which continually increases and is affected by execution at every step. It is unpredictable. It begins running when you enter the naming screen and stops when you leave, when the visible ID is determined.

The secret ID is determined shortly before the character sprite disappears into the black background, after the professor dismisses you.

When the game sets your secret ID, it cycles the RNG 2 times on that frame.

  xxxxxxxx
  aaaaxxxx    secret ID: aaaa

Here's what I was totally not expecting: The Trainer ID and the Secret ID are not written at the same time! One thing I wasn't really too keen on finding out was that the Trainer ID was "unpredictable." I was about ready to throw in the "shit out of luck" towel again, until I read the bit where the game sets your Secret ID shortly after the final A input needed to get to the inside of the truck. Thanks to the Lua Script showing us the RNG seeds in the Output Console, we are able to effectively manipulate our Secret ID. Our Secret ID is all we need to get in order for our Egg to hatch Shiny.

With all that out of the way, let's get started on actually manipulating a Shiny egg!

-----------------------------------------------------------------------------------------------------

[5:08:47] +DoctorShanks: Taking the first suggestion on what I should breed as Shiny for the RNG guide/demonstration/whatever post.
[5:09:01] @Rhetco: suwak


You heard the guy. We're RNGing a Shiny Suwako to close out this guide. As I've mentioned earlier in this post, RNGing a Shiny Egg is pretty much just an extension of RNGing ordinary Eggs, with a few extra steps:

1: Create a new save in a different folder.
2: Manipulate Trainer ID in new save to hatch Egg Shiny.
3: Trade Egg to new save using VBA Link
4: Spacebar.exe
5: ??????
6: !!!!!!
7: a shiney

Obviously, Step 2 is the bulk of the work, but I'm here to walk you through it!



Follow the Egg Manipulation guide in the post above this one, and generate an egg with desirable stats that you wish to hatch Shiny. Once, the egg has been generated, write down the PID of the egg, and then manipulate its stats normally. Once you take the egg, make a Save State, then run the egg through the incubator. If the egg has the stats you want, then load that save state I just told you to make, and save the game normally. Delete the Save State.

For reference, the PID of this egg that I have generated in the very small screenshot above is 59803E83.



Make a new save in a different folder now. For simplicity's sake, name your character and get to the above screen on the right where the professor asks you to confirm your name as quickly as possible. Now, pause the game and read on.



Open up the Memory viewer under Tools > Debug > Memory Viewer, and go to address 0x4000104. It is at that address which we are able to see the TID that the game has given us. If you click the Decimal Display checkbox at the bottom of the Memory Viewer window, then you will see your TID at the address 0x4000104. For this example, I seem to have been given a TID of 59410, which translates to E812 in Hexadecimal. Now, un-pause the game and get to the dialogue shown in the screenshot below.



Once you are on this screen, pause the game once again and make a new Save State. One more A Input will eventually assign an SID to our new Trainer, but we don't want that to happen just yet! Instead, we need to manipulate our SID, and this is where things get a little tricky.

So we have 3 out of 4 pieces of the information required to hatch our egg Shiny: The first four numbers of the Egg's PID, which we shall refer to as the High PID, the last four numbers of the Egg's PID, which we shall refer to as the Low PID, and the Trainer ID. These numbers are 5980, 3E83, and E812 respectively. In order to figure out what SID we need, we first need to convert these three numbers to Binary. This can be done using a calculator with a Programmer mode (the one that probably came with your PC should do just fine).

HID: 0101100110000000
LID: 0011111010000011
TID: 1110100000010010
SID: ????????????????

If you opened the guide I linked to containing the information regarding how the game determines Shininess, then you would know that in order for shininess to occur, that the ones in the first thirteen columns need to add up to either 0, 2, or 4, and never 1 or 3. With this in mind, we can fabricate our own SID by adding zeroes and ones that will force the sum of the first thirteen columns to be either 0, 2, or 4.

HID: 0101100110000 | 000
LID: 0011111010000 | 011
TID: 1110100000010 | 010
SID: 1000111100010 | 000 - 111
 = : 2222422220020

As a result, we have written an SID of 1000111100010000 to 1000111100010111, which is 8F10 - 8F17 in Hexadecimal, or 36624 - 36631 in Decimal. This means that if we can manipulate a Secret ID of 36624 to 36631, then our Egg will be Shiny!

Now, open up the Emerald RNG Suite Lua Script. Run the script, and run the game on Turbo mode for around 10,000 frames. When approximately (or exactly, preferably) 10,000 frames have elapsed, pause the game, hover your mouse over the Output Console, Right Click > Select All > Copy, and paste that information in a Notepad.



On any of these frames, the first four hexadecimal digits could be our Secret ID if we wanted, but we're obviously looking for the digits that will make our egg Shiny. Do a CTRL+F search for your SID Range in Hexadecimal. If you don't see your desired Secret ID in the first four digits of any of these RNG seeds (relatively unlikely), then simply advance for another 10,000 frames and repeat the process.

Once you've found your Secret ID in the Notepad, it's entirely up to you to figure out the exact Frame in which that particular seed occurs on. You can use the location of the scroll-bar in the Notepad to aid you in this task. You can also clear the Output Console by closing and re-opening it, and do searches every 1,000 frames, for example. And you can also do Frame-by-Frame searches by pausing the game and advancing with "CTRL+N" or the "\" key. It's completely up to you; find it however you're comfortable doing it.

After narrowing it down, I found out that my Target RNG Seed occurs on Frame 43502. Once you've found what Frame your RNG Seed occurs on, load the closest Save State you have (with about 100+ frames worth of leeway), and open the "Emerald Egg Tracking RNG Suite." Using this Lua Script, we can see the difference between the RNG Frame and the Timer Value, and no matter how long you hold the spacebar down, this number will never change, at least until it writes our SID. However, we're not ready to write our SID yet; we still need to do a Calibration!



Calibrate as you would expect: Pause the game, load the state, advance to the next frame while holding A, and slowly advance the frame until the exact frame in which the difference value increases by one. What is happening is that the game is rolling the RNG twice in order to assign us our SID. On that exact Frame in which the difference increases by one is the Frame that our SID is given to us. My difference value was 15, and on the Frame it hit 16, the first four digits in Hexadecimal of the pRNG seed would be my SID.

Calculate how many frames it took since the Frame you pressed A to the Frame in which the game wrote your SID, and calibrate by subtracting the Timer Value on the Frame where the game writes your SID by the Timer Value when you pressed the A button +1. The +1 is necessary since the game rolls the RNG Twice to write your SID. For example, my Target Frame is 43502, and I calibrated 76+1 frames to write the SID. 43502 - 77 = 43425. So I loaded a close Save State, then I advanced the frame to 43425 while paused, and finally, I advanced to the next frame while holding down A. As you can see in the screenshot above, when the difference increased by 1, the first four digits of the pRNG Frame were 8F11. Of course, this corresponds to the SID we need in order to hatch our Shiny Egg, but let's get in game just to be sure...



The Egg RNG Suite has a feature in which it tells us the TID/SID of the first puppet in our party. As expected, we manipulated an SID of 36625, which should hatch our Egg as a Shiny! The next step is to simply advance to the point in the game where we are allowed to Trade. This doesn't take as long as you might think, since all we need to do is get the Tohodex.

This guide assumes that you know how to trade between two save files. You will need to use VBA Link, so you'll have to rename your main save and your dummy save. I personally renamed my main save as the .sa1 file, and my dummy save as the .sa2 file.



The next step is to obviously Trade your Shiny Egg To-Be over to your dummy save file, then run around manually until your egg hatches since we obviously don't have the incubator at this point in the game. I like to do this in Littleroot, since it looks nice on the puppet's summary screen.




And that's that! If you have any questions, feel free to drop me a line in Shoddy, or in this Thread, or on my dumblr account. If I missed anything important, I'll be sure to fix this guide up and add a note in the OP.
« Last Edit: October 24, 2014, 10:59:26 AM by DoctorShanks »
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #5 on: August 28, 2014, 09:23:43 PM »
============
Post 6
============

Reserved.

You may now post! Thanks for reading!
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline ZXNova

  • A Member group
  • Posts: 78
  • Life is an explosion!
    • View Profile
Re: Guide to RNG Manipulation in Touhoumon
« Reply #6 on: August 28, 2014, 10:24:17 PM »
Holy crap Shanks, gotta work so hard just to get a shiny.

Offline Zak-something

  • A Member group
  • Posts: 65
    • View Profile
Re: Guide to RNG Manipulation in Touhoumon
« Reply #7 on: October 29, 2014, 12:03:39 AM »
This is a pretty nice guide. and it surprised me because I thought IV spreads like that weren't possible in non-bred gen-3 mons.

One question though, any idea how the guaranteed shinies from PPE are generated?
You know for people who want a shiny starter or Suwako that'll change colors when they trade over to PPE and will probably have a broken location.

Aichi you jerk.

http://eientei.boards.net/
New general Touhou forum

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #8 on: October 29, 2014, 01:39:05 AM »
This is a pretty nice guide. and it surprised me because I thought IV spreads like that weren't possible in non-bred gen-3 mons.

One question though, any idea how the guaranteed shinies from PPE are generated?
You know for people who want a shiny starter or Suwako that'll change colors when they trade over to PPE and will probably have a broken location.

Thank you very much. Some IV spreads are still impossible when dealing with wild encounters, but anything's possible with Eggs.

I'm afraid I have no idea how guaranteed Shinies are determined since such a phenomena does not exist in vanilla generation 3. You'd have to ask someone like the hacker himself how he managed to get it to work since it shouldn't have anything to do with RNG. I don't know what happens to a Johto mon's location either. Sorry.
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline Fatih

  • A Member group
  • Posts: 12
  • You won't pass! For their sake, I will prevail!!
    • View Profile
    • The Mountain of Fatih (CURRENTLY DOWN)
Re: Guide to RNG Manipulation in Touhoumon
« Reply #9 on: May 24, 2016, 09:56:35 PM »
oman thanks for this, although im still braindead reading through that

I'll probably ask on shoddy, shinies will become mine >:D

Offline Zak-something

  • A Member group
  • Posts: 65
    • View Profile
Re: Guide to RNG Manipulation in Touhoumon
« Reply #10 on: May 25, 2016, 01:46:19 PM »
If you just want shinies, there's a bonus part of PPE that makes it so every puppet generated is shiny (although it requires paying the absolute max cap amount of ingame money, which takes a while to grind to, and when you trade them to Purple they probably won't have the same color).

Aichi you jerk.

http://eientei.boards.net/
New general Touhou forum

Offline Fatih

  • A Member group
  • Posts: 12
  • You won't pass! For their sake, I will prevail!!
    • View Profile
    • The Mountain of Fatih (CURRENTLY DOWN)
Re: Guide to RNG Manipulation in Touhoumon
« Reply #11 on: June 04, 2016, 01:43:41 PM »
Is it possible to modify your seed value using a code? I don't think it will happen to work. My seeds are starting to go from D88x, D8Ax, D8B, now D8Cx... I'm trying to hit D88B, which gave me a really good spread.

EDIT: Well, I just remembered (duh) that the seed is affected by your time, so I rolled back by an hour and I'll just find it.
« Last Edit: June 04, 2016, 01:56:10 PM by Fatih »

Offline DoctorShanks

  • :coolguys:
  • A Member group
  • *****
  • Posts: 195
  • .
    • View Profile
    • dumblr
Re: Guide to RNG Manipulation in Touhoumon
« Reply #12 on: August 14, 2017, 04:43:03 PM »
Hi.

So I don't remember the password to my photobucket account nor the email with which I apparently used with that account because with the many more convenient image source options, I did not need it anymore. Furthermore, the images and save files I used are on my old & deceased hard drive.

I apologize, but I am not in any state of mind to rewrite this or attempt to understand this again. For anyone that understood this and may wish to write a new one, then by all means. But for now, I'm probably going to save this into a notepad, unpin it, and delete is within a month or so. Again, I'm really sorry.
[8:30:13] DoctorSnacks: Are A/TSanae actually good or do people just use them because they're cute? Or Both?
[8:30:23] SupremeExplosion: Shoddy is a reskinned weenie hut juniors

Offline Wrulfang

  • A Member group
  • Posts: 57
    • View Profile
Re: Guide to RNG Manipulation in Touhoumon
« Reply #13 on: August 14, 2017, 09:44:44 PM »
I don't think deleting the whole thing is necessary. even with the loss of the pictures, the text information is still pretty good, and I've basically using this guide everytime I rng stuff on 3rd gen, regardless of touhoumon or not. I know there are other guides but I always prefered to read this one.