Last update: 14/01/2013
Introduction
I have been interested in this game ever since the first time I saw it. Unfortunately the game was never released in English (even though they worked on it), which means I haven't been able to enjoy it. I've been waiting for a translation of the game, and I've seen it in the official Translation Request-thread, but, as far as I know, no one is, or has been, working on it. That leads me to why I started this thread.
I wanted to help out a little. I don't understand a word Japanese, but I've been coding for a few years now. I've started to look into the game and tried to figure out various things about it. I've made some progress, which I'll discuss a little bit later, but first I would like to stress that this is NOT a translation project. That would be impossible, because as I mentioned earlier, I don't underestand Japanese. I want to help out and provide tools, if I can.
Progress
locstr.bin
Alright, now to something more interesting, namely what I've done so far. I've looked into how the game encodes and stores its text. Firstly, the game uses UTF-16LE (little-endian), which I found out when I was looking through one of the NFTR-files. Secondly, the game stores non-dialog text in a file called locstr.bin, which uses a really simple format:
Note: Null-terminated refers to '\u0000' in this case, not '\0' (remember, the game uses UTF-16)
I've created a simple tool in Ruby that can dump all the strings in a simple text file and also "parse" the file back to the locstr.bin-format. In the text-file the strings are encoded in UTF-8, which is a bit simpler for most text-editors to work with. When the text files is made back into a locstr-file, the strings are again coded in UTF-16LE.
To test whether locstr.bin is used by the game (and not just left there by the developers), I dumped the strings, added a symbol to the text shown in the menu-buttons (title screen), turned the text file back into a locstr-file and put it in the game. When I started the game I saw that the symbol I added showed up in the buttons, which confirmed that the game uses locstr.bin. (See screenshots further down.)
String formatting
Something I found interesting about the strings is that they seem to be printf format strings, or at least something very similar. Here are some examples from locstr.bin:
Another interesting note about the strings is that the length doesn't really matter (as far as I know) since all strings are relative to the string-data-offset. This can bee seen in the screenshots below. This means that no pointers have to be changed manually in order to get the game to print the whole string. However, I'm pretty sure the game won't automatically make the string fit into e.g. the dialog box, i.e. by "splitting" the string and letting the player progress by pressing A, or some other button. (I'll try to clarify what I mean later on, if anyone finds it hard to understand).
dlgidx.bin
This file contains the information about each dialog entry in dlgcmd.bin.
Note: I'm aware that the descriptions aren't very clear. I'll most likely rewrite them once I've completed the documentation of dlgcmd.bin.
dlgcmd.bin
This file contains all the dialogs in the game. Each dialog entry can have one ore more sub-dialogs. The amount of sub-dialogs in a dialog entry is specified in it's header.
[EDIT: I've removed the documentation on the dlgcmd-format for now. I'm planning on uploading it on GitHub instead. The old one was wrong in many ways, which is why it's no reason to keep it here.]
My dlgcmd tool is not available on GitHub. You'll find a link to the repository further down in the "Resources" section.
The next step
There are several other things I would like to look into, other than improving the tool I've already made. For example, I would like to look into dlgidx.bin and dlgcmd.bin, since I think they may contain something interesting. (Judging from the file names they seem to contain Dialog IDs and Dialog Commands respectively, but I may be totally wrong about that).
I'm currently working on both dlgidx.bin and dlgcmd.bin. Hopefully the documentation will be finished soon.
As for this thread, I'll probably move the documentation to GitHub instead of having them in this post. If I do that the post will be more clean and easier to read.
Resources
I keep my tools in a GitHub-repository. If you're interested you can find the repository here: IronMaster
Screenshots
locstr.bin
Dialogue changes
Closing words
I would love to hear your thoughts. I don't know if anyone, except from me, is interested in an English translation of the game. I really like trying to figure out how the game works and how the files are formatted. If there's anyone who've already done all this work already, please tell me so that I don't go reinventing the wheel.
Updates
26/11/2012 - Add link to GitHub-repository
28/11/2012 - Add some information about dlgidx.bin and dlgcmd.bin
12/01/2013 - Add some screenshots to show how things are progressing. Remove dlgcmd documentation, since it's old and totally wrong.
14/01/2013 - Tool for dlgcmd/dlgidx is now available from the GitHub repository.
Introduction
I have been interested in this game ever since the first time I saw it. Unfortunately the game was never released in English (even though they worked on it), which means I haven't been able to enjoy it. I've been waiting for a translation of the game, and I've seen it in the official Translation Request-thread, but, as far as I know, no one is, or has been, working on it. That leads me to why I started this thread.
I wanted to help out a little. I don't understand a word Japanese, but I've been coding for a few years now. I've started to look into the game and tried to figure out various things about it. I've made some progress, which I'll discuss a little bit later, but first I would like to stress that this is NOT a translation project. That would be impossible, because as I mentioned earlier, I don't underestand Japanese. I want to help out and provide tools, if I can.
Progress
locstr.bin
Alright, now to something more interesting, namely what I've done so far. I've looked into how the game encodes and stores its text. Firstly, the game uses UTF-16LE (little-endian), which I found out when I was looking through one of the NFTR-files. Secondly, the game stores non-dialog text in a file called locstr.bin, which uses a really simple format:
Code:
Offset Size Value Description
----------------------------------------------------
0x0000 4 0x309 Number of strings
0x0004 4 0x1850 Offset to string-data
Offsets relative to the string-data-offset comes next:
- 4 - String number
- 4 - String offset
And lastly, the string-data (null-terminated strings) at the end:
0x1850 - - String-data
I've created a simple tool in Ruby that can dump all the strings in a simple text file and also "parse" the file back to the locstr.bin-format. In the text-file the strings are encoded in UTF-8, which is a bit simpler for most text-editors to work with. When the text files is made back into a locstr-file, the strings are again coded in UTF-16LE.
To test whether locstr.bin is used by the game (and not just left there by the developers), I dumped the strings, added a symbol to the text shown in the menu-buttons (title screen), turned the text file back into a locstr-file and put it in the game. When I started the game I saw that the symbol I added showed up in the buttons, which confirmed that the game uses locstr.bin. (See screenshots further down.)
String formatting
Something I found interesting about the strings is that they seem to be printf format strings, or at least something very similar. Here are some examples from locstr.bin:
Code:
HP : %d/%d
%s's Room
Lv %d
{0}に護衛の任務を頼む。{1}までの契約。契約金 {2}Gを支払う。
Another interesting note about the strings is that the length doesn't really matter (as far as I know) since all strings are relative to the string-data-offset. This can bee seen in the screenshots below. This means that no pointers have to be changed manually in order to get the game to print the whole string. However, I'm pretty sure the game won't automatically make the string fit into e.g. the dialog box, i.e. by "splitting" the string and letting the player progress by pressing A, or some other button. (I'll try to clarify what I mean later on, if anyone finds it hard to understand).
dlgidx.bin
This file contains the information about each dialog entry in dlgcmd.bin.
Note: I'm aware that the descriptions aren't very clear. I'll most likely rewrite them once I've completed the documentation of dlgcmd.bin.
Code:
Size Value Description
-----------------------------------
2 0x00E9 Number of entries (NoE)
Entry structure (repeated NoE times)
-----------------------------------
4 0x0000D429 Dialog entry ID
4 0xB9CD0200 Offset to dialog entry in dlgcmd.bin
4 0x38000000 Dialog entry header size
4 0xF1CD0200 Offset to dialog entry body
4 0x1C030000 Dialog entry length
dlgcmd.bin
This file contains all the dialogs in the game. Each dialog entry can have one ore more sub-dialogs. The amount of sub-dialogs in a dialog entry is specified in it's header.
[EDIT: I've removed the documentation on the dlgcmd-format for now. I'm planning on uploading it on GitHub instead. The old one was wrong in many ways, which is why it's no reason to keep it here.]
My dlgcmd tool is not available on GitHub. You'll find a link to the repository further down in the "Resources" section.
The next step
I'm currently working on both dlgidx.bin and dlgcmd.bin. Hopefully the documentation will be finished soon.
As for this thread, I'll probably move the documentation to GitHub instead of having them in this post. If I do that the post will be more clean and easier to read.
Resources
I keep my tools in a GitHub-repository. If you're interested you can find the repository here: IronMaster
Screenshots
locstr.bin
Dialogue changes
I would love to hear your thoughts. I don't know if anyone, except from me, is interested in an English translation of the game. I really like trying to figure out how the game works and how the files are formatted. If there's anyone who've already done all this work already, please tell me so that I don't go reinventing the wheel.
Updates
26/11/2012 - Add link to GitHub-repository
28/11/2012 - Add some information about dlgidx.bin and dlgcmd.bin
12/01/2013 - Add some screenshots to show how things are progressing. Remove dlgcmd documentation, since it's old and totally wrong.
14/01/2013 - Tool for dlgcmd/dlgidx is now available from the GitHub repository.