First  Prev  1  2  3  Next  Last
Post Reply Using AGTH for in-game text translation
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 5/5/09 , edited 6/24/11
(Last Edit 2011-06-24: Updated for new hook address. What might be the last update ever for this hook address... ;_; (RIP ai [email protected])

こんにちは! Hello fellow ai [email protected]! I created this topic to discuss my research into using AGTH to assist me in translation of the ai [email protected] in-game text. As some of you may be aware, the font used for in-game dialog is horrible. All too often, kanji with many strokes become unreadable blobs.

(Hook address is in tl;dr section below, scroll down a bit.)

If you're familiar enough with the kanji to be able to read it anyway, you're okay. However, if you're having to look up the kanji for any reason, it's going to be almost impossible to do so.

This is why I started looking into ways I could get at the text being displayed directly. In my searching, I found AGTH.
AGTH, which stands for Anime Game Text Hooker, is a program that hooks into Japanese games and grabs the text out of them as it is displayed on-screen. The official AGTH help thread is at Hongfire.

Update 2010-05-31: The official website is currently broken, so I've mirrored the RAR archive here.

AGTH by default provides you with some hooks into various functions. Unfortunately, the default functions have a text caching issue. What this means is that a certain character will show up once, and only once, in those functions during the course of a game. This is where the /h parameter to AGTH comes into play.

The /h parameter allows you to define a custom "hook" into the game to grab the text at a user-defined address in the game executable. To find this address, and where to look for the text at that address, a debugger must be used. Also, this address must be updated every time the executable changes. (i.e., every time the game is patched, pretty much.)

So as to not bore the non-programmers out there, I'll get to the point of this thread. This is where I will be providing the AGTH /h parameters for use with ai [email protected] I will not be able to help with using auto-translation software such as Atlas, because I don't use such software myself. However, I will try to help, when I can, with getting AGTH to work with ai [email protected] for anyone interested in doing so.

tl;dr
For those who tl;dr, already know how to use AGTH, and just want the /h parameter, here's the agth command line for ai [email protected] that I currently use: ;)

agth /pn"ai [email protected]" /t [email protected]

Note: This must be run after you have started the game and are at the very least at the login screen, if not fully logged into the game.

Make some text appear by talking to an NPC or your charadoll. Switch to AGTH, and find the UserHook thread entry in the drop-down list that contains the text the NPC or your charadoll just output. Typically it's the one that's lowest on the list of UserHook entries.

end tl;dr

Quick explanation of the command line switches:

/pn"ai [email protected]" -- This attaches agth to the ai [email protected] game executable, which has the process name of "ai [email protected]"

/t -- Always on top. Not entirely necessary, but I do it so that the AGTH window stays on top of all other windows, regardless of which one has the focus at the time. And if I need it out of the way for a bit, I just minimize it.

[email protected] -- This is where the magic is, the custom hook parameter. For those who want the details, this looks for a "wide" character 8 bytes from the top of the stack, at the location 0x00865C90

If anyone is actually interested in the details of how I found the /h switch parameters, and/or how I find the new address when there is an update, just say so here, and I will post further details. n.n

There is a known issue with where the current hook is. The text will repeat itself as a character's dialog string is built. So for a string of 「こんにちは」, you will see: 「「こ「こん「こんに「こんにち「こんにちは「こんにちは」

Fixing this text repetition issue is something I'm working on still, and I will post here when when/if I have fixed it. ;)

Also, if you have questions on getting AGTH working with ai [email protected], please post them here, and I will try and help. It would be appreciated if you could read other posts in the topic (if there are any at that point) to see if your issue has already been addressed, however. n.-

Whew! This was a long post, wasn't it. If you're still reading, thank you for reading it, and I hope this will help you with enjoying ai [email protected] ^_^

--Tasunke
Kanmuri in-game / on IRC
Posted 5/5/09 , edited 5/5/09
-doesnt understand anything- (well thats partially due to the fact that im too lazy to actually read thoroughly what you're wriiting XD)

:D !

nice work though
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 5/5/09

zealtron wrote:

-doesnt understand anything- (well thats partially due to the fact that im too lazy to actually read thoroughly what you're wriiting XD)

:D !

nice work though


*chuckles* Thanks. Of course, I anticipated many people not wanting to read all the way through that long post, so that's why I put in the tl;dr section. ;)

--Tasunke
Moderator
744 cr points
Send Message: Send PM GB Post
27 / M / NETworld
Offline
Posted 5/6/09
LOL @ zeal

isnt AGTH usually used for playing galges? xD
not to mention it isnt translating the text.

actually if you happened cant read a kanji, you can just write the stroke on IME pad to generate the kanji.



IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 5/7/09

chizunyan wrote:

LOL @ zeal

isnt AGTH usually used for playing galges? xD
not to mention it isnt translating the text.


That's correct, it is typically used for those kinds of games. And yes, it doesn't translate the text, it's not supposed to by itself, there's other tools for that. It just helps get the text out of the game where I can copy/paste it into a text file for logging (great for looking back at previous text for reference, especially in some of the recent Clannad quests) and into dictionaries for looking up words. ^_^


chizunyan wrote:
actually if you happened cant read a kanji, you can just write the stroke on IME pad to generate the kanji.


I'm well aware of the written interface on the IME pad. The problem with that is that if I can't see the strokes (due to them having all merged together into a single blob on the screen), I can't know what strokes to write on the IME pad. Also, handwritten interfaces are very particular about stroke order, and if I don't know/remember the correct stroke order, looking up the kanji through a handwritten interface becomes almost impossible. n.n;

-- Tasunke
Member
17 cr points
Send Message: Send PM GB Post
27
Offline
Posted 6/18/09
I seem to have gotten it to work. But not as I would want it to work. It only catches some characters, I guess it is related to me playing windowed perhaps?
Also, is there a way to get it to catch the chat window? It is basically the reason I play [email protected], to try to understand what the Japanese are saying.
Moderator
744 cr points
Send Message: Send PM GB Post
27 / M / NETworld
Offline
Posted 6/18/09
^
for that check your game log,
C:\ai [email protected]\*your chara name*\chat

all is in there
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 6/19/09

materite wrote:

I seem to have gotten it to work. But not as I would want it to work. It only catches some characters, I guess it is related to me playing windowed perhaps?
Also, is there a way to get it to catch the chat window? It is basically the reason I play [email protected], to try to understand what the Japanese are saying.


Sorry, I've been busy this week, and missed updating the hook address for the latest update. ;)
It's probably "not catching some characters" because the hook address I have up there is currently outdated, and you're just viewing the default "TextOutW" hooks or the like. n.n; It has nothing to do with you running it windowed, however.

Those default hooks have what I refer to as the "font caching issue," where once a character has been seen there, you'll never see it again that session. The longer you play, the less text will show up. That's why there's the /h parameter above, that'll catch all the text, though it does have an annoying repetition issue which I've detailed in the first post. However, that must be updated every time the game is patched, and I haven't updated it for this week's patch yet, sorry. ^^;

This hook will also catch chat text, but not in the friendliest or most useful way. n.n; If it works for you, the chat logging would be the best. I haven't been able to get it to work for me, though. All kanji/kana just show up as ?'s in the log file. >.< (And yes, default language is set to Japanese.)

I'll get that hook address updated in a few minutes. n.n
Member
17 cr points
Send Message: Send PM GB Post
27
Offline
Posted 6/21/09
Yeah I just recently found out about the chat log. But I do have the problem with the characters not displaying correctly, so it kind of nullifies that option.
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 6/21/09

materite wrote:

Yeah I just recently found out about the chat log. But I do have the problem with the characters not displaying correctly, so it kind of nullifies that option.


*nods* I did update the hook address in the first post of this thread (though I'll need to again when the next patch comes out). Have you been able to get AGTH to give you the UserHook threads with the full text in them by using that updated address?
Member
137 cr points
Send Message: Send PM GB Post
26 / M / Somewhere, Earth
Offline
Posted 8/13/09
I created a bat file to run the program with the hook and everything, and it opened the program without problem, but then the hooker started listing all of my chat logs over and over until it crashed the game itself. Running it again without already having a massive log of chats works fine. So word of warning for everyone: don't run it after having been playing for a long time!
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 8/13/09

CharonM72 wrote:

I created a bat file to run the program with the hook and everything, and it opened the program without problem, but then the hooker started listing all of my chat logs over and over until it crashed the game itself. Running it again without already having a massive log of chats works fine. So word of warning for everyone: don't run it after having been playing for a long time!


Yeah, I use a batch file to run it as well. And yeah, I haven't found a workaround for that issue yet. What basically happens is that anytime a new chat line comes in, it runs the entire chat history through the function being hooked into. n.n;
Likely if I find a workaround for that issue, I will also have solved the issue of the repeating characters in dialogue.
Member
Kenrid 
3043 cr points
Send Message: Send PM GB Post
43 / M / Portland OR
Offline
Posted 8/19/09
Hey Tasunke,

I been having what you call the 'font cacheing issue' on a couple games other than AiSpace. A character once used, not showing up again. One game is DC II, I used hook from Mastress Alita's site, but still get character dropping issue.

Other posts always talk about the repeating issue, but the font cache issue doesn't seem to get mentioned. Maybe hook is old or there are some other switches to use?

I think I saw a tutorial somewhere on finding hooks, I will try and find. But if you can point one out I'd appreciate it.

Kenrid
IRC Moderator
61598 cr points
Send Message: Send PM GB Post
Offline
Posted 8/19/09
I'd check out the Hongfire AGTH support thread: http://www.hongfire.com/forum/showthread.php?t=36807
There's also a thread on some advanced AGTH tutorials using Ollydbg here: http://www.hongfire.com/forum/showthread.php?p=1455865
Member
94 cr points
Send Message: Send PM GB Post
22 / M / British Columbia,...
Offline
Posted 5/28/10
does this work anymore? because the link at the top gives me a index.html and thats it
First  Prev  1  2  3  Next  Last
You must be logged in to post.