GearsProgress / Poke_Transporter_GB

A Pokémon Generation I/II to Generation III transfer tool
MIT License
329 stars 8 forks source link

Pokemon sometimes transfer with no name #9

Closed mrjordaaany closed 1 month ago

mrjordaaany commented 2 months ago

I've been unable to consistently replicate this bug, but I've encountered an issue when Pokemon transfer without their name. Nickname or not, doesn't seem to make a difference.

They turn up in gen 3 without a name at all - completely blank. In battle it just says go "!" instead.

I've only tested Yellow so far, and that is where it happened. Before the trade it did say a couple of Pokemon were unable to move across, but upon inspection nothing was out of the ordinary for these Pokemon (a Starmie and kangaskhan from memory) but it remains inconsistent whether the names come across or not. And often if i try again with the same box data it transfers all Pokemon fine, including the ones it couldn't the first time.

Unsure whats going on, I've used pokehex to check the Pokemon data but everything is legal. I did notice a couple of the Pokemon had the nickname boxed ticked, but didn't have a nickname (it was just BLASTOISE for example) so I thought maybe that was an issue, perhaps the original owner gave them a nickname, but then changed it back. However other Pokemon which didn't have this box ticket still had the issue.

Happy to do more testing if that helps! The tool is amazing, thanks so much for your work :)

PizzaTimeJoshua commented 2 months ago

What game version are you transferring to and from?

mrjordaaany commented 2 months ago

English Australian Yellow to English Australian Emerald.

GearsProgress commented 2 months ago

Sorry you had problems with it- I'm happy to take a look and see what went wrong!

Do you happen to have the save files for both games, both before and after the transfer? That would give me the most data to work with to see what happened :)

mrjordaaany commented 2 months ago

Nothing to be sorry about! Amazing tool as said.

I'll try replicate it again tonight then I can give you the saves.

mrjordaaany commented 2 months ago

Oh boy. What a long day.

But I did the testing and have the files for you.

So trading was done between English Yellow and English Emerald. I transferred box 1 in Yellow over to Emerald. During the process it said two pokemon in that box could not be traded: Starmie and Nidoqueen. In pokehex nothing is wrong with either of these pokemon

On the trade screen, the rest of the pokemon from box 1 show up, and if you pay attention you can see their names are blank there too.

Over on emerald, the pokemon have been transported to the "cool" box. Starting at row two with Rattata. Rattata is the only pokemon whos name is there, for all these rest its completely blank.

If i were to cancel this trade, and start the process again, it works! Even Starmie and Nidoqueen can come this time. I haven't tried multiple times in a row, but pretty sure i did the other night and this remained inconsistent (sometimes it worked, sometimes no names).

Ive included 4 save files, the before and after for each game as requested. So box one on yellow were the traded mons, and box 13 (named Cool) is where they ended up on emerald.

Interesting note: when I reverted back to an older emerald save, upon loading the game it said the save was corrupt and it loaded the backup save. However it loaded the older save fine, but it seemed to hold onto the DreamDex data. I know you have said theres no way to wipe this data yet, so that was probably an intentional result. The dream dex still showed pokemon even though the save had technically not used it before.

Thanks! pkmn saves.zip

GearsProgress commented 2 months ago

Thank you so much for going through the effort of getting me those save files- this will help immensely in figuring out what went wrong! I'll do some poking around today and get back to you with the results :) . Thank you so much for your assistance and patience!!

GearsProgress commented 1 month ago

Good news!! I was able to replicate the issue and I have a lead on what went wrong- transferring to a different game (in my case FireRed) works great... so it seems to be an issue with Emerald. I'll do some more digging as soon as I get the chance, just wanted to update you on my findings :)

mrjordaaany commented 1 month ago

Awesome! Thanks so much.

ca0ss commented 1 month ago

this is a video of the issue using silver and fire red

GearsProgress commented 1 month ago

Aha! I finally got the chance to sit down and truly figure out what the problem was here!

The issue is caused by having a Pokemon where somewhere in their data structure is the hex value 0xFE. In mrjordaaany's case, it's the second IV byte of their Golbat. 0xFE is a specific value when transferring over the link cable that means "no data" generally. When transferring data that may contain it, extra work usually goes in to have a patch list of where 0xFE values need to be placed. In my case, I didn't have space for that extra code, and since it could send the 0xFE value and would only skip when it received, I thought it worked fine. However, what I failed to remember is that this data is also sent back to the GameBoy from the GameBoy Advance, purely due to the way I have it set up. Since all data sent over the link cable is a trade (ie, one byte goes out, one comes in) I set up the system to just send back the data a few bytes behind where it started in order to ultimately have no difference. That is, unless the 0xFE byte is sent over. This byte then causes a de-sync and shifts everything over one. That's why anything after the Golbat (including nicknames and trainer names) became corrupted. I originally thought that this wouldn't be a problem, since the game soft reset after any sort of transfer- but the box data isn't actually flushed during a soft reset. So if you save after canceling a trade, the modifications will be kept and the Pokemon will be modified slightly after where the 0xFE originally was. In this case, the PP of move 1 was overwritten.

The good news is that I have a few ideas on how to solve it, so expect a fixed release sometime in the near future! Really glad to finally have gotten to the bottom of this bug, and I really appreciate all the help everyone in this thread has given- all of the info has been extremely helpful!!

mrjordaaany commented 1 month ago

Goddam legend! Thank you for your work and look forward to the next release!