concreted / dqiv-nds-en-script-patcher

Dragon Quest IV (NDS) English + Party Chat Script Patcher for Japan ROM
42 stars 5 forks source link

Dialog has wrong amount of blips #7

Open NikoofDeath opened 2 years ago

NikoofDeath commented 2 years ago

Playing through the game, I notice a lot of the times dialog will have blips continue well after the text has finished, and sometimes (its far less noticeable) the blips stop before the text has finished. My assumption is this due to the blips being set based off the Japanese text instead of the English text, or maybe (but I doubt it) being based on the proper english text, rather than the edited ones.

concreted commented 2 years ago

Your guess is correct and directly related my comment in https://github.com/concreted/dqiv-nds-en-script-patcher/issues/6 about the text box header at the start of each .mpt file. Since the length of each text box is fixed to the size defined in the header (which was the length of the original Japanese English script in bytes), I am padding each text box with spaces so the patched English text is exactly the same length. My guess is the blips correspond to how many Japanese characters would fit in the text box (since this is running on the Japanese ROM), so you might get lots of blips after the text appears to end if it needed lots of space padding to reach the same length. Or, because Japanese characters are I think 2 bytes (vs. 1 byte for English ASCII characters), you may have a situation where the English text goes on longer than what would fit in the same text box if it were displaying Japanese characters.

I have tried padding with different non-space characters (which didn't help the blip issue) and terminating the string with 0x00 (which caused problems when displaying dialogue, IIRC it would show dialogue from other lines in the remaining space). A real fix would probably also involve reverse-engineering the header format and adjusting the text boxes to fit the exact size of the English text. Probably you'd have to make each text box twice the size of the number of ASCII chars to get the blips to exactly line up. Similar to https://github.com/concreted/dqiv-nds-en-script-patcher/issues/6 I would accept any PRs that fix/address this issue.

concreted commented 2 years ago

Correction (it's been a while since I've looked at this) - the text box size in the header is defined in the original English script file, NOT the Japanese one. So the length discrepancy is caused by the original English script potentially having lots of characters used for text substitution (for gender/plurals etc) that the Japanese ROM doesn't understand, which this patcher converts into regular text.