taskforce wrote:
Sorry to shoot your idea in the foot but making an auto-translator for an emulator would be highly difficult if not absolutely impossible. The reason it works on PC is there is a standardized encoding scheme for text. Shift-JIS or UTF-8 or something. That does not exist on consoles of this era. Maybe it exists on some newer 32 and 64 bit machines but not these older 8 bit, 16 bit and most 32 bit ones. All text in a game is just a byte or two which is used to point to a graphic in the game. Computers also generally work somewhat similar but the encoding is mostly standardized to a specific scheme. However on consoles, these graphics while usually stored in the same general layout for English are almost never exactly the same and they almost never are in a specific order for Japanese, especially if it has kanji. The emulator has no way of knowing what graphics are where or how a program chooses to point to those graphics. Is it 8 bit or 16 bit. Even if you know that you still do not know what corresponds to what letter. Sure if you have the graphics the layout will likely be in order of the code but that code can still be pretty much anything. Maybe your graphics start with a reference of byte 20, or maybe they start at byte 80. Point is, you can't be sure. An emulator would have to OCR those graphics, figure out what order they're in and then run a translation on them. And that is assuming the game isn't using even more trickery for things like DTE or such. Even if you hooked onto video memory to bypass thos tricks assuming something in there is going to be standard uncompressed text, you still have to work out what that something is. That isn't likely to ever happen. That is one of the reasons why auto-translators also don't work for every PC game. Not all of them use standard encoding. When they don't, that text hooker just won't work.
Sorry, long post ahead:
Well, in fact my idea didn't consist on going that deep into how the game is programmed (what you've explained is needed only if you want to actually modify the rom itself to insert the translation). My idea was something much more simple (and limited, but it does the trick), similar to this proof of concept I did with Jungle Wars 2 using Wanderbar:
https://www.youtube.com/watch?v=8UWST-PPOZMWanderbar is basically a modified snes9x emulator glued to an html browser window (when you launch the emu, so does the browser). The only thing I did, (using a LUA script that wanderbar's creator already provided for me) is capture the line ID of every dialog in the game and then I create an html file, with the corresponding line ID, but with the dialog translated into English. What Wanderbar does is:
- every time a dialog bubble opens in the game (when you talk to an npc, etc), it captures the line ID of that dialog.
- then it accesses the html file and looks for the translated dialog that has that same lineID, and writes it on the browser window as html.
My point is that emulators could be somewhat modified to do exactly the same, but showing the translated text on an overlay layer(*) on top of the emulator screen instead of in an adjacent window as it currently does.
(*) think for instance when in an emulator you do a savestate and the emu shows a message saying "state saved in slot 1". I suppose it uses an overlay to show that message. The translation could be shown in the same way.
I know it's much more limited than hacking the rom itself, but it's also easier and in the end it's just an alternative way to translate the most important part of an rpg (the script dialogs) without having to modify anything in the rom. The only thing the romhacker would have to do is find out how a game identifies every line of text, which is much less complicated than modifying the rom, with all the complications it entails (dealing with compressed fonts, not enough space in the rom to put the English text, unexpected bugs). After that, a person with enough knowledge of Japanese can translate the whole game's dialogs without having to know a single technical aspect of romhacking.
Also, as tcaud had already stated before, the game could only be played on an emulator supporting this feature, so we would get rid of the pirate repro sellers problem, which have already made some people quit translating (aishsha, for instance, said something about considering quitting because of that). And regarding the purists that would complain for not being able to play the game on real hardware... well, if you like the game enough, you'd be willing to do a compromise and play it on an emu. I've played almost all my favourite snes translations on PC and I've enjoyed them practically the same as if I'd played them on its original hardware.