News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Dragon Quest IV (PSX)  (Read 4111 times)

markus-projects

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #20 on: September 15, 2020, 02:34:41 pm »
Thanks to everybody wishing us good luck :)

The truth is that I recently played for the first time DQ I.II on SNES (a translated version from evilteam brasil). DQ3 on SNES comes next for me (translated by DQ Translations). When I searched for a translated version of DQ4 PSX and I found nothing I thought, well how hard can it be... ^^

That is why I would also like to focus on the DQ4, as Chicken Knife said.
@erinnk @LadyCannock I updated the code and my blog post what I found out. You can look into it and also contact me.

There are good and bad news:

The good news are that I understood the LZS scheme and it seems that every compressed block can be decompressed. That said, I could successfully extract the TIM images, for example. I also looked into the various subblock types and made some notes what they could contain.

The bad news are that there seems to be no dialog text encoded in the usual japanese encodings (JIS, etc). I guess that they use a self-made font image to render the dialogs and that they maybe use their own coding scheme to address the letters. I guess someone has to look into the executable to debug what really happens. I am not familiar with the opcodes of PSX and did not found a clue. Maybe someone can help me and tell me, how dialog text is loaded, from where it is loaded and how it is encoded. In particular, I would like to know where the first dialog word %u3069%u3046%u3057%u305F is hidden in the data  ;)

« Last Edit: September 16, 2020, 03:35:54 am by markus-projects »

erinnk

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #21 on: September 16, 2020, 11:16:45 am »
Markus, can you share your extraction code?

September 16, 2020, 11:25:30 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Without having looked closer, I'm thinking perhaps the text is simply encoded as indices into the font you found. That would make sense. The way to locate the intro dialogue, especially where there's substantial repetition, is to find repeated bytes, I think... especially lines like this: "勇者さま 勇者さま……"  There's going to be four bytes (or double bytes) followed by something different, followed by those same four bytes.
« Last Edit: September 16, 2020, 11:25:30 am by erinnk »

markus-projects

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #22 on: September 16, 2020, 11:52:33 am »
Markus, can you share your extraction code?

Without having looked closer, I'm thinking perhaps the text is simply encoded as indices into the font you found. That would make sense. The way to locate the intro dialogue, especially where there's substantial repetition, is to find repeated bytes, I think... especially lines like this: "勇者さま 勇者さま……"  There's going to be four bytes (or double bytes) followed by something different, followed by those same four bytes.

Everything of the code is at https://github.com/mschroeder-github/dragon-hackst-4.
I also thought about this possibility. I could try to find these patterns.

markus-projects

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #23 on: November 22, 2020, 07:51:01 am »
Hi,

it's been some time now since I worked on the hacking because of actual work.
After I finished DQ III in my leisure time, I thought for a moment why not playing the DS or Mobile version of DQ IV.
However, I came this far and I want to continue this hacking journey.

I have some important updates in my blog post.
The new sections are:
  • Use Dragon Quest VII to find the text
  • Text-Blocks
  • The text decoding routine
  • Translated Text from Dragon Quest IV Mobile Version
You can read the details here http://markus-projects.net/dragon-hackst-iv/.
TL;DR: I used DQ VII (en + jp version) to identify the block that contain the text; analysed and parsed the text blocks in IV; debugged the text routine in the PSX-EXE of DQ IV and as a sideline found the dialogs (en+jp) in UTF-8 text files in the Mobile version of IV.

Next steps and help or advice needed

The text is compressed (no wonder we didn't find the dialog text in Shift-JIS) and it needs to be uncompressed, then translated and again be compressed. I looked into the assembler code to understand what has to be done, but didn't understand it completely. Does this 0x80 pointer mechanism (dataED part) look familiar to someone? Is it some kind of LZ variant or another encoding (see e.g. https://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#dictionary_algorithms). I guess it should output DAMI- (engl. Dummy) for this example.


Any help on this is appreciated.
 

Guadozoku

  • Sr. Member
  • ****
  • Posts: 264
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #24 on: November 22, 2020, 01:02:56 pm »
Gotta disagree with using the mobile version text. They translation with its phonetic accents is annoying to read. Either translate from scratch or use the NES version as a base and translate the party chat.

CoolCatBomberMan

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #25 on: November 22, 2020, 03:17:54 pm »
Gotta disagree with using the mobile version text. They translation with its phonetic accents is annoying to read. Either translate from scratch or use the NES version as a base and translate the party chat.

Or, y'know, rewrite the mobile text to remove the accents. e.g. wee bairns > children

Choppasmith

  • Full Member
  • ***
  • Posts: 192
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #26 on: November 22, 2020, 09:13:20 pm »
Hi,

it's been some time now since I worked on the hacking because of actual work.
After I finished DQ III in my leisure time, I thought for a moment why not playing the DS or Mobile version of DQ IV.
However, I came this far and I want to continue this hacking journey.

I have some important updates in my blog post.
The new sections are:
  • Use Dragon Quest VII to find the text
  • Text-Blocks
  • The text decoding routine
  • Translated Text from Dragon Quest IV Mobile Version
You can read the details here http://markus-projects.net/dragon-hackst-iv/.
TL;DR: I used DQ VII (en + jp version) to identify the block that contain the text; analysed and parsed the text blocks in IV; debugged the text routine in the PSX-EXE of DQ IV and as a sideline found the dialogs (en+jp) in UTF-8 text files in the Mobile version of IV.

Next steps and help or advice needed

The text is compressed (no wonder we didn't find the dialog text in Shift-JIS) and it needs to be uncompressed, then translated and again be compressed. I looked into the assembler code to understand what has to be done, but didn't understand it completely. Does this 0x80 pointer mechanism (dataED part) look familiar to someone? Is it some kind of LZ variant or another encoding (see e.g. https://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#dictionary_algorithms). I guess it should output DAMI- (engl. Dummy) for this example.


Any help on this is appreciated.

Just a thought, but maybe someone on ZenHAX, a community that deals with compression in files could help? They're pretty open to taking requests.
https://zenhax.com/index.php

Or, y'know, rewrite the mobile text to remove the accents. e.g. wee bairns > children
Yeah those early DQ DS releases were a bit obnoxious and Shloc found a nice balance in later releases. That's definitely the plan for me if/when I get to DW4/DQ4.
« Last Edit: November 22, 2020, 09:27:32 pm by Choppasmith »

Chicken Knife

  • Sr. Member
  • ****
  • Posts: 460
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #27 on: November 25, 2020, 08:15:09 am »
Honestly, the accents in DQIV's contemporary script are so entirely pervasive that I think someone would have to rewrite over half of the text to actually lose the accents. And then, have fun getting the tone / style of the writing to match. Keeping accents but tweaking the most extreme elements would be the better route if you really wanted to go that way.

If my team were to be involved, we'd use the NES script as something of a base because it reads well and is very accurate. Then we'd uncensor and do fresh additions of the added remake lines present for PSX. Knowing that the conventions for spell / monster / item names we came up with for our previous work can't/won't make everyone happy, we could create two versions, one with our Delocalized namings and the other with contemporary namings.

If that isn't the route markus is looking to go, perhaps he'd be willing to share the tools he crafts after completion so we could use them to do the script we envision as well.