kwsch / pk3DS

Pokémon (3DS) ROM Editor & Randomizer
https://projectpokemon.org/forums/forums/topic/34377-pk3ds-xyoras-rom-editor-randomizer/
Other
401 stars 150 forks source link

[Bug] [USUM ]Odd ingame text behaviour after opening it in pk3DS #253

Open SfSuicune opened 6 years ago

SfSuicune commented 6 years ago

So, I edited some Rotom texts in USUM and noticed that after I copypasted the edited file onto my 3ds, that Rotom sentences that are set to start in a new line or so suddenly get a extra blank row. I tested around and noticed that opening the game text in pk3ds alone is enough to make that bug appear. It doesn't need any export/import to cause this. I checked with a clean file directly copypasted from the gamefile into the patch folder. It didn't appear wrong, so not a luma thing. It doesn't seem to affect NPC texts, only Rotoms. At least its sentece where I noticed this particular bug. It's a text I get right now after starting the game, the one where it talks about the 4th trial.

This text can be found in text file 89, row 353-356, german version.

Bugged Text: text fail

How it's suppose dto be: text right

SfSuicune commented 6 years ago

The lines look the same in the editor and look right, yes. It shouldn't happen, yes. But if I let luma patch using the file that was opened in pk3DS (which in my case is romfs/a/0/3/5), which actually should be unchanged, it turns into this bugged text even though I did nothing but just open the file the text is in. Doesn't matter if changes were done or not. I noticed the file also has a different size after just opening it. It somehow is slightly smaller than before. But only when it comes to the size itself, not the one it uses on the medium. Friend of mine encounters the same bug in the english version. He things it's something about the text coding or whatever that comes after/before the text lines.

If you like to, I can throw my save file to you or make a video of the whole process I'm talking about.

kwsch commented 6 years ago

Unable to replicate on current commits (saves the same bytes); double check that you didn't erroneously include multiple formatting codes. Differences in file sizes for the overall garc is a matter of byte padding.

Original Text: de: Im Schattendschungel wartet die dritte Prüfung\nauf uns, brzzzt![WAIT 10]\r\nHast du geeignete Feuer-Pokémon im Team? en: So, next is the third trial! It’zzz going to be in\nLush Jungle, right?[WAIT 10]\r\nI hope you have Fire-type Pokémon ready!

SfSuicune commented 6 years ago

As I said, it even happens with an unchanged file that has nothing but being opened in pk3DS for a second. If I change something or not doesn't make any difference. It also happens with the latest commit, just tested that. I can even recreate it with the english file (Nr 2 in the same folder) that I opened for a second and then blantantly renamed to "5" so it would overwrite my game language. It's really odd that you can't recreate it. This would mean it has to do with windows or whatever.

I'm gonna run a couple more tests and then may put together a video if I don't stumble into into the actual source of my problem or the solution.

SfSuicune commented 6 years ago

Aaah! This problem only sems to show up with a waiting command before it. Kinda like the problem with the german bed line I reported before that contained \[

Blah[WAIT 10]\r\nBlah Blah It maybe doesn't like the ]\ Because it doesn't happen on only Blah\r\nBlah Blah So the waiting command or the symbol combinations throw something off. Checked different Rotom lines that have a waiting command (Almost all its tips have one). Empty lines betweem words everywhere. Even edited a waiting command and \r into one that hadn't this before and it started throwing the empty line.

SfSuicune commented 6 years ago

Same happening with latest commit. But I found out that: Text[WAIT 10]Text will appear as

Text
Text

So the wait command gets understood as something that's supposed to make a new row right now.

This gave me the idea to play around with the wait numbers. Noticed something: Text[WAIT 100]Text will apears as TextdText. Text[WAIT 40]Text will apears as Text(Text. It happens no matter what's behind/before the command.

Rotoms (german) line *Piep, piep, piep...*[WAIT 40]\c\nBrzzzzt! Brzzzt!\n...[WAIT 10]\r\n*Blink! Blink!* becomes:

*Piep, piep, piep...*(
Brzzzzt! Brzzzt!

*Blink! Blink!*
kwsch commented 6 years ago

100 = 0x64 = 'd' 40 = 0x28 = '('

10 00 01 00 02 BE 0A 00 = wait 10 10 00 01 00 00 BE 0A 00 = return, followed by 0x10 (\n)

not sure if they re-coded their text parsing to make wait a constant amount of time for US/UM, and return always have \n

SfSuicune commented 6 years ago

The numbers are a amount of time, yeah. WAIT 10 and WAIT 40 are used pretty often. Somtimes they use WAIT 20. 10 for probably everything where they scroll a full textbox away and start filling a new one, 20 mostly for teaching attack texts and 40 just because they feel funny to waste your time.