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

Author Topic: Love Quest (SNES) Japanese-English Translation Problem  (Read 2260 times)

Light of Hikari

  • Newbie
  • *
  • Posts: 4
    • View Profile
Love Quest (SNES) Japanese-English Translation Problem
« on: February 11, 2020, 06:07:17 pm »
I went translating a snes Japanese ROM from scratch, and I`m a newbie.
So, according to various tutorials, I`ll have to create a table, to later export into a text file, and later changing the pointers, etc.
My problem is: I can't make a complete table file.
I used MonkeyMoore and JWpce to create the table/show the complete table, but only recognizes hiragana/katakana separated, and this game uses hiragana, katakana and multiple kanji at same time, and has to be organized (WindHex shows the characters, but it's in random points) 

Questions:
-There's a more simple form already to have all 3 writing types in a hex table without putting it manually?
-The table has to be a correct one? (i. e.: If あ(a) is =7D and so on, means that if あ is other hex code, the text will not display correctly.) 
-What is the bitmap format and other measurements of snes on sprite editors?
Thanks for answering.
https://www.imagemhost.com.br/images/2020/02/11/PROBLEM-1.png
https://www.imagemhost.com.br/images/2020/02/11/PROBLEM-2.png
https://www.imagemhost.com.br/images/2020/02/11/PROBLEM-3.png
« Last Edit: February 15, 2020, 03:31:39 pm by Light of Hikari »

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3525
    • View Profile
    • Aeon Genesis
Re: Help With Japanese-English Translation (SNES)
« Reply #1 on: February 13, 2020, 02:59:00 pm »
I'm not sure how you got the values for your table file, but even assuming that they're correct, you're also assuming that the game's text is going to be at the very start of the binary. This is not an impossible thing, but the likelihood that the *very* first thing in the ROM is the text is extraordinarily slim. When you open the ROM in a hex editor you get *everything* - the machine code, the graphics, the text, the data, everything, all mashed up together, generally without much (if any) logical order to it. So again, even if your table file is correct (it might not be) you're almost certainly not actually looking at the text.

Psyklax

  • Hero Member
  • *****
  • Posts: 1105
    • View Profile
    • Psyklax Translations
Re: Help With Japanese-English Translation (SNES)
« Reply #2 on: February 13, 2020, 03:55:47 pm »
So, according to various tutorials, I`ll have to create a table, to later export into a text file, and later changing the pointers, etc.

You missed the part of the tutorials that told you to find the text. :) As Gideon says, the ROM has everything in one big lump, and I can say with 99.99% certainty that there is no text at the beginning of your ROM.

I don't know how you made your table file, but there's a reason we use table files: every game uses different hex values for the text in the game. Let me put it another way: the hex values in the ROM are interpreted by the game as values to be used in reference to the video RAM to decide which tiles to place on the screen in specific places. This isn't like Shift-JIS or something, those values refer to specific graphic tiles, which may or may not be text, and which differs from game to game. Your first task is to find where the actual text for your game is located, which is ROM hacking 101.

It would help all of us if you - and I don't wanna sound mean but this is a personal pet hate of mine and because every single person who signs up on this forum asking for help does this exact same thing - please tell us which game it is. If you tell me the game, I can give you a table file in ten minutes. It'll save all of us a lot of trouble. :D

If you're a complete newbie at this, then the simplest option is to use a relative search program to find text. It's not great, since you'll have no luck if the text is compressed, but in some situations I've been surprised at how quickly I've got results with it, instead of going the hardcore route I usually take.

Get Relativeful Search from the Utilities section, find a bit of text at the start of your game with no dakuten in it (and I mean a bit, no more than four hiragana), and do a relative search based on the typical kana ordering (a i u e o ka ki etc). If you're lucky, you'll find a couple of matches. Change them to something else, load the game and see what happens. If the text changes, congrats, you've completed step one of making a table file. Based on the hex values you find for those four kana, you can usually figure out the rest of the character set, and thus view the text in WindHex.

But if you tell us which game it is, we'd REALLY appreciate it. ;)

EDIT: I just saw the title in your screenshot. Be right back. :D

EDIT2: Okay, I don't think Love Story is a game for an absolute beginner to tackle. :) The game doesn't make the graphics for the text easy to change in a tile editing program, and the way it's done is rather difficult to reverse engineer. If you're learning the ropes, I don't think this is a good game to introduce you (a 16-bit RPG with kanji is usually going to be a bad choice). I could continue trying to find the text in the ROM for you, but I've spent long enough on this to realise it's going to be tricky.
« Last Edit: February 13, 2020, 04:33:20 pm by Psyklax »

Vehek

  • Full Member
  • ***
  • Posts: 182
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #3 on: February 13, 2020, 11:39:17 pm »
A lot (all?) of the dialog text is stored in some 12-bit format. Not something you can view in WindHex.

Quote
The game doesn't make the graphics for the text easy to change in a tile editing program
I don't know what settings you'd use in other viewers to organize them correctly, but in Tile Molester, I can view the font just by going to 0x28000 under 2bpp codec and setting block size to 2x2 tiles.

Psyklax

  • Hero Member
  • *****
  • Posts: 1105
    • View Profile
    • Psyklax Translations
Re: Help With Japanese-English Translation (SNES)
« Reply #4 on: February 14, 2020, 01:14:51 am »
A lot (all?) of the dialog text is stored in some 12-bit format. Not something you can view in WindHex.
I don't know what settings you'd use in other viewers to organize them correctly, but in Tile Molester, I can view the font just by going to 0x28000 under 2bpp codec and setting block size to 2x2 tiles.

Nice spot on that font, though when I was reverse engineering the text being written to VRAM, it didn't come from there, so I'm not sure how helpful it is.

More importantly, how did you figure out the text was in "some 12-bit format"? I'm curious to learn more. I gave up trying to find the text myself. :D

Light of Hikari

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #5 on: February 14, 2020, 10:46:46 am »
Hi everyone, I see all of your comments. And I have some things to say:
1. I discover that the table I'm using was "wrong", "wrong" because MonkeyMoore don't give me a fixed correct table order (like, in one time "あ" (sorry for using the same example) is =00, in other table, あ was =75, etc. So I was searching for how can I made an Japanese hex table, and I find the tutorial "Tables for Dummies", by satsu. And this tutorial is being very useful to me.
2. Not being annoying, the game is Love Quest, not Love Story
3. The reason that I'm translating this game is because I find this game very cool, and after an post about the translation from 2016,and nobody else talked about, so I think that the project died, this is because I`m doing myself the translation.
4. I`m using now the Relativeful Search, and it is working, thanks Psylax! (I have problems only for downloading some .dll and .ocx files)

February 14, 2020, 12:29:12 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Oh, I forgot somethings to say:

-Thank you again, Psyklax (to the other people that helped me, like Gideon and Vehek, thanks too), for being able to make a table for me, but don't hurry/worry, I'm making my table with your tips.
-About the sprites of the hiragana/katakana/kanji in the sprite editor, it's very tricky. Let me explain, I think if you open the game in a editor, you will see the text part almost this (I'm using Tile Molester):
https://www.imagemhost.com.br/images/2020/02/14/A1.png
All messy and confusing, isn't it?
What you have to resolve this:
1. Take the game and play it on a emulator.
2. Save-state the game
3. Open the editor (Tile Molester) and open the game
4. If this is not configured, in the top-left options bar, click: View>Codec>2bpp planar
5. In the options bar, go to: Palette>Import From>Another File and find the save state file. The colors will be better.
6. Press Shift+Left Arrow until the characters display correctly
7. If still the sprites are not right press the division symbol in the bar below the options bar
If you followed the steps right, the final appearance will be like this:
https://www.imagemhost.com.br/images/2020/02/14/A2.png
-What is the best script extractor? After I do the table, I will extract the text from the game in a notepad file, etc. 
« Last Edit: February 14, 2020, 12:29:12 pm by Light of Hikari »

aqualung

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #6 on: February 14, 2020, 06:13:14 pm »
Best of lucks with this project. I've always been curious about this game, but ended up forgetting about it when that thread you mention from 2016 stopped being updated. There are lots of snes games with posts from people interested in tackling them, such as Gokinjo Boukentai, Idea no Hi, etc, from which there aren't any news.

It's kind of sad, in my opinion, because there's no way to tell if the project is still on course or dropped. At least, when I decided to drop my pathetic attempt at translating Jungle Wars 2, I updated the post I opened informing of that (no one seemed interested in that game, anyway).
« Last Edit: February 14, 2020, 06:22:08 pm by aqualung »

Vehek

  • Full Member
  • ***
  • Posts: 182
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #7 on: February 14, 2020, 08:18:08 pm »
Quote from: Psyklax
More importantly, how did you figure out the text was in "some 12-bit format"?
I don't remember, it was years ago. Some possibilities of how I did it:
1. Put a breakpoint on the font graphics, see where it gets the base value that it multiplies.
2. There's also some 16-bit little-endian text; the game selects which decoding routines it's using right before using them. However, my notes only documented the two-byte routine used on some text in RAM, so if I did it this way, I didn't do a relative search on the ROM to find text.


As an example of 12-bit text, the beginning of the first gameplay dialog, at 0x390E8, or SNES LOROM address 07:90E8
Code: [Select]
0D E8 00 00 00 0F 14 30 04 23 E0 0C 00 F8 0C 01
Decoded:
80D speaker tag: <神父>
00E blank space
000 new line (auto)
0F0 ...
014 お
043 っ
023 と
0CE 、
0800 player name
0CF 。

Quote from: Light of Hikari
-What is the best script extractor?
As I mentioned, most of the dialog text isn't in the 1-byte or 2-byte format that hex editors and the traditional text dumpers support. abcde is supposed to be able to handle text encodings with unusual number of bits, but I don't know how to use it yet.

abw

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #8 on: February 15, 2020, 01:44:24 pm »
abcde can definitely handle 12-bit encodings... as long as the bits are all together. There's currently no (sane) support for working with encodings where the bits for one token are interleaved with the bits for a different token like 0D E8 00. Technically you could make a giant table file with every combination of tokens, but that's not a good option. Is that 0800 a typo, or is the game really pulling an extra 0 from several bytes away?

Assuming the encoding is strictly 12-bit, one better option is to filter the binary through a tiny script that reverses the middle nybbles of each 3 bytes (e.g. converting to 0D 8E 00) and then make your table file based on that:
Quote from: Love Quest (J).tbl
%000011011000=[speaker tag: [神父]]
%111000000000=
%000000000000=[line]\n
%000000001111=…
%000101000000=お
%001100000100=っ
%001000110000=と
%111000001100=、
%000000001000=[player name]
%111100001100=。

Once you've got the bits rearranged so that the tokens don't overlap with each other anymore, extracting with abcde should work just fine:
Code: [Select]
$ dd bs=1 skip=$((0x390E8)) count=15 if="Love Quest (J).smc" 2> /dev/null | perl -e 'local $/;$_=unpack("H*", <>);s/(..)(.)(.)(..)/\1\3\2\4/g;print pack("H*", $_);' | perl abcde.pl -m bin2text -t "Love Quest (J).tbl"
[speaker tag: [神父]] [line]
…おっと、[player name]。

Inserting is basically the same process in reverse; convert your text to binary, rearrange the bits, and then insert them into the ROM:
Code: [Select]
$ echo "[speaker tag: [神父]] [line]…おっと、[player name]。" | perl abcde.pl -m text2bin -t "Love Quest (J).tbl" | perl -e 'local $/;$_=unpack("H*", <>);s/(..)(.)(.)(..)/\1\3\2\4/g;print pack("H*", $_);' | dd conv=notrunc bs=1 of="Love Quest (J)2.smc" seek=$((0x390E8)) 2> /dev/null

That's just a proof of concept, but if you apply the idea of de-interleaving the bits before translating binary to text and re-interleaving the bits after translating from text to binary at the appropriate places, you should be able to set up a build process that works.

Light of Hikari

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #9 on: February 15, 2020, 02:10:41 pm »
Questions:
To abx: I want to do the tiny script for the 12-bit encoding filtering. What program I use?
To anyone that knows about: I can't open abcde normally. I opened it with Perl and only opens an command window in seconds and after disappears. What I can do?
« Last Edit: February 15, 2020, 03:35:04 pm by Light of Hikari »

Jorpho

  • Hero Member
  • *****
  • Posts: 4246
  • The cat screams with the voice of a man.
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #10 on: February 16, 2020, 10:39:00 pm »
To anyone that knows about: I can't open abcde normally. I opened it with Perl and only opens an command window in seconds and after disappears. What I can do?
Shift-right-click the folder in Windows Explorer and select "Open command prompt here".  Then run the program from that window.  (The exact command you should use will depend on how you installed Perl.)
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

abw

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
Re: Help With Japanese-English Translation (SNES)
« Reply #11 on: February 17, 2020, 11:10:24 pm »
Questions:
To abx: I want to do the tiny script for the 12-bit encoding filtering. What program I use?
I'd probably go with whatever your preferred programming language is. If all else fails, you could just use the one I already gave you twice above:
Code: [Select]
perl -e 'local $/;$_=unpack("H*", <>);s/(..)(.)(.)(..)/\1\3\2\4/g;print pack("H*", $_);'

To anyone that knows about: I can't open abcde normally. I opened it with Perl and only opens an command window in seconds and after disappears. What I can do?
Shift-right-click the folder in Windows Explorer and select "Open command prompt here".  Then run the program from that window.  (The exact command you should use will depend on how you installed Perl.)
+1.
abcde is a command-line program; there is no GUI for it. If you're not familiar with running programs from the command line, there are plenty of resources on the internet that explain how to do so.