Anyways, welcome to
The Tingle's Balloon Trip of Love
Hacking Writeup (Pt. 3)
So now we get into more specific stuff - text editing! This is arguably the most important part of any translation (most at least), since the majority of the text is usually displayed with a script engine. As I mentioned before, the script for the game is located in data/db/lang.bin.
In a very broad sense, this file is divided into two parts - line lengths/pointers and the actual text.
The actual text is very simple to edit. The game uses a 16 bit (2 byte) character encoding. That means that in a hex editor, two bytes equal a character rather than one.
The more complex part of this comes with the other part of the file, the line lengths. Basically every line in the game has its length defined by a value in the beginning of lang.bin. Now this presents an interesting question that I don't fully have an answer to.
(Warning - technical stuff that only some may understand lies ahead ;) )
(Warning - technical stuff that only some may understand lies ahead ;) )
The game doesn't use any kind of pointer system for the text, it just has the values that specify the length of each line in the same order the lines appear in lang.bin. So how does it know where each line starts, in order to display it ingame? I don't know, at least not for sure. However, the most logical assumption would be that the game somehow knows the order of the lines and bases it off of that (this is most likely in the olz files). This is further supported by the fact that the game only displays the text correctly when it's in the exact order as it was before being edited.
(Technical stuff over)
So how do we edit the text? Sounds tedious right? Well, luckily we have a nice text extracter and inserter from DarthNemesis that exports the script to a .txt, and then imports the edited .txt back into lang.bin!
The final thing that I want to briefly touch on in this post is the font. Now, this is kind've getting into graphics territory, which is out of the scope of this post, but the game stores all of its font files in the resLibFnt archive. The game has 10 variable width fonts that includes Japanese hiragana and katakana, the Latin alphabet with accented and other special characters, punctuation, as well as many other symbols. Anyways I'll leave the rest of that stuff for the graphics post :)
As always, feel free to post any questions, comments, or concerns you may have!
(On another note, the next post will also contain an update on the status on the project, since actual progress hasn't been discussed since I've started this series of posts :D)







