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

Author Topic: Translating Mysterious Dungeon: Asuka Kenzan! (Released for Dreamcast & PC)  (Read 2016 times)

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Hi everyone, I'm new here. I apologize in advance that this post is a little long-winded.

I recently came across a turn-based roguelike RPG (https://www.giantbomb.com/fushigi-no-dungeon-furai-no-shiren-gaiden-jokenji-/3030-42973/) that was released in 2002 for Dreamcast and PC only in Japan. It's one of the best roguelikes I've played with 31 unique dungeons (ranging from low floor counts of 5~15F all the way up to 99F for the post game / brutal ones, and one massive 9999F dungeon that I'll likely never have time to play through).

The only issue is, it's so old and obscure that I haven't been able to find much discussion about the game, which is a shame... so I'd love to do a translation for the PC version (PC includes an expansion not available for the DC release) so that it can potentially be played by others. I'm fluent in Japanese so the actual translation of text isn't an issue (easiest part), but everything else is new to me. I found a thread over at RPG Codex (https://rpgcodex.net/forums/index.php?threads/want-to-translate-a-psp-or-a-pc-game-heres-how-you-begin-with-links-to-all-of-relevant-utilities.107721/) while googling how to go about things, and have also skimmed through the getting started section on this site.

I opened the .bin files of the game in a hex editor called wxMEdit (since it supports Shift-JIS encoding) and I found that one of the .bin files contains NPC dialogue, and I can edit that to have it show up in-game (Thankfully the game already supports English characters, so I don't need to add that to the game). Here's an example of what it looks like: https://i.imgur.com/4JCRMjb.png

But I couldn't find text for other things like items, player stats, option selections, etc. in any of the .bin files, so I'm guessing they might be compressed or something. (This is where my knowledge falls short).

I also learned while googling that hex editing is probably not the best way to do a translation for a RPG game, because you're limited by character counts having to match the Japanese counts, and it's a chore (though I personally don't mind hex editing, just happy to be able to translate at all, though I'd need to find where item text is for the game to really be playable in English). This thread on romhacking.net in particular stood out to me regarding that: http://www.romhacking.net/forum/index.php?topic=21821.20

I've tried to hunt down various tools for extracting the .bin files like UniExtract2 (failed) and quickbms (couldn't quite figure out how to use it) but haven't had any success with my attempts, so I feel like I've hit a wall on what to do next. Does anyone here have experience with this type of thing where they could offer insight / advice? I'd greatly appreciate any help.

Perhaps I should also mention, I tried searching for Japanese text for items in cheat engine (カタナ - Katana - E3 82 AB E3 82 BF E3 83 8A ) for example, but it didn't find any matches even in memory, though perhaps that's due to my settings / cheat engine not supporting Shift-JIS or something?

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
But I couldn't find text for other things like items, player stats, option selections, etc. in any of the .bin files, so I'm guessing they might be compressed or something. (This is where my knowledge falls short).
I have no idea what the game's files look like, but have you tried looking in the .exe?

It's also possible some of those things are stored as graphics, in which case you'd want to look at some of those .bin files with some kind of graphics viewer rather than a hex editor.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Thanks for the reply!

I did try opening the .exe in a hex editor and I found some additional Japanese text, and when I edit that it shows up in-game as well: https://i.imgur.com/3yD3MLd.jpg

Though the .exe only appears to include a small set of item names. In this roguelike you sometimes obtain items that aren't identified yet and have placeholder names, and you're supposed to figure out what item it is and label it yourself - or use a scroll that reveals the item's name. The item names in the .exe are for those placeholder names. (In the above image I renamed one of the placeholder staff names to FFの杖, and ran into it in-game).

Regarding a graphics viewer, I downloaded Binary Viewer and tried opening all of the .bin files, and it looks like data016.bin contains all of the sprites (item icons, enemies, etc). data001.bin appears to have a font of some sort, but I'm not really sure. The other .bin files didn't appear to have graphics, at least when skimming through with Binary Viewer. (https://i.imgur.com/qzgq6AU.png)

Jorpho

  • Hero Member
  • *****
  • Posts: 4160
  • The cat screams with the voice of a man.
    • View Profile
I hadn't heard of Binary Viewer before.  I was going to suggest Tile Molester, which should achieve similar results; it's pretty flexible.

Since this is a Windows program, the way to go would probably be OllyDbg; there are many examples of its usage out there.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Thanks for the follow-up.

I searched around and ended up giving x64dbg a try (appears to be a more modern version of OllyDbg). I stepped through the game a bit with the debugger attached, but couldn't get past the game's debugger checks even with ScyllaHide and trying a manual patch (https://stackoverflow.com/questions/10330147/how-do-i-bypass-isdebuggerpresent-with-ollydbg/10332044#10332044)

So in the meantime, I gave cheat engine searching another go and found the menu/item strings under the "Codepage" option instead of UTF-16, like so: https://i.imgur.com/EIjhqhM.png

It's encouraging to at least know that the strings are in there somewhere (the image is from adjusting values while the game is running, so it's not permanent: https://i.imgur.com/0ODzqrE.png - the game also crashes if text is too large or something, so my guess is that there are size constraints)

Are what Cheat Engine calls code page strings able to be edited in a similar fashion to regular chars in hex editors?

fran

  • Newbie
  • *
  • Posts: 4
    • View Profile
well,i guess lurking mode ends here

hello,huge fan of the torneko / shiren games here and asuka is definitely one of the best entries in the series
i can't believe nobody ever mentions this game or shiren 2 on the nintendo 64,they are such amazing games in dire need of an english translation

despite my "day 1" level of japanese (kana and 50-100 kanjis and that's it) i played the pc version up until the halfway point (more or less) and then gave up because not fully understanding the story or certain obscure mechanics became too much to bear

so i can't offer you a technical or linguistic support but you can count on me 100% if you ever get to the point when you need to test stuff or beta versions etc
i wish i could do more but unfortunately that's all i can do ; well,apart from cheering you on from the shadows !

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Small progress update:

I hit a bit of a wall on the PC version (can't seem to get past the debugger check / SafeDisc 2.8 protection to use a debugger). If someone could help me get past the debugger check it'd be awesome, but I kind of doubt anyone is familiar with it, so in the meantime I'm shifting focus to translating the DC release instead of the PC release. (I may revisit the PC release once I have more experience).

With that said, I found the file where item text is stored in the DC release, so I can edit that now (with some restrictions): https://i.imgur.com/lF9d9tc.png

I've heard that it's possible to store text in unused addresses and change where the text gets read to point at those addresses instead of the current location to accommodate longer names, but I'm not familiar with how that works so I might opt to continue with this in-line text editing instead, at least for now.
« Last Edit: February 15, 2019, 06:40:40 am by umbreon112 »

danke

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 2057
    • View Profile
Should be able to expand item names/fix the text overlap and reposition text into empty areas via pointer modification.

Psychlonic

  • Sr. Member
  • ****
  • Posts: 403
    • View Profile
I think your best bet would be to check with some old names in the warez scene for getting around SafeDisc. Shooting some emails around will probably yield results.
Just another old and grumpy gamer. Don't mind me.

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Do you happen to know of some people I could reach out to? I'm not familiar with that scene or where I'd even start.

I did come across this SafeDisc unpacker (v3 instead of v2.8, not sure if that matters - http://niotso.org/2014/02/18/finished-safedisc-unpacker-and-a-new-present/) while searching, but I haven't had success installing the Udis86 disassembler library to make use of it yet (http://udis86.sourceforge.net/)

Also, I'm unsure if using a debugger is necessary for an in-line text replacement, which might be an easier thing to focus on first. The npc dialogue file between the DC and PC releases are nearly identical, so as long as I find a way to get access to the equivalent file that contains item/UI text in the PC release, I can likely copy most of the changes over from the DC translation. (example: https://i.imgur.com/4Ls5l6F.png)

But I'd need help getting at that file, since I'm out of ideas.

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
So I've still been working on this, and I think I have an ok grasp of what is and isn't allowed in this game when editing text by in-line replacement, at least from the perspective of editing in a hex editor.

I've been making some compromises trying to name things to fit within the current Japanese character counts, but I think I'm at the point where I'd like to look into pointer modification so that I can translate things more accurately / properly - but I'm not exactly sure where to start / how to go about that for Dreamcast.

For example, one enemy is named "将軍" in Japanese which leaves me with 4 English characters to come up with a name. It should be named "Shogun", but I could also compromise and call it something like "Ace"... but that doesn't feel quite right.

There's also sentence order in general for scrolling text that sounds a little off in English. Some examples:
Quote
保存の壺[4]に
大きなおにぎりを入れた。



Storage Pot[4]
Large Riceball inserted.

Should be something like "inserted [item] into [pot]" or "placed [item] inside [pot]" instead.

note: I don't remember if that image was the exact spot in the hex editor for that string, but should be similar.

Quote
アスカは 大きなおにぎりを 食べた。



Asuka Large Riceball eaten.

Should be along the lines of "[player] ate [item]", but item name comes before action in that sentence in Japanese.

And finally, I'm not sure if it's possible to move variables like player name, item name, enemy name, etc. around. I tried it a few times but it seems to crash the game.

Could anyone point me in the right direction to get started? From searching around, it sounds like I need to start by figuring out how to calculate pointers... but I'm not exactly sure. (edit: I read through this topic too, but not sure how I'd apply the knowledge: https://www.romhacking.net/forum/index.php?topic=17762.20)

Edit 2: Quick side note, but I was able to move the item name variable by a slight amount without the game messing up: https://i.imgur.com/sW3yYW1.gif
Quote
[25 73] 82 CD 20 [25 73] 82 F0 20 90 48 82 D7 82 BD 81 42
%sは %sを 食べた。

[25 73] 20 61 74 65 20 [25 73] 2E
%s ate %s.
Doesn't really address the issue, but I guess it's a nice find for that specific example.
« Last Edit: March 04, 2019, 09:03:45 pm by umbreon112 »

Blue Bushi

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hey umbreon112, I'm just starting to delve into rom hacking in trying to translate a game myself.

I haven't gotten very far in (still digging up Mac tools, but I think I found the right ones now), but I do have some minor experience with assembly/machine code. It's been a while though. Part was in a code-learning course, and other experience came in trying to write a glitch cheat for Pokemon Gold and Silver. From what I remember, each "command" of code is generally 1 or 2 parts. If you can find the list of commands (what hex code translates to what), it would help. Else, you would need a bit of trial and error.

Usually the ones with 2 parts, the first is the command and the second is something the command is being applied to. So first might be "grab from address" and then the address. (As a simple, 2-hex example.)

Other times, you may have "lists" of things, like with letters would be a "list" of hex for each character in the string. And then there's logic applied (if this, do that).

Not sure how much this helps. May just be saying what you know and not hitting what applies in your example. Reading your thread here has been helpful to me. Only other piece of advice is to keep documenting what you figure out, as it will help you as you go.
« Last Edit: March 08, 2019, 10:25:17 am by Blue Bushi »

sharksnack

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Thanks for the reply Blue Bushi!

I'm not sure I understand what you're saying, but not due to your phrasing or anything, rather I feel like I might not be that far along yet / haven't gone into assembly stuff so far.

I've basically only been editing in hex mode so far, rebuilding and testing after each change (or after a number of changes that I've learned should be safe to make through trial and error). I have a hard time telling if the change is too lengthy or not in-game if I edit it in text mode, compared to being able to see the exact space it takes up.

Though that's partly because the stuff I've been working on is mostly UI/scrolling text/monster and item names, dungeon rules, etc. where it's harder to tell how many characters you're allowed to use to fit within the various window sizes. Once I get to more of the npc dialogue / story text areas the space should be more consistent, so I can likely edit things quickly in text-mode.

I have noticed some things like hex values that seems to highlight text in green in-game, or user variables (though if I try to edit the variables / place variables in areas that didn't have them to begin with, it usually breaks - likely because of the type of thing you're saying, I think? Like the code is expecting it to be in a specific location, or something).

Not to get too far ahead of myself here since this is still a WIP, but I plan to do a write-up at the end to both help solidify my understanding, and to hopefully be of help to others interested in translation / Dreamcast stuff.

I've also thought about posting a technical help wanted to help with the pointer modification / script extraction/injection so that the translation can be of a higher quality, but I'd like to eventually learn how to do that on my own as well, so I'm currently thinking along the lines of worrying about that as it gets closer to releasing the first version of this translation, and then proceed to work on learning that stuff in more detail afterward to polish it up. (That way people will have a fully playable patch at least, even if it's not exactly how I'd like it to be in terms of quality)