NDS Translator Application

Discussion in 'NDS - ROM Hacking and Translations' started by oldbushie, Aug 31, 2009.

  1. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    I made this application which is capable of translating games on the fly: Aerobush Screenshot Translator Version 1.35

    Basically, it builds an array of characters based on the font files, and polls the system clipboard for changes. Every time you hit alt+printscreen, for instance, it will attempt to translate the screenshot you just took. You can then edit the Japanese text if there's any errors and re-translate it.

    However, right now it's a bit dependent on exact character matching, and creating fonts from nds roms is rather tedious when I can't extract the font file in the rom into an image. Right now I'm basically using the character naming screen to create two fonts (one that's used in the creation screen and one that's used in general dialog in the game). I would love to do fuzzy OCR, but some of the small fonts are so stylistic they barely resemble the original Japanese characters.

    Edit: New version available! The application now takes only 0.25 seconds to translate the average emulator screenshot, and 10 seconds to translate an entire 1920x1200 screenshot. It's also much easier to use; the config file is not needed anymore. You only need to create the font files. More improvements are on the way...

    Re-edit: The current version supports multiple languages for input and output and fixes some issues that caused text to not line up properly. I would like to make the text output separated into frames based on how the text is arranged on the screen, but that's just cake at this point. All the really hard stuff is *done*. [​IMG]

    Edit 3: I did numerous tweaks and bug fixes, and I also added all the fonts for Tingle's Balloon Trip. I basically messed around with the address ranges that point to the fonts in order to control the fonts displayed on the character selection screen. Took some time, but I think it's worth it.
     
  2. azerty1

    azerty1 GBAtemp Regular

    Member
    160
    0
    Mar 22, 2009
    Canada
    so...given a font and a screenshot, it translates the graphic into text and then searches the rom for the text? but if you just replace the text with translated text, wouldn't that mess something up? i don't quite get how this can work with all nds games...
     
  3. sadak5

    sadak5 GBAtemp Fan

    Member
    421
    0
    Feb 27, 2007
    Mexico
    Mexico City
    His post says its for extracting it and letting you to translate it using google translate. I remember there was a program like this to help you play Japanese games in Windows
     
  4. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    Yeah, I don't touch the rom itself, I just use screenshots from the emulator. This is meant to be a streaming translator if you just want to translate as you play. I have the tool that Sadak mentioned, which works great for PC games, and it is indeed the inspiration for this application (though the PC game translator has an easier job since it simply grabs the text out of the textboxes; no character recognition is involved).
     
  5. DarthNemesis

    DarthNemesis GBAtemp Maniac

    Member
    1,211
    41
    Feb 19, 2008
    United States
    Edit: nevermind, question was answered
     
  6. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    Edit: No answer clarification needed.
     
  7. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    New version available! More details in the first post. I basically added advanced blob detection to make it orders of magnitude faster to look for possible characters on the screen. I still need to fix a few minor hitches with punctuation, but there's enough changes to warrant a new release. Enjoy!!!!
     
  8. cybrian

    cybrian Advanced Member

    Newcomer
    83
    47
    Sep 14, 2009
    United States
    If only there was something like this for people playing it on a real DS...
     
  9. dimmidice

    dimmidice GBAtemp Advanced Maniac

    Member
    1,949
    1,344
    Sep 12, 2009
    Belgium
    could you add the fonts of Pokemon heartgold and Soulsilver? i'm not quite sure how to do it myself....
     
  10. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    Yeah, I know. If there's a way to create a homebrew wrapper that has some basic functions (get a screenshot of the current game and temporarily replace the top screen with output, triggered by a certain button combination) I would totally port it to the DS. I don't know if such wrappers are possible, though. I may have to check out a homebrew forum.
     
  11. Pyrofyr

    Pyrofyr GBAtemp Maniac

    Member
    1,258
    5
    Apr 24, 2008
    United States
    Miami
    Probably not possible. The SCDS1 seems to have problem enough just loading up RTS/Guide/Cheats with the game. Most other carts even only have Reset.

    I believe I read a while back that the Supercard team had thought of a few other things to add with it, but they couldn't do it because it wasn't powerful enough. Same thing with someone who tried to make a persistent HUD.
     
  12. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    Pity. I was hoping that this wrapper would technically be possible considering it's not touching the game directly, just the hardware. But then, in order to do that, I guess it would have to be built into the firmware on a flashcart.
     
  13. Shardnax

    Shardnax GBAtemp Regular

    Member
    179
    1
    Aug 23, 2008
    United States
    It'd probably need to be something like the DSi movie player cart. Nonetheless, this is awesome, thanks for developing it [​IMG].
     
  14. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    I'm so glad you're getting good use out of it! [​IMG] I'm honestly surprised that a tool like this (being able to scan for specific fonts) didn't exist yet. Fuzzy OCR just doesn't work very well on tiny fonts.

    Also, can anyone *please* take a look at these font files for the Tingle game? http://www.aerobushentertainment.com/misc/...leFontFiles.zip
    The .inf file seems to specify the chunks that the extensionless file should be broken up into (there's 10 fonts packed into there) but I'm baffled as to what to do. I'd really like to grab all the fonts for this game. I tried analyzing the raw image data for patterns and I did see that there's an apparent slight gap between the different fonts (9 gaps total). I couldn't figure out the magic way to parse it, though.
     
  15. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    I managed to figure out the inf file at least, and updated the zip to contain the unpacked files. The inf contains address ranges for all the individual files in the giant packed file. All 10 of the sub-files contain DFV in the same place in the header, so that's promising at least. Now if only I could find out what DFV stands for... In the meantime, I'm basically guessing at the color depth used in the font image file.
     
  16. oldbushie
    OP

    oldbushie Member

    Newcomer
    29
    0
    Aug 22, 2008
    United States
    I gave up on trying to decipher those files, and instead tweaked and repacked the rom to help create all the fonts by hand. I also fixed a bunch of minor issues. Check it out! [​IMG]