suloku Posted October 15, 2015 Posted October 15, 2015 (edited) EDIT: this has been replaced with the following, more complete tool: https://projectpokemon.org/forums/showthread.php?48943-GEN-5-Generation-5-save-tool-entralink-medals-join-avenue-and-others-not-in-pokegen https://github.com/suloku/BW_efd_tool Pokémon Black and White Entralink Forest Tool 0.1 by Suloku '15 --------------------------------------------------------------- This is a simple tool that can do the following: - Dump entralink forest data from a Pokémon Black/White savegame. - Inject entralink forest data to a Pokémon Black/White savegame. Included is a .efd file (entralink forest data) that contains a forest that holds the Dream arceus event. There are other dream event pokémon as well, I think all of them, but I haven't checked. There are many other dream pokémon in the forest as well. Enjoy. Credits ------- Marc_Max for his savefile and liking his forest being full of Pokémon instead of catching them. You can get his saves here: http://usuaris.tinet.cat/mark/juegos/savegames Original post: Yesterday I asked a friend if he had collected the Dream Arceus on pokémon black & white. Turns out he did not just collect it, but he actually never picked up any of the dream pokémon, including arceus. I tested his save and confirmed that when a dream pokemon is captured in entralink forest, that's when it is generated. So I though: all the forest data must be somewhere in the savefile, it would be great if I could just copy it over my save and get all those dream pokémon. I've been all afternoon documenting the missing sections of pokémon B&W savefile, then I compared 3 savegames and started to transfer the sections that were changed after catching arceus to my own savefile (which actually has no entralink forest data since I never even used entralink). http://projectpokemon.org/wiki/Pok%C3%A9mon_BW_Save_File_Structure#Main_Save_File_.26_Backup Not only has the section to be transfered, but checksum block needs to be updated too. I'll try to code a simple app to manage entralink forest data (inject-dump from savefile). I think this is great, since this opens a whole new world for Dream pokemon contribution: we can just contribute the forest data itself, as if it were a wondercard with many pokemon. ps: I haven't checked B&W2, and I don't know if entralink forest exists there, but nintendo probably kept the very same structure for compatibility, we would just need to find were it is stored. BW Entralink Forest tool 0.1.zip Edited June 18, 2016 by suloku
BlackShark Posted October 15, 2015 Posted October 15, 2015 Wow, you did quite interesting research the last few days! Entralink still exists in BW2. You should take a look at PokeCGear it can edit Entralink data. Download is at the bottom of first post http://projectpokemon.org/forums/showthread.php?13832-PokeStock-BW-%28Updated-for-B2-W2!%29 The English translation is crappy and it's a bit buggy sometimes but it might help you anyways.
suloku Posted October 17, 2015 Author Posted October 17, 2015 I've downloaded PokECGear, and it seems to be able to load either B/W or B/W2 savegames, but it does not load any pokemon from the entralink forest. The data seems to be encritped in some way, since even an empty forest data has all its bytes set. Is there any documentation about the save structure? The tools you listed access and edit many data that is not documented in projectpokemon's wiki.
BlackShark Posted October 17, 2015 Posted October 17, 2015 It should load them if you select the correct area with the buttons on the left. Besides what is on the wiki there isn't much documentation, at least not at a central place. On the forums you can find some threads about save structures here and there. For example the Black City/White Forest structure was documented by Kaphotics here http://projectpokemon.org/forums/showthread.php?16080-White-Forest-Black-City-Trainer-Save-File-Offsets Here is C-Gear skin structure http://projectpokemon.org/forums/showthread.php?22962-C-Gear-Skin-Editing and a bit about Pokedex skins and the DLC sav regions http://projectpokemon.org/forums/showthread.php?23068-PokeDex-Skin-Editing-other-crap-%28dlc-sav-regions%29
suloku Posted October 17, 2015 Author Posted October 17, 2015 Maybe it's because it only works with Black/White 2? Anyway, I've uploaded a tool to dump/inject intralink forest data. I've included @marc_max savegame's link forest data, which holds dream world's Arceus as the most notable pokémon I think he may have all the other event dream pokemon in there, but I haven't checked. ps: next comes gen VI pokemon link dumper/injector (celebi/johoto starters and glalie/steelix).
Kaphotics Posted October 18, 2015 Posted October 18, 2015 0x850 bytes of data u16 update counter u16 checksum checksum: crc-ccitt (16 bit) over the 0x850 range encryption seed: last 4 bytes of the 0x850 bytes (the only thing that isn't encrypted!) encryption method: 32bit lcrng, same used for Pokemon encryption, xor (result >> 16). The internal structure should be pretty easy to figure out if you just compare it to PokeStock's display. Something like u16 Species, u16 Move. A species' level is static, determined by a table stored in the ROM (NARC file) afaik. The one save file I checked had it at 0x22A00, must have been B2W2 (not BW).
suloku Posted October 18, 2015 Author Posted October 18, 2015 Many, many thanks kaphotics, that was really useful information. With that information editing forest contents should be easy, it is probably not that complicated to beggin with since I think it holds up to 80 pokemon, so 26 bytes of data for each entry. I guess I'll make a full editor, but not now, I want to finish other things now and the most relevan event pokemon are already preserved.
suloku Posted October 18, 2015 Author Posted October 18, 2015 OK, I was about to re-invent the wheel. Pokestock can do everything, and I've found a link with all dream event pokemon, including arceus. It can do many more things. I already had decrypted the forest file, but there's really no need now. I don't know why dream pokemon contribution uses .pkm files if it is way better to use pokecgear and import the phl files it uses (it can import/export a forest area). I'll re-do all dream pokemon in phl files and make a thread in the contribution forum for preservation. It would seem my work was pointless but well, I'm glad this led me to know about pockestock and I also used the code for this for the genVI pokemon link injection tool, so my work wasn't wasted at all. ps: I'm still curious about how they fit pokedex number, gender and move in 4 bytes, I guess gender is some bit in the pokedex number but well.
BlackShark Posted October 18, 2015 Posted October 18, 2015 (edited) ps: I'm still curious about how they fit pokedex number, gender and move in 4 bytes, I guess gender is some bit in the pokedex number but well. From what I've seen they are using bits to store the data in the 32 bit value little endian. Both Pokemon and move index would never need more then 10 bits in 5th generation. Electrike (0x135 -> 0000 0001 0011 0101) Female (0 -> male, 1 -> female) Ice Fang (0x1A7 -> 0000 0001 1010 0111) In the save: 00 2D 39 35 -> 0000 0000 0010 1101 0011 1001 0011 0101 Edited October 18, 2015 by BlackShark
suloku Posted October 18, 2015 Author Posted October 18, 2015 @BlackShark yes, I reached that conclusion too. I don't think it is worth to keep working on this; importing the whole forest is something PockeStock can't do and is in some way more convenient, but aside from that, everything can be done there and the existing translation is enough. Wow, really? I didn't knew PokéStock was able to do this!But I don't think your work was useless after all, many people don't like the GUI of this tool and I think it wouldn't be bad to have another one... also to have the C-Gear Skins, the Pokédex Skins, the Pokémon Musical and the Pokémon World Tournament DLC injection + the Dream World Pokémon in an "All-In-One Tool". And some other small features to edit data like the medals for example. Since Nintendo Wi-Fi went down, some of them can't be unlocked without manipulation, so I would count them as a lost feature as well. If the whole work to craft a new tool would be really worth it is the question. :biggrin: If all that is available in pockestock, it would be better to work on a transaltion rather than researching the data again and recoding the tool. Please let me know if there's some lost content not obtainable trough pokestock. Here's a link I found with supposedly latest version and translations: https://www.dropbox.com/s/c15sz90im499fns/PokeStock2_ver3_7.rar?dl=0
suloku Posted October 27, 2015 Author Posted October 27, 2015 (edited) Nice finding with the medals. Are you sure there's no way in any of pokéstock tools to edit the medals? Maybe it is untranslated stuff. Anyway, I don't know anything about dlc or online content for gens prior to VI since I stopped playing at III and played them last year. If you provide me a savegame before and after using the cheat code, with information about those medals, what they are for and how to see the medal collection in-game I'll try to look where are they stored. They are probably bitflags, so an editor could be possible (I would need the medal names and such though). EDIT: I was checking bulbapedia, how many hint medals are there? Is hint medal a medal or an object? eDIT 2: I've looked a little in the forums: http://projectpokemon.org/forums/showthread.php?24541-B2-W2-AR-Codes&p=164781&viewfull=1#post164781 EDIT 3: I've looked at the pockestock thread, seems like medal editing didn't made it into pockestock, but maybe it's just me not knowing japanesse? EDIT 4: Medal data location is already known: 25300 25797 2579A 25F88 Medal data I would just need to see how they are stored, probably something like flag and date... but I think using kaphotics AR code is better since it seems to make the game put all the data for the medals, unless if manually editing the medal data triggers the same in-game events. Edited October 27, 2015 by suloku
BlackShark Posted October 27, 2015 Posted October 27, 2015 For the medal date format see here http://projectpokemon.org/forums/showthread.php?44038-How-to-modify-the-date-of-medals
suloku Posted October 27, 2015 Author Posted October 27, 2015 Thank you, let's see if I get the time to get a propper medal editor, all the info has gathered. I'm worried about event triggering when adding the medals to the save, but it'll probably work out just like kaphotics AR code... ps: how come memory offsets for B2 and W2 are different? Shouldn't they be almost exactly identical?
D'Candyman Posted December 8, 2015 Posted December 8, 2015 https://github.com/suloku/BW_efd_toolOriginal post: Yesterday I asked a friend if he had collected the Dream Arceus on pokémon black & white. Turns out he did not just collect it, but he actually never picked up any of the dream pokémon, including arceus. I tested his save and confirmed that when a dream pokemon is captured in entralink forest, that's when it is generated. So I though: all the forest data must be somewhere in the savefile, it would be great if I could just copy it over my save and get all those dream pokémon. I've been all afternoon documenting the missing sections of pokémon B&W savefile, then I compared 3 savegames and started to transfer the sections that were changed after catching arceus to my own savefile (which actually has no entralink forest data since I never even used entralink). http://projectpokemon.org/wiki/Pok%C3%A9mon_BW_Save_File_Structure#Main_Save_File_.26_Backup Not only has the section to be transfered, but checksum block needs to be updated too. I'll try to code a simple app to manage entralink forest data (inject-dump from savefile). I think this is great, since this opens a whole new world for Dream pokemon contribution: we can just contribute the forest data itself, as if it were a wondercard with many pokemon. ps: I haven't checked B&W2, and I don't know if entralink forest exists there, but nintendo probably kept the very same structure for compatibility, we would just need to find were it is stored. This is just great! Oh by the way, does pokemon generated from Entralink Forest tool (or PokeCGear alike) only have stationary overworld sprites? Pokemons that I injected from the data on DW Event Arceus thread have a moving overworld sprite such as Bayleef. While the ones that I manually injected from PokeCGear only have stationary sprites... I'm just wondering because I'm planning to make an Entree Forest farm with moving Pokemon Sprites...
BlackShark Posted December 9, 2015 Posted December 9, 2015 (edited) This is just great! Oh by the way' date=' does pokemon generated from Entralink Forest tool (or PokeCGear alike) only have stationary overworld sprites? Pokemons that I injected from the data on DW Event Arceus thread have a moving overworld sprite such as Bayleef. While the ones that I manually injected from PokeCGear only have stationary sprites... I'm just wondering because I'm planning to make an Entree Forest farm with moving Pokemon Sprites...[/quote']I have some Pokemon that I originally downloaded from the DW which are actually not moving. A few weeks ago I did some research about the structure. This is what I found out so far. There are still 4 bits in the Pokemon structure where I currently have no clue. I'm not sure if those unknown bits have something to do with the movement beavior but I have some doubts about that because I have seen Pokemon that have those bits set and were not moving. General Structure 0x000 encrypted data 0x84C initial encryption seed 0x850 update counter 0x852 checksum from 0x000 to 0x84F (CRC16-CCITT) Decrypted Data Structure (0x000 - 0x84B) 20 Pokemon in each area from 1 - 8 as well as in the deepest area. 10 Pokemon in 9th area. So they let you store a total of 530 Pokemon there! 0x000 Deepest Area 0x050 9th Area center 0x078 9th Area left 0x0A0 9th Area right 0x0C8 1st Area center 0x118 1st Area left 0x168 1st Area right 0x1B8 2nd Area center 0x208 2nd Area left 0x258 2nd Area right 0x2A8 3rd Area center 0x2F8 3rd Area left 0x348 3rd Area right 0x398 4th Area center 0x3E8 4th Area left 0x438 4th Area right 0x488 5th Area center 0x4D8 5th Area left 0x528 5th Area right 0x578 6th Area center 0x5C8 6th Area left 0x618 6th Area right 0x668 7th Area center 0x6B8 7th Area left 0x708 7th Area right 0x758 8th Area center 0x7A8 8th Area left 0x7F8 8th Area right 0x848 Unlock Area 9 (0x01 to unlock) 0x849 Unlock Areas 3 - 8 (0x00 - 0x06, any higher value will corrupt your forest!) (Area 1 & 2 and the deepest Area are unlocked by default -> 0x00) 0x84A 0x00 0x84B 0x00 Pokemon Structure (4 bytes) Bits 00-10 Species 11-20 Special Move 21-22 Gender (0 -> male, 1 -> female, 2 -> genderless) 23-27 Form 28-31 Animation (only even numbers allowed, last bit makes Pokemon invisible) Area 8 can't be unlocked or edited in PokeCGear. That area which is labeled as the 8th area is actually the 9th. Also you can't edit whatever the unknown bits are used for the animation. Edited December 20, 2015 by BlackShark
suloku Posted December 13, 2015 Author Posted December 13, 2015 Interesting, maybe those last bits are the shiny modifier? Or fateful encounter flag? Or maybe they are some kind of perfect IV markers? Have you noted which pokemon are the ones with those bits set? EDIT: About stationary pokemon: I don't know about that, but what Entralink Forest Tool does is dump/inject the whole forest data from a black/white game. The included forest is a totally legit one, so if there are stationary pokemon, that's normal behavior.
BlackShark Posted December 13, 2015 Posted December 13, 2015 Interesting, maybe those last bits are the shiny modifier? Or fateful encounter flag? Or maybe they are some kind of perfect IV markers?Have you noted which pokemon are the ones with those bits set? EDIT: About stationary pokemon: I don't know about that, but what Entralink Forest Tool does is dump/inject the whole forest data from a black/white game. The included forest is a totally legit one, so if there are stationary pokemon, that's normal behavior. I found out that PokeCGear has a hidden column in the table right after the moves column in which you can see the unknown bits. But unfortunately I have still no idea about the meaning of them. In your efd file almost every Pokemon has them set. This picture was taken from your file. By the way I noticed your tool allows saves with .dsv extension but only files with 512kb are valid to use. DeSmuME files have a different size due to their 122 byte footer. Also is there any chance you will add B2W2 support?
suloku Posted December 13, 2015 Author Posted December 13, 2015 I found out that PokeCGear has a hidden column in the table right after the moves column in which you can see the unknown bits.But unfortunately I have still no idea about the meaning of them. In your efd file almost every Pokemon has them set. Oh yes, I actually noticed that too when I was looking into this, but totally forgot about it. I'll put it in my list to check what those bits do to a generated pokemon by obtaining that pokemon with those bits set and unset. Maybe it really is some kind of animation? By the way I noticed your tool allows saves with .dsv extension but only files with 512kb are valid to use. DeSmuME files have a different size due to their 122 byte footer. Woops, seems like I forgot to add the footer, I use sav files and drastic (android emulator) accepts dsv files without the footer so I didn't notice. EDIT: I wanted to code a dsv<->sav conversion tool too So, those 4 bits can range from 0-15, but from the looks of it they seem like flags, since there's no odd number the last bit is not being used? Also is there any chance you will add B2W2 support? Haven't looked into it, but I wanted to. I don't recall if the forest data was exactly the same for BW2, but anyway first I should find a way to identify if the save file is from B/W or Black 2/White 2, since both savefiles are the same size. If the forest structure is the same for bw2, it would be very easy to make it work with their saves. EDIT: just looked at the save structures and I think that reading the bw1 checksum table and seeing if it has the correct checksum, then testing for the bw2 table and assume that if it is correct the save is from that game is safe enough. I guess checking ALL sections would be better though, since identifying a BW1 save as a BW2 save should be almost impossible.
BlackShark Posted December 13, 2015 Posted December 13, 2015 (edited) Oh yes, I actually noticed that too when I was looking into this, but totally forgot about it. I'll put it in my list to check what those bits do to a generated pokemon by obtaining that pokemon with those bits set and unset.Maybe it really is some kind of animation? So, I'm sure now that those bits are responsible for the animation! I have taken a look at your file again. In the first area Drifloon, Marill, Nidoran♀, Growlithe and Tentacool all have the bits set to 14 and they have the exact same animation! Those Pokemon that I've seen with those bits set but not moving actually were moving (well just spinning around)! I thought moving meant they are walking. Those with the bits unset are just standing there and randomly looking to each side. So, those 4 bits can range from 0-15, but from the looks of it they seem like flags, since there's no odd number the last bit is not being used? As I've seen Pokemon became invisible if the last bit is set. EDIT: This is the result of changing the last bits. 0 randomly turning around 2 randomly walking 4 randomly walking 6 walking up/down 8 walking left/right 10 walking left/right and randomly looking up/down 12 turning around clockwise 14 turning around counterclockwise Edited December 14, 2015 by BlackShark
suloku Posted December 15, 2015 Author Posted December 15, 2015 Cool research, too bad we can't check if those bits were set randomly or were pre-assigned for each pokemon when downloaded from dream world. But well, if they are just animation, it doesn't have any major impact (I'm thinking about dream pokemon recreation trough entralink forest injection).
Kaphotics Posted December 15, 2015 Posted December 15, 2015 http://projectpokemon.org/forums/showthread.php?21828-Moving-Stationary-Pokemon-B-W&p=145246&viewfull=1#post145246 Regular movement permissions for the in-game NPCs for comparison
D'Candyman Posted December 17, 2015 Posted December 17, 2015 Haven't looked into it, but I wanted to. I don't recall if the forest data was exactly the same for BW2, but anyway first I should find a way to identify if the save file is from B/W or Black 2/White 2, since both savefiles are the same size.If the forest structure is the same for bw2, it would be very easy to make it work with their saves. EDIT: just looked at the save structures and I think that reading the bw1 checksum table and seeing if it has the correct checksum, then testing for the bw2 table and assume that if it is correct the save is from that game is safe enough. I guess checking ALL sections would be better though, since identifying a BW1 save as a BW2 save should be almost impossible. Hey guys, just wanna let you know if not already mentioned, that you could successfully inject some Pokemon on the Entree forest of BW2 using the PokeCgear tool. Though the DW Arceus Event data corrupts some of the forest's section when imported and is not advisable to use... Even so, the tool allows an entire legit area in the forest to be populated in the BW2 data file. I guess the memory location of the forest does not differ much from the structure of the original BW games albeit some modifications are made. Afterall, those two games are made of the same Gen V engine. I also think that it would be super cool if animation manipulation could be added on the PokeCgear to make the Pokemon on the forest have a more "Live" feel to it in the overworld. (Well, by allowing the user to modify the extra bytes mentioned on this thread... though its not that necessary...) Anyways here are some of the screenshots that I have tested from the game... I only used Area 1 and the Last Area... [ATTACH=CONFIG]12806[/ATTACH] [ATTACH=CONFIG]12807[/ATTACH]
BlackShark Posted December 18, 2015 Posted December 18, 2015 Hey guys' date=' just wanna let you know if not already mentioned, that you could successfully inject some Pokemon on the Entree forest of BW2 using the PokeCgear tool. Though the DW Arceus Event data corrupts some of the forest's section when imported and is not advisable to use... Even so, the tool allows an entire legit area in the forest to be populated in the BW2 data file. I guess the memory location of the forest does not differ much from the structure of the original BW games albeit some modifications are made. Afterall, those two games are made of the same Gen V engine.[/quote']The efd provided by suloku works on B2W2 as well. It's just his tool which is currently only compatible with BW. The structure of the data is the same in both. The only different is the adress where it can be found. 0x22C00 for BW, 0x22A00 for B2W2. At the moment injection is only possible manually via a Hex Editor. I also think that it would be super cool if animation manipulation could be added on the PokeCgear to make the Pokemon on the forest have a more "Live" feel to it in the overworld. (Well' date=' by allowing the user to modify the extra bytes mentioned on this thread... though its not that necessary...)[/quote'] That won't happen because development on PokeCGear was discontinued about 3 years ago.
suloku Posted March 7, 2016 Author Posted March 7, 2016 Some progress update of the tool I'm working on: Entralink forest editor: http://puu.sh/ny8PS/a2f2b04b17.png Medal editor: http://puu.sh/ny99l/6f90c8a817.jpg The app works fo both BW1 and BW2. For now the planned features are: entralink editor (with "Legit mode", only allowing pokemon and moves actually released on dream world), Medal editor (still need to find more values), Trainer records editor (still need to find more values), Other records stored in other blocks, Rival name editing (I think this can't be done in any editor), Link memory injection/editing (I'll include my own file and allow some changes, mainly trainer name, if I can find more about the structure, even import hall of fame from BW savefile). Also, if I can, I'd like to find how the key system works and allow to unlock the 3 extra keys (since it is an IR only feature). I'm researching record and high score values mostly for medal editing consistency. Basically I aim to be able to modify those things that aren't covered by pockestock/pokegen already, but the primary goal are the lost online features. ps: it's my first time working with objects, so don't expect it to be fancy, I just expect it to work as intended.
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