Romhacking.net

Romhacking => Personal Projects => Topic started by: markus-projects on September 07, 2020, 01:39:37 pm

Title: Dragon Quest IV (PSX)
Post by: markus-projects on September 07, 2020, 01:39:37 pm
Hi,

since I could not find a Dragon Quest IV translation for the playstation version, I looked into the Dragon Quest IV (PSX) data for myself.

What I found out is explained in my blog. I will keep this post updated when I find out more.
http://markus-projects.net/dragon-hackst-iv/ (http://markus-projects.net/dragon-hackst-iv/)

I thought this could be interesting for some of you.
Questions, collaborations or hints are welcome.
Title: Re: Dragon Quest IV (PSX)
Post by: MandatoryPixel on September 08, 2020, 12:17:55 pm
I'd like to see this version translated someday! This is interesting info.
Title: Re: Dragon Quest IV (PSX)
Post by: Chicken Knife on September 08, 2020, 03:36:08 pm
It's really great to see someone progressing with this. Getting DQ4 PSX English translated would be an extremely exciting event for the Dragon Quest community.

I'm part of a group called Translation Quest that has recently done / is doing several DQ retranslations, including the first 3 NES games and Dragon Warrior Monsters. If you are interested in discussing a potential collaboration, message me.
Title: Re: Dragon Quest IV (PSX)
Post by: LadyCannock on September 08, 2020, 03:43:17 pm
Thank you for your blog post. I've read it and will compare with my own notes later on tonight.  :)
Title: Re: Dragon Quest IV (PSX)
Post by: erinnk on September 08, 2020, 05:07:20 pm
As a personal friend of Chicken Knife, and someone fairly aware of the translations done by Translation Quest, I was directed here. I'm happy to help. I've done one other notable DQ translation project in days gone by.

Might be a day or two before I really dig into this, but I'm thinking if in fact it is an LZ* compression scheme, it shouldn't be hard to extract stuff from each of the blocks.
Title: Re: Dragon Quest IV (PSX)
Post by: pocket on September 10, 2020, 04:30:06 am
Good luck with this, I was hoping someone would take a whack at translating this. It's the only 8-bit DQ game that didn't get it's console remake translated.
Title: Re: Dragon Quest IV (PSX)
Post by: markus-projects on September 10, 2020, 04:43:08 am
Hi Chicken Knife and erinnk,
I would like to collaborate with you, but currently it is maybe too early to think about translation. I guess the following steps have to be solved first:
If this is done, then we can dig deeper into how to replace the texts.
I already looked into that and made a small graphical user interface (GUI) to inspect the data.
Years ago I wrote the LZS decompression code for FF7 (PSX). Maybe DQ4 is similar.

I uploaded my current Java code to Github: https://github.com/mschroeder-github/dragon-hackst-4 (https://github.com/mschroeder-github/dragon-hackst-4). You can look into it if you are familiar with Java.
Title: Re: Dragon Quest IV (PSX)
Post by: Chicken Knife on September 10, 2020, 09:43:31 am
Quote
too early to think about translation
Totally understandable.

Quote
I guess the following steps have to be solved first:
Understanding the Sub-Block Types
Decompress the used LZS
My technical abilities are pretty modest, and limited to 8 bit / 16 bit assembly language based hacking, but my friends erinnk & LadyCannock have a much more robust and up to date technical background and therefore have a lot more to offer at this stage in the process. It's a neat coincidence that we have all recently been poking around and doing a bit of groundwork with the PSX DQ4 translation idea.
Title: Re: Dragon Quest IV (PSX)
Post by: erinnk on September 10, 2020, 12:34:30 pm
I uploaded my current Java code to Github: https://github.com/mschroeder-github/dragon-hackst-4 (https://github.com/mschroeder-github/dragon-hackst-4). You can look into it if you are familiar with Java.

Thanks for this, and yes, I can work with Java (I'm personally a c# girl, but I won't start *that* debate here).

The "block" format is eerily reminiscent of DQ X. (Different, but similar approach)
Title: Re: Dragon Quest IV (PSX)
Post by: Mattiac on September 10, 2020, 04:08:10 pm
Exemplary initiative, thank you, talented Markus-san!

September 10, 2020, 04:16:17 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Chicken Knife-san, will you please also make a finally 100 % complete English translation of Dragon Quest VI for SNES?!
Title: Re: Dragon Quest IV (PSX)
Post by: Chicken Knife on September 10, 2020, 04:30:23 pm
Chicken Knife-san, will you please also make a finally 100 % complete English translation of Dragon Quest VI for SNES?!
Yes! We are planning to eventually get there. It might take years, but we hope to see it happen. I adore that version and can't wait to have it playable in a much more refined state.
Title: Re: Dragon Quest IV (PSX)
Post by: LadyCannock on September 10, 2020, 05:01:17 pm
Chicken Knife, depending how many people get on the team, maybe we could do both in parallel. As for 5, would it also need a new delocalization translation?
Title: Re: Dragon Quest IV (PSX)
Post by: Chicken Knife on September 10, 2020, 06:30:36 pm
Yeah, we also want a version of 5 that fits with the rest of our work as far as conventions, writing style and level of polish. But working on them all at the same time? I think that's fine for the technical aspects; not so sure about the writing process. I'd really want to prioritize DQ4 PSX over everything else if this works out, just because it's a much bigger priority to the fanbase.
Title: Re: Dragon Quest IV (PSX)
Post by: maximo806 on September 11, 2020, 01:31:14 am
woahhh! hold on I thought DQIV was never released on older consoles other than the NES, this is news to me! :o
Title: Re: Dragon Quest IV (PSX)
Post by: Choppasmith on September 11, 2020, 03:08:14 am
Wow, I know this a long way off, but best of luck! Thanks Markus for getting the ball rolling.
Title: Re: Dragon Quest IV (PSX)
Post by: Rabite890 on September 11, 2020, 11:41:19 am
woahhh! hold on I thought DQIV was never released on older consoles other than the NES, this is news to me! :o

Yeah, it almost got released in the US by Enix before the Squeenix merger. There's even an advertisement on the back of the manual for DWM2 I want to say it was. But the merger messed everything up and we never got it or the remakes of DQM1-2 on PS1.
Title: Re: Dragon Quest IV (PSX)
Post by: erinnk on September 11, 2020, 12:33:01 pm
Yeah, it almost got released in the US by Enix before the Squeenix merger. There's even an advertisement on the back of the manual for DWM2 I want to say it was. But the merger messed everything up and we never got it or the remakes of DQM1-2 on PS1.

Hey, be patient now, it's coming in 2002!
Title: Re: Dragon Quest IV (PSX)
Post by: CoolCatBomberMan on September 11, 2020, 02:37:34 pm
Yeah, it almost got released in the US by Enix before the Squeenix merger. There's even an advertisement on the back of the manual for DWM2 I want to say it was. But the merger messed everything up and we never got it or the remakes of DQM1-2 on PS1.

The ad was on DW7's manual, actually. And the merger wasn't what killed the DQ4 translation, it was Heartbeat going under. Regardless, I don't think we ever would've gotten the DQM1-2 remakes, since the originals were panned for being too much like Pokémon.
Title: Re: Dragon Quest IV (PSX)
Post by: Rabite890 on September 11, 2020, 04:34:55 pm
The ad was on DW7's manual, actually. And the merger wasn't what killed the DQ4 translation, it was Heartbeat going under. Regardless, I don't think we ever would've gotten the DQM1-2 remakes, since the originals were panned for being too much like Pokémon.

Is that the one it was? My mistake. I wasn't sure which one it was.

Ah yeah, that's what it was. There was quite a bit of anger from the DQ community when that happened. Quite a few "alternate" theories.

I think the DQM1-2 remake might have had a chance if DQ4 had made it. DWM1 sold well enough for Enix to decide to release the other games, even DWM2. I'm not certain that it being panned by some of the reviewers guaranteed that the games sold badly enough.

But that's neither here nor there. It didn't happen.
Title: Re: Dragon Quest IV (PSX)
Post by: Mattiac on September 12, 2020, 06:16:09 am
Thank you, Chicken Knife-san! I wish I had the skills to help you complete the translation faster, but it will be worth the wait.
Title: Re: Dragon Quest IV (PSX)
Post by: markus-projects 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  ;)

Title: Re: Dragon Quest IV (PSX)
Post by: erinnk 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.
Title: Re: Dragon Quest IV (PSX)
Post by: markus-projects 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 (https://github.com/mschroeder-github/dragon-hackst-4).
I also thought about this possibility. I could try to find these patterns.
Title: Re: Dragon Quest IV (PSX)
Post by: markus-projects 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:
You can read the details here http://markus-projects.net/dragon-hackst-iv/ (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 (https://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#dictionary_algorithms)). I guess it should output DAMI- (engl. Dummy) for this example.
(http://markus-projects.net/wp-content/uploads/2020/11/image-2.png)

Any help on this is appreciated.
 
Title: Re: Dragon Quest IV (PSX)
Post by: Guadozoku 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.
Title: Re: Dragon Quest IV (PSX)
Post by: CoolCatBomberMan 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
Title: Re: Dragon Quest IV (PSX)
Post by: Choppasmith 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/ (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 (https://en.wikibooks.org/wiki/Data_Compression/Dictionary_compression#dictionary_algorithms)). I guess it should output DAMI- (engl. Dummy) for this example.
(http://markus-projects.net/wp-content/uploads/2020/11/image-2.png)

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.
Title: Re: Dragon Quest IV (PSX)
Post by: Chicken Knife 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.