Jump to content

SuperSwampert67

Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

10 Good

About SuperSwampert67

  • Rank
    Member
  • Birthday 08/26/1990
  1. http://projectpokemon.org/forums/showthread.php?10293-R-B-Y-and-G-S-C-s-Box-Editing&p=85744#post85744 Posted this months back, but no one seemed to care. Hope this helps.
  2. For the python script that does both withdraws and deposits -> http://code.google.com/p/ir-gts/ As for #2, I don't think so. The most logical way would, in the same vein of how the GTS script works, emulate Nintendo's Wi-Fi servers and send a custom Wonder Card from your PC through the Mystery Gift system. I don't think such a tool has been created yet, however.
  3. Hello all, I'm SuperSwampert67, hobbyist programmer and gamer. I just joined the forums for some advice and to give out some info that I know. I discovered that, unlike the GBA-onward Pokemon games, there wasn't a lot of information on the net about R/B/Y or G/S/C (which I'll now refer to as the Color and Metal generations, respectively). One thing in particular I had trouble finding was information about the box systems. So, in pursuit of knowledge, I began to reverse engineer them myself. To be honest, the systems weren't all that hard to understand, so this should hopefully be easily understood. However, I currently hit a snag in my Color Gen research. If you're interested in helping, go to the Color Gen section. Update Log July 23, 2010: First post. Credits Thanks to the writers at Bulbapedia for explanation of the structures of Party Pokemon and the character map used in both Color and Metal Generations, among other things. General The box systems in both the generations are very similar in size, and both follow the same pattern for ordering data. Pokemon Deposited BYTE (1 BYTE) Pokemon Sprite Buffer (21 BYTES) Pokemon Data (660 BYTEs in Color, 640 BYTEs in Metal) OT Name Buffer (220 BYTEs) Nickname Buffer (220 BYTEs) Pokemon Deposited BYTE The very first BYTE of the box is the "Pokemon Deposited" byte. It's a number between 0 and 20 (unsigned) which tells the game how many Pokemon are in the box. Very simple. Pokemon Sprite Buffer The next 21 BYTEs are what I call the "Pokemon Sprite Buffer". It's named that because each entry in the buffer identifies what sprite to load for which Pokemon entry, by the Pokemon's index number. I don't know why it's done this way, but if you don't have the Sprite Buffer match the corresponding Pokemon data, you'll see the wrong sprite when you view it's stats. The list is terminated by BYTE "FF", aka 255 or -1, depending on how you look at it. The list is always 21 BYTEs long, so if there's less than 20 Pokemon in the box, you have to pad the end of the buffer with useless data, typically "00" or "FF". Pokemon Data After that, then the actual Pokemon data is saved. Each Pokemon is 33 BYTEs long (Color) or 32 BYTEs long (Metal). They follow the same order as the entries in the Pokemon Sprite Buffer, and have no gaps between one another. If there's less than 20 Pokemon in the box, the data is padded at the end with useless data until it's the same size as a 20 Pokemon data block. OT Name Buffer and Nickname Buffer If you look at the data, you'll see that the two things that aren't saved with the Pokemon data themselves are the OT Names and the Nicknames. These pieces of data come in their own buffers, the "OT Names Buffer" and the "Nicknames Buffer". Each buffer is 220 BYTEs long, and follow after the Pokemon data. The names aren't stored in ASCII format, they use their own system, though each character is one BYTE. At the end of the name is a terminator character, and then it's padded to 11 BYTEs if it's smaller. NOTE: OT Names are only 7 characters long, you can't have more than that! Nicknames, however, are 10 characters long, so you can reach 11 BYTEs with a long nickname. (10 characters + terminator character) One final note that's very important to mention. I'm not sure what the byte ordering system is in the GBA+ games, but in these games, the bytes are Big Endian. Metal Generation I pretty much have figured out the Metal Generation. Things that still need to be figured out: Changing the Name of the Boxes How Crystal determines if the OT was Male or Female How Eggs are Stored How the Pokerus field works. Pokemon Data Format Species Index - BYTE Held Item Index - BYTE Attack 1 Index - BYTE Attack 2 Index - BYTE Attack 3 Index - BYTE Attack 4 Index - BYTE Original Trainer Numeric ID - WORD Experience Points - 3 BYTES HP Stat Exp - WORD Attack Stat Exp - WORD Defense Stat Exp - WORD Speed Stat Exp - WORD Special Stat Exp - WORD DVs* - WORD Attack 1 PP* - BYTE Attack 2 PP* - BYTE Attack 3 PP* - BYTE Attack 4 PP* - BYTE Happiness* - BYTE Pokerus* - BYTE Caught Data* - WORD Level - BYTE DVs DVs are the IVs of the Color/Metal Generation. They can range between 0-15 for Attack, Defense, Speed, and Special. The Special DV applies to both Sp. Atk and Sp. Def in the Metal Gen. Each DV is 4 bits in size, thus 16 bits total. (2 BYTEs or 1 WORD) The DVs are ordered Attack, Defense, Speed, and Special. The HP DV is special in that it depends on the other DVs. It takes the bottom bit of each of the other DVs to determine its value. Hidden Power is affected by DVs in the Metal Gen. Attack PP The top two bits of the BYTE are the number of PP Ups used on the move. Thus, it can range from 0 to 3 PP Ups. The bottom six bits are the actual PP of the move. Thus, it can range from 0 to 63. Happiness How happy the Pokemon is with its current trainer. Maximum happiness is 255, while maximum unhappiness is 0. Pokerus Unknown at this moment in time how to identify "Never Infected", "Infected", and "Cured". Caught Data The first byte is the index of the location the Pokemon was caught at. The top two bits of the second byte is the time it was caught at. (1 is Morning, 2 is Day, 3 is Night) The bottom six bits of the second byte is the level it was caught at. (Level ranges from 0 to 63.) Save File Offsets These offsets were retrieved from US copies of Gold, Silver, and Crystal. They may not work for different region and/or build version games. Each box immediately follows the previous box in the save data, with the exception of BOX8, which is has a small block of useless(?) data between it and BOX7. Each box is 1,104 BYTEs long. Indexes Pokemon http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_%28Generation_II%29 Moves http://bulbapedia.bulbagarden.net/wiki/List_of_moves Items http://bulbapedia.bulbagarden.net/wiki/List_of_items_by_index_number_%28Generation_II%29 Color Generation Like I said above, I hit a snag. Once I can figure it out/get help, I can't perfectly say I understand the R/B/Y box systems. When you view the boxes in the save data, you find that the current box actually is moved to it's own block of memory in the save (offset 0x30C0 in Red/Blue, not sure on Yellow/Green). The game only updates this block of memory whenever there are modifications made, and where you'd normally find that box's data in the save, you find that the "Current Pokemon Deposited" variable is set to 0 and the Pokemon Sprite Buffer empty. So, what in the game save tells the game to place the box data if you were to change boxes? I had found a couple possible areas, but they were close to the beginning of the save, and whenever I modified them, I always got a "Save is corrupted!" error on load. So, is there a checksum for the early part of the save? Or is the box number saved in multiple locations, and the game must check each one to ensure they all match? Any help would be appreciated on this. Pokemon Data Format Species Index - BYTE Remaining HP - WORD Unknown - BYTE Status* - BYTE Type 1* - BYTE Type 2* - BYTE Capture Rate/Item* - BYTE Move 1 Index - BYTE Move 2 Index - BYTE Move 3 Index - BYTE Move 4 Index - BYTE Original Trainer Numeric ID - WORD Experience Points - 3 BYTES HP Stat Exp - WORD Attack Stat Exp - WORD Defense Stat Exp - WORD Speed Stat Exp - WORD Special Stat Exp - WORD DVs* - WORD Attack 1 PP* - BYTE Attack 2 PP* - BYTE Attack 3 PP* - BYTE Attack 4 PP* - BYTE Status Identifies status conditions. If bit 3 is set, then the Pokemon is asleep If bit 4 is set, then the Pokemon is poisoned. If bit 5 is set, then the Pokemon is burned. If bit 6 is set, then the Pokemon is frozen. If bit 7 is set, then the Pokemon is paralyzed. Type Identifies the two types of the Pokemon. If the Pokemon only has one type, then both Type variables are set to the same value. Do not currently know the type indexes. Capture Rate/Item When a Pokemon is captured in the Color generation, this field is set to it's Capture rate. This field will not change even if it evolves into a Pokemon with a different Capture Rate. However, when a Pokemon is traded from the Metal Generation into the Color Generation, the index for the item the Pokemon is holding, if any, is saved here instead. DVs DVs are the IVs of the Color/Metal Generation. They can range between 0-15 for Attack, Defense, Speed, and Special. The Special DV applies to both Sp. Atk and Sp. Def in the Metal Gen. Each DV is 4 bits in size, thus 16 bits total. (2 BYTEs or 1 WORD) The DVs are ordered Attack, Defense, Speed, and Special. The HP DV is special in that it depends on the other DVs. It takes the bottom bit of each of the other DVs to determine its value. Hidden Power is affected by DVs in the Metal Gen. Attack PP The top two bits of the BYTE are the number of PP Ups used on the move. Thus, it can range from 0 to 3 PP Ups. The bottom six bits are the actual PP of the move. Thus, it can range from 0 to 63. Save File Offsets These offsets were retrieved from US copies of Red/Blue. They may not be valid for different region and/or different build version games. See above for explanation of the "Current Box" buffer. There is a small gap between BOX6 and BOX7. Other than that, there are no gaps between boxes. Each box is 1,122 BYTEs long. Indexes Pokemon http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_index_number_%28Generation_I%29 Moves http://bulbapedia.bulbagarden.net/wiki/List_of_moves
×
×
  • Create New...