|Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.
November 15th, 2014 (9:07 AM). Edited November 17th, 2014 by MajinBlueDragon.
EDIT: I went ahead and cleaned this up so it was easier to read, heh.
I really wanted to make a hack of this game with the Pokémon that weren't included, so I started poking around for data! As far as I know, this is the first ever data documented on this game, so I'll try to be as detailed as possible. Here's what I've found so far:
Pokémon structure format:
this is a little weird and I'm not 100% sure what all of this does, so bear with me. Starting at 0x6A3707 is the data for the Pokémon themselves. It goes as follows:
Name in Ascii (0x0A Bytes)*
Catch Mode Sprite (0x01 bytes; 00 if none, defaults to Treecko?)
Hatch Mode Sprite (0x01 bytes; 00 if none, defaults to Wurmple?)
Unknown (0x01 bytes; always 00?)
Evolution (0x02 bytes; [type] [Pokémon])
Additional unknown data (0x9 Bytes)
Total size of each Pokémon: 0x18 bytes
The Pokémon you will encounter, whether by Catch or Hatch mode, is always sent to 0x02000598 in memory. You could make a cheat to set a Pokémon for easy testing!
*Changing this affects how a Pokémon's name is displayed during play ("You caught/evolved [Pokémon]!") but NOT for its Pokédex entry. That data is apparently completely separate. I have not found any information on the Pokédex yet, though it would be nice to eventually have control over at least the list order. Any left-over space in a Pokémon's name is filled with 0x20, or an ASCII space character.
Values for evolution type:
00 - Does not evolve*
01 - Exp.
02 - Leaf stone
03 - Fire Stone
04 - Link Cable
05 - Moon Stone
06 - Water Stone
07 - Thunder Stone
08 - Sun Stone (unused / untested)
09 - Affection
0A - Pokéblock
0B - Split**
*Must "evolve" in to 0xCD/Blank Pokémon???
**PRETTY sure the way this works is "declared Pokémon value + 1"; i.e. 0B 9B to evolve in to either Pikachu OR Raichu, 0B B3 to evolve in to either Corsola or Chinchou, etc. Not sure how the evolution method (Exp., Stone, etc.) is determined in such cases as neither Gloom nor Wurmple offer any clues so far (possibly hardcoded?) Please chime in if you feel you could shed some light on this! It would be really nice to have more control over this so that adding Pokémon such as Eevee might be possible.
Also unknown to me is how Shedinja is handled by the game. This may also possibly be hardcoded (automatically add to Pokédex once Ninjask is obtained maybe???), if anyone has any idea how this works or the possibility of modifying or disabling such behavior, please offer your input!
Wild Pokémon Lists/Format:
Each list is 0x10 bytes in size, allowing for 8 Pokémon per list. If you would like to have less than eight Pokémon, use 0xCD (a "blank" Pokémon) to fill in the remaining slots. There are two lists per field location. Not sure how lists are assigned to the appropriate field locations just yet, the only pointers I found lead to the first of all these lists only...? (I.E. Petalburg Ruby 1)
Format: PP 00 PP 00 etc (PP = Pokémon in hex, 00 has no value). All addresses are in hexidecimal. It's interesting to note that based on these internal lists, literally all information online regarding Pokémon catch locations have incorrect data (there is no Medetite in the Safari Zone!!!)
Anyways, here are the lists:
Additionally, Aerodactyl, Chikorita, Cyndaquil, Totodile, and Latios/as can be found at random on any given field, supposedly... I have no idea where this data is stored, as I have been unable to make them appear legitimately yet to do a memory trace. It would also be nice to be able to find the data to determine which Pokémon is used when Jirachi is called, or any of the legendaries are faced in a Bonus capture game, so if anyone has any ideas please share them!
Egg Pokémon Lists - These are the lists of Pokémon which can be hatched from eggs. 0x34 bytes each, one list per table universal across all field locations. Format is same as wild Pokémon, i.e. PP 00 PP 00 etc. (not sure what happens if 0xCD is used to truncate list in this case)
Cry data exists in the game for Bayleef, Meganium, Quilava, Typhlosion, Croconaw, Feraligatr, and Deoxys. None of these Pokémon are available in the game, and the Johto starters can't even evolve as a result! No remaining data for these Pokémon appear to be left, though there are four placeholder portraits featuring crudely drawn numbers still in the game for up to Pokédex number 210 (if the blank entry 0xCD is assumed to be #206, these would come directly afterwards!) ... I question if it is possible to add more than 205 Pokémon if the game considers 206 to be the "end" value, but it shouldn't be impossible with the right skills.
Also found unused was, for some reason, the Elite Four battle music from Ruby and Sapphire. Old trailers of this game showed the Wild Pokémon theme also being used at one point, so this is likely a leftover from a time in development when Ruby and Sapphire music was still being used instead of original themes.
So that's all the information I have found so far! Please let me know if you have any questions, if I didn't explain something well enough, or if you have any suggestions or ideas you might be able to contribute to this further! My ASM skills are so limited that this is about all the data I was able to find myself so far, but it's a step in the right direction for hacking at least the Pokémon themselves! Actual physical table "map" data is probably beyond my research skills at the moment... my eventual goals are to be able to have more control over split-type evolutions, and to be able to add additional field areas outside of the nine available (as well as editing and better understanding the "travel order"), so if anyone has any suggestions on where to go next or other neat things I should dig in to, let me know! I'll be doing some poking myself in the meanwhile.
Finally, here is a list of all the Pokémon's hexidecimal values!
November 20th, 2014 (11:39 AM). Edited November 20th, 2014 by MajinBlueDragon.
So, slight update! It turns out that the whole "two list per field" thing is because they correspond to the two-arrow and three-arrow Catch Modes, respectively. It also appears as though the higher a Pokémon appears on the list, the less common they are, though I haven't been able to test this 100% thoroughly. It does so far appear the be the case however, and judging by the orders shown it would certainly make sense (so the last entry in the list would be the rarest, for example)
Now, on a slightly more exciting note, boredom and curiosity got the better of me earlier. I decided I wanted to reverse-engineer how the encounter data for the GameBoy Color pinball titles worked as well, for a few reasons! The main reason of course was that I hope to eventually port those field locations over to my hack in some form or another, but another big reason was due to my discovery that all Pinball R/S encounter data available online was in some way wrong. Well, wouldn't you know it, I've discovered the same thing with this! ...well, not so much wrong so much as it is incomplete, but that's okay, because I've gone and ripped the encounter data! Also, as if a third reason was necessary, "because I could", heh.
I thought about making a new thread but screw it, this is the universal pinball thread now Anyways! Encounter data works very differently from the GBA games. Red Table data starts at 112CC, and Blue at 1144D. Some relevant pointers also seem to appear just before the former. Two lists per field once again (two and three arrow, henceforth referred to as "common" and "rare") and each is 0x10 bytes each, much like the GBA games, only this time there are no spacers! That's right, in theory, you could have up to 16 different Pokémon appear on the field, but there is a slight catch. Rarity is determined by how frequently a Pokémon shows up in the list--I.E., there will be multiple instances of common things such as Pidgey or Krabby on a lot of field lists. Due to this, many maps will not actually hold a full 16 Pokémon (in fact, none do) ... another thing of note is that the Pokémon are always listed in index-numerical order on these lists, though I'm pretty sure that shouldn't matter in the slightest. As for the Pokémon index numbers, they are identical to that of Gen 2's, so just look up the hexadecimal numbers for that (I.E. Bulbasaur at 01, Mewtwo at 96)
Indigo Plateau is the last field location for each table, and is always followed by a single instance of Mew, making it the only list to be 0x11 bytes. After Blue Table's Indigo Plateau is also a list consisting entirely of only final evolutions (I.E. no Charmeleon, Metapod etc)...absolutely no idea what this could be for other than a potentially internal list to tell the game what not to allow to evolve, but...I wouldn't have thought it was handled that way. Hm.
Anyways! Here are the lists ripped straight from those games for those interested! The numbers beside the names represent how many times that Pokémon appears in the list (in other words, its rarity)
Red Table Encounter lists:
Blue Table Encounter Lists:
so that's that! I have a feeling this isn't a particularly popular series for most people in rom hacking, but if you find any of what I've come across interesting, feel free to take a peek at some of the stuff I mentioned wanting to do in the first post! (Particularly, the things I suspect to be hardcoded) ... if nothing else, I hope this will be useful to someone at some point. I might make editors for these games once my understanding is a bit better and my coding skills are more comfortable!