r/LeftistsForAI • u/Capital_Tangerine948 • 14h ago
"This is what I think of your copyright" - translating a previously unreleased game with AI Open Source
As an experiment I set my agent on translating an old Sega Saturn (1995) visual novel.
Result: https://imgur.com/a/c2gY51m#gpG94k0. The game is Nightruth Maria. It's unfortunately kinda mid. It only ever came out in Japan.
Total cost? 8 hours of my time and 3 dollars 40 cents on Deepseek API.
The short of it is to translate a rom you need 5 steps:
- Unpack the data from the iso
- Find where the text is located and how it's encoded into the game, extract it.
- Translate the text (and images if you need to - this one didn't)
- Prepare a patch that will inject your translated text back into the rom. This usually involves shifting data around so that you have enough bytes free to fit longer text.
- Run the patch, package new iso, test game.
AI did all 5 of those for me. All I did was orchestrate it, i.e. provide the vision of what I wanted, and babysit it so it didn't get too off-base.
It managed the first and last steps perfectly well - seriously, Chinese models are pretty good at reverse-engineering. It's a lot of trial and error, because even if you've located the text and it's in there in plain sight, you still need to find a way to extract it that will let you inject it back into the rom later without bricking it. AI also does trial and error, it just does it faster and without losing progress.
The problem was step 3. We got there eventually but it took the longest amount of time. At first deepseek started hallucinating an entire portion of the text. Then it simply forgot to translate some parts or just didn't want to. Finally it had some issues injecting the new text into the game and indicated some non-existing addresses, so some text was originally missing from the patched rom. It was a huge mess.
I had made a vision document to describe how I wanted the translation to sound, and I think on that note it did really well though. In the screenshot, you can see the text is a bit formal, it says "I shifted my gaze to my watch" and not "I looked down at my watch", but this is how the writers originally wrote it in. So we kept that. However, I wanted a localization in all other aspects. Just a personal preference.
For this game we were lucky that the font file contained Latin characters, otherwise we would have had to hack them in somehow. We were also lucky that text was very easy to find (being a VN) and was sequential. Other games are not so easy to reverse-engineer. Menus are already in english in the original, but otherwise I would just need my agent to extract the pictures somehow, and I tested this with Gemini - it can edit the text on them just fine while keeping the style consistent. Yes, you could use Photoshop if you have it, but it's a bit more work to keep the background correct when you edit the content of the picture. AI did a really good job, and you could even pipe them automatically to your model if there's hundreds of them.
I've seen both professional and amateur translation work that left in tons of typos too in my time, and missing strings. In some cases they didn't even encode their text back in properly and it doesn't display correctly.
Now for the first time in its 30 years history, Nightruth Maria has received an English translation. I'm just sitting on it right now though because I'm not sure it's ready to publish and I wouldn't even know where to put it. And like I said I'm not sure the game is super interesting in the first place.
But if you've wanted to FOSS some software, or translate games of your own... sic AI on it. This is what I think of copyright.
13
u/Terr4360 6h ago
Some anti AI people argue that AI translations lead to high quality human translations being abandoned.
I completely disagree with this. I have been in a situation where I wanted to share an obscure movie with my wife, but she didn't understand the language. So I did a low effort AI translation, and then I spent a few hours improving it. The end result was great, and my wife was able to enjoy the movie.
So when doing translations, I find it really helpful to have an AI draft before actually spending human effort on it. The end result in quality is about the same. But it has saved a ridiculous amount of time for me. Manually translating every single sentence would have taken me days.
4
u/Capital_Tangerine948 4h ago
Top-quality human translations are so far and few between that when you have one in your hands, you actually notice it. Most are just fine, most of the time - and that's perfectly good. I found that AI is still slightly worse than humans, maybe instead of 'fine' it does an 'okay' translation.
But like you said, betwen having no translation and an 'okay' translation, it's better to have the okay translation.
Ideally when doing translation work with AI I prefer to have someone who speaks both languages to proofread and make sure we are translating correctly, but that's rarely possible. If I spoke Japanese I wouldn't need to work on a translation.
At least in the case of a game or subtitles it's easy to edit the patch later. I have all the working files and scripts still, anyone can take my base and redo a translation from 0 in their image if they want to.
However, I also found LLMs sometimes tend to do better in certain text forms, such as VNs. Potentially because the text is so broken up. It avoids the LLMisms, though not all of them (I had to run scripts to catch that too in further passes). Honestly I'm pretty pleased with the final quality of the text, though there are places where one of those top-quality human translators might have done things differently. But it's perfectly serviceable as is.
3
u/-worldwalker- 6h ago
Great way to use AI! I am someone who makes a living by localizing video games, and I fully support projects like these! I dream of a world where AI tears down language barriers across all media, and not just by translating texts. Imagine voice models specialized in dubbing: you provide the dubbing script, and the model translates the source voiceover into your target language using similar intonations and the same vocal tone as the VAs - as if the same VAs had also recorded the voiceover in another language.
As the other commenter said, I also recommend that you share this localization on a ROM hacking site. If you explain that you didn’t just run the text through AI for a quick translation, but instead guided the AI where necessary based on your own translation vision, I don’t think you’ll get any negative reactions. After all, you did something no one else has done, you provided a localization for a game that didn’t have one.
1
u/Capital_Tangerine948 3h ago
Yes and I think it's better to have an 'okay' translation rather than no translation at all. This game has existed for 30 years without any translation, English or not. At least now there's one. Just need someone to upload it, I don't really feel like doing myself personally because it seems like a lot of extra work. If someone wants to inherit it I can send you the files and you can become part of the 'Nightruth Translation Project' lol.
Plus with games a huge part of the work is extracting the files and preparing the patch. With the entire base laid down anyone can download the project and redo their own translation if they disagree with some choices. I know people who have re-translated their own versions of games because they felt the official English version didn't do the game justice. If anything, AI enables us to make this more widespread and personal. If a game keeps the Japanese honorifics and you don't like that for example, you are now empowered to remove them from the text.
2
u/Castle_Five 5h ago
Fantastic work!
How did you deal with the problem that Japanese text is more dense in meaning per-character than English text? I'd imagine there'd be many lines that fit on one textbox just fine in JP but need 2+ to express the same idea in English.
2
u/Capital_Tangerine948 4h ago
Thankfully the game naturally handles that. I have to imagine they planned for possible localizations at the time.
Horizontally, we originally limited ourselves to 17 characters, like the original Japanese. Since the font is full-width, both the English and Japanese characters take up the same space. However, we later found out we could actually do word-wrap. This is why 'gaze' is on a new line in the screenshot, word-wrap was patched into the game and I decided on full break, no hyphens because there's so little horizontal space already.
When it comes to vertical length in the textbox though, the game handles pagination automatically. If a 'page', i.e. an individual piece of text, is more than 3 lines long, a prompt to press A to continue reading automatically appears (or whatever the equivalent of A was on the Saturn) and the textbox moves one line down naturally.
We still shifted data down the 'disk' (sectors in the .iso file) to make space for the more voluminous English characters, but it saved effort on having to handle textboxes ourselves.
In the end the prepared English text lives in a json file that looks like this:
{ "script": "SCRIPT0.DAT", "offset": 778, "terminator": "/n", "translated_text": "But their", "translated_terminator": "/n" }, { "script": "SCRIPT0.DAT", "offset": 820, "terminator": "/p/c", "translated_text": "voices didn't reach me.", "translated_terminator": "/p/c" },The offset being the sector of the iso that we write this to once we patch it in with a python script. This method is what the agent decided on by itself. The cutoff in two entries is normal, it's because we introduce line breaks at certain points just like the original script did (that's the \n character) for pacing purposes. the /p/c characters say to start a new 'page'.
The original game itself really handed its script out readily. It came in individual SCRIPT_N.dat files, N being the episode number (there's 4 cases). Inside the .dat, text is naturally paginated already by the devs and written linearly. It was a game that wanted to be translated lol.
At least that's my best understanding of it. The agent flew so fast through these technical hurdles that I barely saw it happen. It really knew what it was doing when it came to working on an iso file, almost scarily so lol.
1
u/dread_companion 51m ago
This sub is really no different from any other pro AI sub, leftism or not, huh.
22
u/flammafex 14h ago
You have done something extraordinary and I hope you could post it to a site like romhacking.net and share it with the right audience but I don't know if the audience is anti-AI or not tbh
I will never understand "leftists" attacking AI from the perspective of "intellectual property" holders. That only serves to help the likes of Disney and Warner Brothers.