RainingChain Posted September 8, 2023 Posted September 8, 2023 (edited) Here's what I've discovered about Mystery Gifts in Pokemon Stadium 2. Similarities with GameBoy Color Infra-Red Mystery Gifts The logic is the mostly the same between Pokemon Stadium 2 and Mystery Gift between GameBoy Color using infra-red system. The game chooses a random item and decoration separately. The game first tries to give the decoration but you already have that decoration, you will get the item instead. Choosing a specific item or decoration gift to send occurs in two stages. First, the game selects a set from which the gift will come. Then, it uses a part of the player's Trainer ID number to determine which gift from that set to send. (Below, bit 0 refers to the least significant bit of the Trainer ID and bit 15 refers to the most significant bit. Given the Trainer ID 32768, which translates to 1000000000000000 in binary, bit 15 is 1 and bit 0 is 0.) The logic for determining the item given is the same as the logic for Mystery Gift between GameBoy Color using infra-red system. See https://bulbapedia.bulbagarden.net/wiki/Mystery_Gift for more info. Decoration Logic The logic for determining decoration is different however. Random number. Range . Gift set . Overall rate 1st 36-255 Common 223/256 0-35 N/A (pick a 2nd number) 2nd 72-255 Uncommon 25/256 0-71 N/A (pick a 3rd number) 3rd 72-255 Rare 7/256 0-71 N/A (pick a 4th number) 4th 154-255 Very Rare 1/256 77-153 Tentacool Doll 0/256 0-76 Tentacool Doll or Pikachu Bed 0/256 Common, Uncommon, Rare and Very Rare follows a similar logic as GameBoy Color Infra-Red Mystery Gifts (using Trainer ID). The exact bit used for each item and decoration is slightly different. Check https://bulbapedia.bulbagarden.net/wiki/Mystery_Gift for the detailed list. Upon reaching the 4th roll with 0-76, Tentacool Doll is given if Round 2 has not been unlocked and Pikachu Bed is given if Round 2 has been unlocked. No code exists to return Unown Doll (internal decoration ID 35). Why Tentacool Doll and Pikachu Bed are unobtainable You may have noticed that Overall rate for Tentacool Doll and Pikachu Bed is 0/256. Here's why: To obtain Tentacool Doll, the game must roll 0-35, 0-71, 0-71, 0-153 (assuming Round 2 hasn't been unlocked). To obtain Pikachu Bed, the game must roll 0-35, 0-71, 0-71, 0-76 (assuming Round 2 has been unlocked). Those sequences of numbers are not possible. The game uses a 32-bit linear congruential generator: result = (seed * 0x19660D) + 0x3C6EF35F; Mystery Gift logic only uses the last 8 bits of the generated random number. The last 8 bits of the generator follows a cyclic pattern: 0,95,50,233,52,3,134,45,168,231,26,177,92,11,238,117,80,111,2,121,132,19,86,189,248,247,234,65,172,27,190,5,160,127,210,9,212,35,38,77,72,7,186,209,252,43,142,149,240,143,162,153,36,51,246,221,152,23,138,97,76,59,94,37,64,159,114,41,116,67,198,109,232,39,90,241,156,75,46,181,144,175,66,185,196,83,150,253,56,55,42,129,236,91,254,69,224,191,18,73,20,99,102,141,136,71,250,17,60,107,206,213,48,207,226,217,100,115,54,29,216,87,202,161,140,123,158,101,128,223,178,105,180,131,6,173,40,103,154,49,220,139,110,245,208,239,130,249,4,147,214,61,120,119,106,193,44,155,62,133,32,255,82,137,84,163,166,205,200,135,58,81,124,171,14,21,112,15,34,25,164,179,118,93,24,151,10,225,204,187,222,165,192,31,242,169,244,195,70,237,104,167,218,113,28,203,174,53,16,47,194,57,68,211,22,125,184,183,170,1,108,219,126,197,96,63,146,201,148,227,230,13,8,199,122,145,188,235,78,85,176,79,98,89,228,243,182,157,88,215,74,33,12,251,30,229,0 The first random number is selected randomly in that list, then at every new roll, the next random number is the next one in the list. The issue is that there are no 4 consecutive numbers that are 0-35, 0-71, 0-71, 0-153 respectively. This means Tentacool Doll (and Pikachu Bed) can't be obtained. The sequence to obtain a Very Rare decoration (0-35, 0-71, 0-71, 154-255) appears once (15,34,25,164). In short, none of the Pokemon Stadium 2 exclusive decorations are actually obtainable. Special thanks to Lincoln for providing the initial disassembly of Mystery Gift functions of Pokemon Stadium 2. https://github.com/Lincoln-LM/stad2 Edited September 10, 2023 by RainingChain 2
RainingChain Posted September 8, 2023 Author Posted September 8, 2023 (edited) By using hacks, it is possible to receive Pikachu Bed, Unown Doll, and Tentacool Doll. In Pokemon Stadium 2 USA 1.0, place a breakpoint at command 0x801454F8 and alter the register V0 to 0x22 for Pikachu Bed, 0x23 for Unown Doll, or 0x24 for Tentacool Doll. Note that the Unown Doll is displayed as "DECORATION". Edited September 9, 2023 by RainingChain 2
SnorlaxMonster Posted September 10, 2023 Posted September 10, 2023 From the sounds of it, this research was all conducted on English Pokémon Stadium 2. Is it feasible that it could have been possible to obtain the exclusive decorations on Japanese Pokémon Stadium GS? (e.g. If in the localization process, they tweaked the probabilities of Mystery Gift items, but inadvertently made them impossible to obtain.)
RainingChain Posted September 10, 2023 Author Posted September 10, 2023 (edited) On 9/10/2023 at 7:52 AM, SnorlaxMonster said: From the sounds of it, this research was all conducted on English Pokémon Stadium 2. Is it feasible that it could have been possible to obtain the exclusive decorations on Japanese Pokémon Stadium GS? (e.g. If in the localization process, they tweaked the probabilities of Mystery Gift items, but inadvertently made them impossible to obtain.) I just tested Mystery Gifts on Japanese version. The RNG function and the 4 consecutives check (< 36, < 72, < 72 < 77) are the same. I confirm that the Tentacool Doll and Pikachu Bed decorations can't be obtained on Japanese Pokémon Stadium either. Edited September 10, 2023 by RainingChain 2
suloku Posted September 12, 2023 Posted September 12, 2023 Really interesting info, I came here referenced via this document (leaving it here for other people, it is an easy to digest info about all gen 2 mistery gift mechanics) https://bluemoonfalls.com/pages/general/mystery-gift Pretty happy to see this finally understood, that explains those 3 afternoons I spent years ago on emulator setup, advancing the clock (years even) without getting any new decoration from stadium.
SadayOJ Posted September 20, 2023 Posted September 20, 2023 Not sure if this would work or not, but I remember hearing N64's keep bits of data stored in the RAM when a game is removed while running (I want to say Rare was going to use this in Banjo & Kazooie for bonus content) is it possible to use this to put in an RNG value that would generate the string of RNG necessary? (I believe this is similarly used in a Paper Mario speedrun to manipulate the RAM values.)
poptartFighter Posted October 5, 2023 Posted October 5, 2023 I'm not really sure if this is entirely appropriate for the topic, but would it be possible to create a n64 gameshark code that would modify the mystery gift sent? I.E force it to give you a certain decoration). I guess the question would depend if the RNG takes place in an addressable space for the Gameshark.
RainingChain Posted November 24, 2023 Author Posted November 24, 2023 Note: On PAL Stadium 2, the code is also the same as the US and JP versions. Breakpoint on PAL: 0x80145524
Mark_Eire Posted October 14, 2024 Posted October 14, 2024 On 10/5/2023 at 6:35 PM, poptartFighter said: I'm not really sure if this is entirely appropriate for the topic, but would it be possible to create a n64 gameshark code that would modify the mystery gift sent? I.E force it to give you a certain decoration). I guess the question would depend if the RNG takes place in an addressable space for the Gameshark. Just spent a while trying to figure this out, but I'm afraid I'm out of my depth! Hopefully someone more knowledgeable can generate some Gameshark codes (it would be very cool to see!), or confirm if it is just not possible. @RainingChain In my attempt to make a gameshark code for PAL Stadium 2, I seemed to find the breakpoint was different. PAL Breakpoint: 0x80145658 Not sure if this different value is of any particular note. I could be making a mistake, but I began using 0x80145524 and couldn't get anything to work. Swapped over to NTSC to confirm I could change the gift, then found this value worked for PAL after some experimenting.
elSteeler Posted Thursday at 10:29 AM Posted Thursday at 10:29 AM (edited) Okay so I have no explanation for this and I know this will sound very unbelievable, but bear with me. I will give as much disclosure and information as I can, so that perhaps we may figure out if this is something legitimate or not. I have spent the past few hours resetting my clock to 11:58PM over and over to farm Stadium 2 Mystery Gift (trying to get Scope Lens and Miracleberry "legitimately") On this Gold save file, TID 28821, I only just reached Goldenrod about a week ago to unlock Mystery Gift. My most recent save backup was in Azalea Town on December 19th, and the only decorations I have according to that backup are Deco Plant 4 (not sure what this is), Deco Bed 1 (default I'm sure), and Players Room Poster (Town Map poster I think). I backed up this save because originally, I had the TID set to 00007 from the start of the game (not sure what TID the game actually gave me). I switched the TID at this point, before reaching Goldenrod and ever using Mystery Gift, because I wanted the set of Mystery Gifts that would come with TID 28821 I am positive that I have not backed up this save since then or modified it since I was in the midst of resetting the clock for Mystery Gift over and over and was getting fed up with not getting the items I need, so I took a break and decided to decorate my room in Stadium 2 To my utter disbelief, a Surfing Pikachu Doll and UNOWN DOLL are sitting in my inventory Along with Clefairy, Squirtle, Diglett, Staryu, Magikarp, Gengar, Shellder, Voltorb, Weedle, Geodude, and Machop Dolls I also have Red, Blue, and Yellow Carpets TropicPlant and Jigglypuff Poster as well Everything in bold is decorations that TID 28821 cannot receive through Stadium 2 (some of them can't even be received by TID 00007 either) I have not Mystery Gifted with any cartridge saves, as I only have one Game Boy Color at the moment Unfortunately, I did not record the majority of this process. I only recorded about 12 minutes of myself resetting, before changing my mind and ending the recording because I felt like it would take far too long to get what I wanted. For context, I've been Mystery Gifting Carrie for about 3 hours or so. The idea was just to record myself getting Mysteryberry and Scope Lens for proof if my stream chat asked how I acquired them and if I cheated them. I did record myself getting a Mystery Gift on stream last night https://www.twitch.tv/elsteeler/clip/ExuberantVastLapwingVoteYea-9-4pSB6zGSBgjoUR And ironically, I stumbled upon something much, much more suspicious My theory is that somehow, letting the clock roll over and farming Mystery Gift like this has screwed with something in the Mystery Gift. Maybe a flag isn't getting reset or something, I don't know. But I believe that I am somehow also receiving the decorations that Carrie received. I say this because in the Twitch clip, Carrie says she got an Unown Doll. I didn't register this at the time, but she also said this before I even Mystery Gifted her. I'm not sure if she usually says something but the dialogue makes it clear that I am meeting her for the first time, immediately followed by her Unown Doll dialogue. She's also been making comments about receiving other decorations. I for sure remember her getting multiple Carpets, while I have "received" none from her. Yet they are in my inventory. As far as the decorations that I actually remember receiving, it's Squirtle, Gengar, Voltorb, Weedle, TropicPlant, and Jigglypuff Poster. And those are all possible for my TID thru Stadium 2 anyway. I definitely do not remember receiving any of the gifts in bold, nor anything else I didn't mention. My process, for anyone who wants to try this: 1. After taking that day's Mystery Gift, go into Game Boy Tower and reset the clock to the next day at 11:58pm 2. Save the game in a Pokemon Center 3. Exit Game Boy Tower and Mystery Gift with Carrie. If she sent an item, enter the Lab and receive the gift from Oak. 4. Wait until clock runs over to 12:00am the next day, and Mystery Gift with Carrie again. If she sent an item, reenter Lab and receive second gift. 5. Repeat step 1 and so on During this process, I have definitely gone too fast and tried to Mystery Gift before the clock rolled over to 12:00am, several times. I'm not sure if that also has something to do with what's happening. Just in case it becomes relevant, I also should mention that I have Crystal in my port 1 Transfer Pak and Gold in my port 2 Transfer Pak. I Mystery Gifted Crystal only twice, for yesterday 1/1/25 and today 1/2/25 since I have not messed with that in-game clock. That Crystal save is TID 00007 and does not have any unexpected decorations. I plan to recreate this situation at some point with a different, fresh save that has just reached Goldenrod and never been modified. I'll record the entire process and check the room frequently for new decorations that haven't been properly received. If anyone out there is interested or curious, please let me know if you find anything. Edited yesterday at 05:28 AM by elSteeler
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now