News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Translation of Gamecube and Wii games using custom textures in Dolphin emulator.  (Read 11075 times)

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Hello people, it's been a while silent. I'm writing here today because of a little project outside of RHDN that has caught my attention. A poster in 4chan by the name of Steve started making a menu translation for Super Robot Taisen GC using a (to my knowledge) unconventional method: he makes use of the "load custom textures" feature of the Dolphin emulator to replace the Japanese textures with the translated ones. Fortunately enough, not only the icons of the menu are stored by Dolphin (or maybe the game itself?) as textures, but full boxes of text (such as info text) follow this rule. Here are some examples of his work:

























* These pictures are currently posted in 4chan, so they will disappear in a matter of days. I've been trying to figure out the login of the flickr account I opened 5 years ago for half an hour with no results. If I manage to access it, I'll update the links. Sorry for the inconvenience.

These pictures are still work in progress, but they show this method actually bears results. Battle dialogue can't be translated this way apparently because it draws every character from the game's fonts and displays it individually *BUT* I've performed some tests myself and the rest of the dialogues can be translated with these means:





I would love to say I'm showing these pictures to interest some translation group into taking on the game, but as pointed out by Steve, this isn't an efficient nor elegant way of making a translation patch (as it involves storing each translated texture as a file in a folder) and I know this is not the place to make requests (yeah, I've read the rules). The main reason I'm writing and showing all of this is because, after some google searchs and checking on RHDN, I've noticed nobody has ever used this method before, which by the way is extremely simple in execution and applies not only to this game, but also to many Gamecube and Wii games:

Mobile Suit Gundam: Pilots' Locus (Gamecube)

* Only the name of the pilot is translated (it was a little test)

Super Robot Taisen NEO (Wii)




I could not help but notice how the translation scene for Gamecube and Wii games is pretty much non-existant, so I wrote this "little" post in order to show any would-be translator an easy way to approach the problem.

How does this work?
Dolphin emulator has options in the advanced tab of the graphics configuration for dumping textures to a folder (/User/Dump/Textures/<game id>) and load custom textures from another one (/User/Load/Textures/<game id>). This method involves:

1) Activate "dump textures". From that moment on, Dolphin will store all the textures in the <game id> folder before showing them, that is, what you see is what you get (you would have to play through the whole game to get every dialogue texture, for example). Plugins for Direct 3D 9 and 11 store the textures as PNG, whereas OpenGL stores them as TIFF (we've been using Direct3D for these examples). A good way of getting the textures you want (and not populate your folder with every possible texture) is to only activate this feature at the times where these textures are shown (the use of savestates is also recommended). WARNING: Don't activate "dump textures" while a video is playing, as video frames will be stored as textures as well (I got 1,5 GB of textures while testing SD Gundam G Generation World).

2) Locate the texture you want. There's going to be a bunch of files depending on when you started grabbing them, but it's not impossible.

3) Edit the texture. Using a program like Photoshop or GIMP you can edit the texture into whatever you want to make it. Just try not to change the size (or at least proportions) of it if you don't want to see the emulator making funny stuff (I haven't actually tested this, but I imagine textures can be bigger than their size or there would be no HD remasters of games).

4) Save the texture with the same name it had when it was dumped in the /User/Load/Textures/<game id> folder and activate "load custom textures" in the graphical options. When Dolphin gets to the point it has to show said picture, it will use the one you have in the "load" folder. I must note that Steve has both the "dump textures" and "load custom textures" options active at the same time while using D3D9, but I can't make Dolphin load custom textures if "dump textures" is activated (and I'm using D3D11).

And that's pretty much how it works. During testing we confirmed that menu textures are stored with the same names regardless of the computer, so exporting translations to other computers seems possible, but I've run into some instances of duplicate textures, which rises some doubts about this method (that can only be cleared through experimentation), the main one in my mind right now being if filenames are reused for different textures (which would prove disastrous to any translation project).

Well, there's the info. I hope somebody can make good use of it. And remember that editing textures has more uses other than translation:


If you've played the game, you know that robot is not pink.

* The original thread can be found in the /m/ board of 4chan if anyone feels like contributing to it. It shouldn't be difficult to find through the catalog, but I won't give any link as threads in 4chan can disappear at any time.
« Last Edit: March 14, 2013, 09:15:27 am by Dashman »

Pikachumanson

  • Hero Member
  • *****
  • Posts: 607
    • View Profile
Nice find bro and very informative post! I hope this spurs others interest in hacking gc games. I might try one myself!

DarknessSavior

  • Hero Member
  • *****
  • Posts: 5031
  • Darkness.
    • View Profile
    • DS: No, not the Nintendo one.
Interesting. It's basically like soft subs for video games.

Any chance of these being made into actual ISOs so we can play them on hacked consoles?

~DS
Red Comet: :'( Poor DS. Nobody loves him like RC does. :'(
Sliver-X: LET ME INFRINGE UPON IT WITH MY MOUTH
DSRH - Currently working on: Demon's Blazon, Romancing SaGa, FFIV EasyType.
http://www.youtube.com/user/DarknessSavior

Pennywise

  • Hero Member
  • *****
  • Posts: 2236
  • I'm curious
    • View Profile
    • Yojimbo's Translations
No, I believe it's the same idea as the N64. Basically making hacks for the emulator instead of the system.

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Pennywise is right, it's the same as in N64 emulators. The only way around would be to have a console run Dolphin, or find a way of actually inserting the textures in the game itself, although that would probably work only for some icons in the menu. For the event dialogues I find it hard to believe that the textures we get are what the game has in store instead of text.

KaioShin

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 5697
    • View Profile
    • The Romhacking Aerie
For the event dialogues I find it hard to believe that the textures we get are what the game has in store instead of text.

The textures don't have to exist as texture files in the game files, what happens is that the game creates textures with the text on the fly and uploads them to the GPU. It's at that step where the emulator intercepts them.

It's certainly an interesting approach, though the amount of image editing required would be simply insane. As you say, it might be a viable method for a translation by an enthusiastic fan with tons of time but no hacking skills though.

I once looked into translating Gundam Pilots' Locus myself, it's a very great game. Sadly I couldn't find any text via conventional means IIRC.
All my posts are merely personal opinions and not statements of fact, even if they are not explicitly prefixed by "In my opinion", "IMO", "I believe", or similar modifiers. By reading this disclaimer you agree to reply in spirit of these conditions.

Zoinkity

  • Hero Member
  • *****
  • Posts: 562
    • View Profile
This is also the method being used for some official Nintendo Virtual Console releases.  So, in fact, if you want to port to Wii you could look at the method used to resub certain VC GC games and take a similar approach. 

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
The textures don't have to exist as texture files in the game files, what happens is that the game creates textures with the text on the fly and uploads them to the GPU. It's at that step where the emulator intercepts them.

It's certainly an interesting approach, though the amount of image editing required would be simply insane.
...
Those lines made me think "if a game can generate textures automatically, so can I!" and I've made a little Java applet to generate the dialogue textures of SRW GC from text:



I've run into a little problem though, as the fonts I produce with the program don't look as nice as if I made them with GIMP using antialias:

Left is generated, right is GIMP.

I'm using the Graphics2D library, and I've been messing around with the setRenderHint function (so far interpolation, antialias, dithering and combinations of them) but I can't produce the same effect. The font used is "Segoe UI", fontsize 17. Anybody knows how to make this work?

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Those clearly are not the same fonts. Either you used a bold face in GIMP, or you didn't properly load your font with JAVA, and it used some default font inside.

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Those clearly are not the same fonts. Either you used a bold face in GIMP, or you didn't properly load your font with JAVA, and it used some default font inside.
I thought that could be the case at first, but when I disable "hinting" and "antialiasing" in GIMP, I get the same fonts. Changing the font name in Java has given me many different results as well, so my guess is that GIMP has some special antialiasing configuration that I cannot figure out how to reproduce with Java classes.

Anyway, during the testing process I realized that the font was probably too big, so I began looking for a smaller one. Then at some point I realized that would leave me room for a fourth line of text per dialogue, so I went with MS UI Gothic, size 19. This is the result:



I'm not very happy with the choice of font myself, as it is quite small, probably too much to play from far (unlike the original Japanese characters), and a bit too thin to make out gray from white sometimes (in the picture, upper dialogue is gray, lower is white, but I feel it could be easy to mistake them). Besides, using a Microsoft font is bad for cross-platforming, only Windows users will be able to render the textures (in theory).

I'm going to submit version 1.0 to the database now, but any good font you guys can suggest would be greatly appreciated.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
I thought that could be the case at first, but when I disable "hinting" and "antialiasing" in GIMP, I get the same fonts. Changing the font name in Java has given me many different results as well, so my guess is that GIMP has some special antialiasing configuration that I cannot figure out how to reproduce with Java classes.

I'd be surprised : almost all truetype renderers do hinting the same way (it's part of TTF specification), and even if there are sometimes subtle differences in the way they antialiase, it's practically undistinguisable to the human eye.

Moreover, there are not so much renderer libraries. I assume GIMP uses Freetype (GTK uses this one) which is too much a standard to do fancy things. I don't know about your Java class, but it seems to be standard, so I'd be surprised if it produced really different outputs as you show.

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
well, I honestly have no idea about renderers. I have used the Graphics2D library and its function drawString to write over a generated image and that's what I get. I've obtained different results by changing the name and declaring the font as plain or bold so I know I'm calling them properly. Maybe I was applying the hinting wrong, but they are indeed the same font. So much the same that, after disabling the "hinting" and "antialiasing" in GIMP, I wrote the same lines and moved them over the ones in the generated texture and I got a perfect match. I'm using Netbeans 6.5 (it's an old computer), maybe it's using an old renderer?

Another thing, I've been trying to submit the tool, but I've run into problems with the link. First I've tried sharing it as a Dropbox link, but I can't get any "public link" option, just "share link" which gives me an https that isn't admitted. The link to Ze Bucket takes me to a 403 Forbidden link, and FilDen keeps giving me server errors when I try to register an account, so... huh... help...?

Isao Kronos

  • Hero Member
  • *****
  • Posts: 1217
    • View Profile
That's really neat, GC's one of my favorite SRW games. Wonder how hard it'd be to hardcode the translation when the soft version is done for people that use other methods to play the game like DIOS Mios Lite.

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
The games use compressed archives (.pak). Figure that format/compression  out and you can do all you want :p

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6855
  • *sigh* A changed avatar. Big deal.
    • View Profile
I can only imagine trying to distribute a SRW translation as hacked texture images will result in an INSANELY huge download.
Never mind finding a translator willing to translate millions (realistic estimate?) of images. :P
"My watch says 30 chickens" Google, 2018

KaioShin

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 5697
    • View Profile
    • The Romhacking Aerie
I can't get any "public link" option, just "share link" which gives me an https that isn't admitted.

The file needs to be in the "Public" folder within the dropbox folder.
All my posts are merely personal opinions and not statements of fact, even if they are not explicitly prefixed by "In my opinion", "IMO", "I believe", or similar modifiers. By reading this disclaimer you agree to reply in spirit of these conditions.

tryphon

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
I may be wrong, but after a close look at both screens, I'd say your problem is more related to antialiasing than to hinting. Your left screenshot is not antialised at all.

Dashman

  • Full Member
  • ***
  • Posts: 210
    • View Profile
I can only imagine trying to distribute a SRW translation as hacked texture images will result in an INSANELY huge download.
Never mind finding a translator willing to translate millions (realistic estimate?) of images. :P
That's why I made this little tool. You can create simple text files containing big chunks of the script and their related texture names. The text files are much easier to distribute. Once you load the text files in the applet, you can generate the textures you want with several clicks... now that makes me think I have to add a "Generate all textures in this file" option...

The file needs to be in the "Public" folder within the dropbox folder.
Damn, I'm such a noob... thanks!

I may be wrong, but after a close look at both screens, I'd say your problem is more related to antialiasing than to hinting. Your left screenshot is not antialised at all.
My problem is that I'm clueless in these things :P I use this line

g2d.setRenderHint(RenderHints.KEY_ANTIALIAS, RenderHints.VALUE_ANTIALIAS_ON);

where g2d is a Graphics2D object. It does something but not the desired effect. I've tried using KEY_TEXT_ANTIALIAS and it doesn't seem to work. Using several setRenderHint orders doesn't help either. I think I'll stick to the standard antialias and call it a day.

March 16, 2013, 09:11:39 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Aw crap... seems like since I only recently started using Dropbox, I don't have a Public folder. The Dropboxs website says that folders created before October 2012 retain the "Share public link" option, but that I'm screwed... I'll go find a non-prehistoric fellow to store it for me.

*Edit:
I found a friend with an older Dropbox installed. I placed the file in the Public folder, right-clicked on it, got the public link and it's still an https. I changed the https for http and it looks like it works anyway so I'm using that.
« Last Edit: March 16, 2013, 02:01:52 pm by Dashman »