Unity Looking for Advice/a Lesson in Accessing Text in Japanese Unity Games

dudebroman

Newbie
Jun 22, 2017
44
41
Hello friends :)

Just a by-the-by, if anyone has the knowledge or experience to throw a few useful words at me!
Looking to get into the text for games such as:


I, as someone who knows less than nothing about Unity etc. have spent countless hours trying to figure this out to no avail :( I just can't seem to be able to access any tangible Japanese text that I could translate and then replace. I have also scoured the web for useful information :) just so I'm not clogging up the site with stupid questions :L

Any help massively appreciated.

Dude out.
 

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,452
6,908
It obviously depends on how the text is stored in the game. Some games have a single text file (key=value sort of thing). Other games have it compiled into various places in the C# scripts. Still others use engines like Fungus, which have their own means of storing the text. So there really isn't a single answer.
 

dudebroman

Newbie
Jun 22, 2017
44
41
It obviously depends on how the text is stored in the game. Some games have a single text file (key=value sort of thing). Other games have it compiled into various places in the C# scripts. Still others use engines like Fungus, which have their own means of storing the text. So there really isn't a single answer.
I see, that makes it a little clearer. So, I'd imagine each individual game would use one of those things, right? As opposed to a mix & match? And also, how do you tell which one is being used? xD I mean, if it's relatively simple. I don't want to waste your time! :) Cheers.
 

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,452
6,908
Well, in most Unity games there's some mixing. For example, text on things like buttons are frequently stored inside the button definition, while "visual novel"-type text is probably stored in a different way. (That has to do with the fact that Unity kind of encourages you to embed things like button text within the assets themselves.)

The general way you'd go about this is to use the to look inside the resources and assets files that end up in the WhateverTheGameTitleIs_Data folder. If the developer took the "one big text file" approach, then there would be a text resource buried inside one of those that would have all that text. It could be extracted, analyzed, translated and then replaced using Asset Bundle Extractor. If the developer didn't take that approach, live gets a LOT more difficult. Not undoable if you have a lot of persistence, but definitely more challenging.

It's kind of interesting that you've asked this general question - I'm working with a team on a couple of games, and one of the things I specifically did was to separate text out into their own assets, specifically so that they _could_ be easily translated. But to do that you usually have to plan for it specifically.
 

dudebroman

Newbie
Jun 22, 2017
44
41
Well, in most Unity games there's some mixing. For example, text on things like buttons are frequently stored inside the button definition, while "visual novel"-type text is probably stored in a different way. (That has to do with the fact that Unity kind of encourages you to embed things like button text within the assets themselves.)

The general way you'd go about this is to use the to look inside the resources and assets files that end up in the WhateverTheGameTitleIs_Data folder. If the developer took the "one big text file" approach, then there would be a text resource buried inside one of those that would have all that text. It could be extracted, analyzed, translated and then replaced using Asset Bundle Extractor. If the developer didn't take that approach, live gets a LOT more difficult. Not undoable if you have a lot of persistence, but definitely more challenging.

It's kind of interesting that you've asked this general question - I'm working with a team on a couple of games, and one of the things I specifically did was to separate text out into their own assets, specifically so that they _could_ be easily translated. But to do that you usually have to plan for it specifically.
Bro thank you for taking the time to type all of that out :) Clears things up a little! Will delve deep into the Bundle Extractor tomorrow :D

What about, say, if things got a LOT more difficult? :L
 

Droid Productions

[Love of Magic]
Donor
Game Developer
Dec 30, 2017
6,582
16,606
That's where having a slightly broader understanding of how Unity deals with assets becomes useful :)
Quite often the data is stored in a simple DB, for example Once you start poking through, you may find a text file, but it's got formatting issues.

It might help to start out working with an existing project, for example volunteering with one of the groups already translating Japanese games. Once you've done a couple of projects, branching out on your own becomes a lot easier.
 
  • Like
Reactions: dudebroman

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,452
6,908
What about, say, if things got a LOT more difficult? :L
All depends on "difficult how." Things that I've seen:
  1. As @droid1984 mentioned, the text could be in a database that's embedded inside the program. In that case, you'd have to figure out what database format was being used, since your replacement text won't have the same number of bytes as the original. Then you'd have to rebuild the database with the translated text and insert it back into the asset bundle.
  2. The text could be all in one file, but could be encrypted. In that case, you'd have to reverse engineer the C# code to work out from where it was loaded and how it was encrypted so that you could decrypt, translate and re-encrypt.
  3. They could be using an engine like Fungus, in which case each line of text might be embedded within a Unity ScriptableObject (or MonoBehavior). You'd have to extract each individual ScriptableObject from the asset bundles, replace the text (handling differences in text length) and then re-insert the ScriptableObject back into the asset bundles.
It all boils down to their game architecture, and whether they made any provisions for translations. Many engines (like Fungus) try to make it real easy for programmers to do their state machines, but sacrifice "translatability" as a side effect. But you've almost certainly got to do some reverse engineering based on the C#, unless you are lucky enough to simply find a single text file embedded in the program. Which probably means at least some knowledge of C#, and a reverse engineering tool like dnSpy or DotPeek. Plus some patience and perseverence.

Difficult enough for you? LOL Not saying it has to be that way, but it could be...