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

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

markus-projects

  • Jr. Member
  • **
  • Posts: 7
    • 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: 7
    • 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: 7
    • 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: 266
    • 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: 63
    • 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: 203
    • 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

  • Hero Member
  • *****
  • Posts: 521
    • 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.

kaine23

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #28 on: January 06, 2021, 09:28:50 am »
i like this idea!!

markus-projects

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #29 on: January 10, 2021, 09:25:45 am »
After some time in vacation and between the year I successfully managed to patch the game in order to replace the first dialog of the first scene.
I wrote how I did it as usual in my blog post (corresponding code is also uploaded in github).



However, to make it clear: I don't know if this method works every time. It is still not 100% solved but a way to go. I think the textblock patching works quite fine but the dialog pointer changing is very tricky and not 100% fail-safe yet.

Because this is new to me: Does it makes sense now to create an official entry in the https://www.romhacking.net/translations/ section to upload resources and have a working context with other interested users?
Maybe translators would like to download the 925 CSV files I extracted to start translating as Chicken Knife suggested. Every UTF-8 file corresponds to a textblock that can be patched in the HBD1PS1D.Q41 file. The name of the file (do not change it) is the ID of the textblock.

For testing, I entered something for the first dialog and patched the game to make the screenshot you see above.


A big help during research was a user named rveach who investigated translating DQ7 years ago.

What is still missing is patching in-game text, status messages and dialog options.
Because of my full-time job I am not sure how much time I can invest, but for questions I will be available.

Chicken Knife

  • Hero Member
  • *****
  • Posts: 521
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #30 on: January 12, 2021, 08:59:56 pm »
@markus-projects

Spectacular work. It's amazing seeing this all being realized.

nejimakipiyo and I looked over the blog to some extent. If we were more technically gifted--and in my case, if I wasn't caught in such a demanding work situation at this time, we would certainly dive into translating and inserting. nejimakipiyo, normally busy with their GBC retranslation & RPG Maker projects, does have a lot more time than I do right now, but they would need a ton of hand holding with the technicals.

Understanding that life balance is a challenge for you as well, if your project either gets to the point where you have tools that are friendly enough for folks with no PSX hacking experience, or if you wanted to do some serious hand holding, we would be ready to get to work on the translating / writing end of it in the near future.

hoshi323

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #31 on: February 04, 2021, 11:46:26 am »
Hello! I've been studying Japanese and I know quite a bit of the language. I'm also a huge Dragon Quest fan and one of my resolutions is to translate a game. I'd love to help work on translating this!  :)

Thirteen 1355

  • Hero Member
  • *****
  • Posts: 596
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #32 on: February 06, 2021, 08:42:28 am »
Am I dreaming? I so badly wished more DQ games were translated into the west (the good versions at least)! Translating the PS version of IV would be a huge step. I don't know Japanese, but I have some minor experience with programming. I'd like to help out any way I can!
Helicoptering about till I find some ROM hacking treasure.

OldSchoolGamer86

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #33 on: March 06, 2021, 09:12:16 am »
Hello.  I just wanted to say i really hope this project us successful. I love DQ and was very dissapointed when that company dissolved and DQ4 PSX never made it here. 

I have been on and off trying to teach  myself basic japanese. I stopped for a awhile as i lost my books and such,  but ive started again as i want to be able to play many games in japanese that never made it here including this.  I imported DQ7 psx as well as DQ8 and DQ5 PS2. When i was last trying to teach myself japanese i was able to atleast read the menu and most battle screens so i put a good many hours into DQ7.

I know this isnt going to be what happens but if DQ4 psx does get translated, id personally prefer a retranslation thats as close to the japanese versions text as possible. I personaly dislike localizations as for example if the game takes place in a eastern or asian country or setting... having jokes or things that apply to westerners imo detracts from things.  People should ve acting how they would normally in that time period/area. Also i hate all tge censorship that games get... id rather the translation stick to as close as possible to the japanese original.
Like for example in FF6 kefka says "welcome to my barbecue" which is ridiculously bad as in the the japanese verision he alludes to having  him watch everyone burn to death. Keeping the burning to death would have been better i feel as it us much more impactful. Also kefka in the US translation as an example yells "son of a submariner" which i find stupid and ridiculous as in the japanese original he swears. The swear should have been left in.

I hope the translation ends up as close to the japanese as possible but either way i commend all of you on your efforts. The DS and Android localization is bad imo. The english DQ7 has a good translation imo as its quite close to the japanese original as thankfully they didnt have time to localize it. 

Thank you for your efforts and if this ever gets to a state where you need a tester i have a chipped psx and ps2 as well as Vita i could run this on to test. I prefer real hardware to emulators whenever possible.

Best of luck ill keep watching out foe this!

spookdy

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #34 on: March 07, 2021, 10:01:59 pm »
Hello!

I also just finished DQI&II (GBC) and DQIII (SNES) and was looking to play DQIV. Seeing your blog post inspired me to give it a shot too so I've been working in parallel on my own repository (I'm sorry I don't know Java!!!).

I've been doing this all in Python and have gotten to basically the point you left off at in your blog post. I've also managed to write up a script which auto-translates the PSX dialog to the mobile translation (has a few hitches, but can translate around 70% of the dialog).

Once I get that done I plan on writing a script which generates the pointer remapping ASM.

I know a few in this thread have mentioned they want to help, feel free to contribute to my repository. I can help you get set up if you actually show interest.

Here's my repo: https://github.com/mwilkens/dq4psxtrans

~ spookdy

Chicken Knife

  • Hero Member
  • *****
  • Posts: 521
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #35 on: March 08, 2021, 06:58:56 am »
@spookdy,

Great stuff, keep us posted. As there is clearly some interest in a more accurate / faithful translation as well, my team continues to be open to the idea of working on a script with that approach. Could your tools be set up in such a way where we could essentially prepare a document with the entire translated text and have that inserted into the game? Likewise, it would help us greatly to have an extracted version of the Japanese text we could match it to.

spookdy

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #36 on: March 08, 2021, 12:14:54 pm »
For now I'll be working on inserting the Android dialog because its all right there and it's way easier but yes, even the way it is now allows for a more faithful translation with hardly any extra work on my end (or Markus's).

On Markus's blog you can download an archive of all the extracted PSX dialog, so it should be fairly easy to get started translating.

I'm not sure if this was the intent but Markus had set up each line like so:

Code: [Select]
"",ダミー{7f0b}{0000},0x0084
The second value is the Japanese text and the third is an offset that the translator doesn't need to worry about. The first quotation marks could encompass the translated text so someone could easily go into each file and start translating away. A translated line would look like this:

Code: [Select]
"Dummy{7f0b}{0000}",ダミー{7f0b}{0000},0x0084
(the values in {} are control characters, for example {0000} is the end of a dialog and {7f1f} is the hero name. I have no idea what {7f0b} is but its everywhere)

If anyone wants to do this work, like I said before, I am more than willing to set you up. You shouldn't need any technical knowledge.

nejimakipiyo

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Demon Passion
Re: Dragon Quest IV (PSX)
« Reply #37 on: March 08, 2021, 05:34:29 pm »
Would love to be part of working on an accurate and faithful translation. I'm in the end stages of another DQ related project now, and would happily work on this game next. All I would need to get started is an extracted version of the Japanese text, like Chicken Knife mentioned. My only skill is with the translating itself, but I'm sure between the lot of us here we could find a way to get this off the ground.

@OldSchoolGamer86 I echo your sentiment with regards to the flaws in modern localizations. I do also realize that a lot of people prefer them, and that's their prerogative, but I think the best solution here would be to work on both styles at once. There's no reason two translations can't coexist, other than the poor technical skill of the translators trying to push out a faithful translation for a system they've never worked on.  :laugh: :laugh:

AdamDravian

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Dragon Quest IV (PSX)
« Reply #38 on: March 11, 2021, 11:56:05 am »
Would love to be part of working on an accurate and faithful translation. I'm in the end stages of another DQ related project now, and would happily work on this game next. All I would need to get started is an extracted version of the Japanese text, like Chicken Knife mentioned. My only skill is with the translating itself, but I'm sure between the lot of us here we could find a way to get this off the ground.

Well, this is exciting to read. I'll keep my fingers crossed that this comes to pass.
Writer of the '80s-themed webcomic Satan Ninja 198X

nejimakipiyo

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Demon Passion
Re: Dragon Quest IV (PSX)
« Reply #39 on: March 11, 2021, 12:33:50 pm »
If anyone wants to do this work, like I said before, I am more than willing to set you up. You shouldn't need any technical knowledge.

I did poke at markus's blog before, and hit a wall pretty early. Just made another attempt and I downloaded the Japanese extracted text, but I can't make any sense of what I'm seeing. I'm going to PM you because it takes a while for your posts to show up.