A while ago, I started working on a community translation of Monster Hunter Frontier. This project has been quite an adventure, and I’d like to explain some tools that were used along the way.
Reading Game Data
The first challenge was figuring out how to get access to the strings that needed to be translated. After researching in the client files, it became apparent that they were compressed and encrypted. To overcome this hurdle, I had to use a tool called ReFrontier. Although it was poorly documented at the time, I managed to improve the tool and successfully decompress and decrypt the game binary files.
Even with the files decompressed, they still required an hex editor to read. The game strings are encoded in Shift_JISx0213, which meant that most hex editors couldn’t render them properly in ASCII. However, using an English translation instead proved much easier.
Another valuable tool was Monster Hunter Frontier Patterns, created by var-username. This tool provides syntactic coloration and highlights directly in the hex editor, making it easier to explore the file structure and understand how the game data is organized.
Editing Data
However, I still needed a way to edit the data. To achieve this, I developed a new Python tool called FrontierTextHandler. This tool uses data from Monster Hunter Frontier Patterns and can efficiently segment interesting parts of a binary file (such as item names or descriptions) into a classical CSV file.
A simple use case to extract the item names from mhfdat.bin would be:
python main.py --xpath=dat/item/names
This CSV can then be inserted back into the game files using ReFrontier. Although FrontierTextTool, which comes with ReFrontier, is intended for this purpose, it has limitations due to custom field separations and encoding choices.
Building a Translation Website
Since we wanted to create a community-based translation, something more user-friendly was needed. To achieve this, I used Weblate, an open-source web application for community translations. Since I already had a virtual private server running a Monster Hunter Frontier server, hosting the translation website on it made sense.
After tweaking Weblate to meet our needs, the translation server was up and running. This platform allows users to register and contribute translations without needing programming skills.
At the time of writing, the official link to the website has not been published yet so hand tight!
CSV File Format
The CSV file format chosen for this project is a standard “translation CSV” that is human-readable. The first column represents the location of the string (where it was found), followed by the source (the original value) and the target (the translation in the target language).
location | source | target |
---|---|---|
12173472@mhfdat.bin | −−−−−− | −−−−−− |
12173476@mhfdat.bin | Book of Combos 1 | Book of Combos 1 |
12173480@mhfdat.bin | Book of Combos 2 | Book of Combos 2 |
12173484@mhfdat.bin | Book of Combos 3 | Book of Combos 3 |
12173488@mhfdat.bin | Book of Combos 4 | Book of Combos 4 |
12173492@mhfdat.bin | Book of Combos 5 | Book of Combos 5 |
12173496@mhfdat.bin | Alchemy Guide | Alchemy Guide |
12173500@mhfdat.bin | Potion | Potion |
12173504@mhfdat.bin | Mega Potion | Mega Potion |
12173508@mhfdat.bin | Nutrients | Nutrients |
This format allows us to keep track of changes between the source and target languages, making it easier to edit the correct file when necessary.
Using the App
Once we’re satisfied with our translations, users can click on “Download CSV” to generate a CSV file containing the translations. This CSV can then be used with FrontierTextHandler to change the original binary file.
Finally, ReFrontier needs to be used to convert the file format, and the updated game files are ready for play with a new translation!
Conclusion
The translation project has been a great success, thanks to the tools developed along the way. The combination of ReFrontier, FrontierTextHandler, Weblate, and the translation CSV file format have made it possible to create a community-based translation platform that is both user-friendly and efficient.
This project showcases the power of collaboration and open-source development in creating innovative solutions for complex problems. I hope this example will inspire others to embark on similar projects and share their experiences with the community.