Complicated Translation

Started by Samwise, Sun 02/12/2007 10:41:24

Previous topic - Next topic

Samwise

Hello,

Nostradamus kindly translated my game, "Boundless Osher", from Hebrew ro English:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32601.0

I'd appreciate if you could contribute from your experience, and help us to form an efficient work method to add all the texts.  Notice that we're facing an ultra-complicated situation, because:

1. Right now there are NO TEXTS in the game at all - only speech.  So what we need to do is to replace the recorded Hebrew speech lines with English text lines.

2. There are about 1,500 sentences in this full-length game, so we really need an elegant function if we want to get it over with.

Also, notice that the translation Nostradamus did is in Excel tablets.

Please help us to bring you this game, as it has a huge success in Israel (30,000 downloads in 2 months alone).

Jonathan

Pumaman

Ok, well how about you start off by telling us how you've implemented the speech in the Hebrew version? Are you using commands like this, but with the VoiceMode set to VoiceOnly?

player.Say("&135 Hello there!");

Or are you using a custom system by using lots of PlaySound commands?

How are you doing it?

Samwise

I haven't used ANY texts (the characters would speak without subtitles, you can only hear them and see them move).

For most of the characters it would go:

character[NISM].Say("1204");

The player character had a unique speech function my co-developer created based on the Say command.  It's called "Emor" and works in a similar way:

character[OSER].Emor("1204");

Pumaman

What does your "Emor" function do? Does the translation have the corresponding numbers for each line of text?

Samwise

For the second question, yes.

For the first one - it's based on the Say command, and goes like this:

function Emor(Character* dmut,  String kovetz) {
int loopy;
loopy=dmut.Loop;
if ((loopy==4) || (loopy==6)) {loopy=0;}
if ((loopy==5) || (loopy==7)) {loopy=3;}
loopy += 8;
dmut.LockView(2);
dmut.Animate(loopy,4,eOnce,eBlock);
loopy -=8;
dmut.Loop=loopy;
dmut.Say("%s",  kovetz);
loopy += 8;
dmut.LockViewAligned(2,  loopy, eAlignCentre);
dmut.Animate(loopy,4,eOnce,eBlock, eBackwards);
loopy -= 8;
dmut.LockViewAligned(2,  loopy, eAlignCentre);
dmut.UnlockView();
}


Pumaman

Have you tried creating a translation source file, and then putting the translated lines in to match up with the "&352"-style lines that already exist?

Samwise

I've created a translation file, but it doesn't solve my problem. Here's why:

Each speech audio-file in the game has a name that is composed of the relevant character's name and the appropriate code.

For example, the script line:
character[NISM].Say("&1204");

Would cause the program to play the audio-file NISM1204.

The problem is that the 4-digit code is NOT UNIQUE for a certain character.

In other words, alongside the file NISM1204 , I also have the files OSER1204, UDDI1204, MZKR1204, HRZL1204 etc., of other characters. These are all different files of different characters saying different text-lines, but share the same code.

When I now try to create a translation file, the program will simply write &1204.
As one of the lines in the translation file.

This will, of course, cause 5 different characters or so, who speak different text in the audio speech-style, to all say the exact same thing in the written-text translation.

I hope I managed to explain the problem...

subspark

Nice game Johnathan!

Hahaha. Just noticed your avatar, CJ. Nice one! Funny that, I sense beer too! German Pint anyone? Or maybe a 'Pure Blonde'. The best Aussie beer about.
\|/
[-] splik! gulp, gulp, gulp!

Pumaman

Quote from: Samwise on Mon 03/12/2007 09:46:48
I've created a translation file, but it doesn't solve my problem. Here's why:
The problem is that the 4-digit code is NOT UNIQUE for a certain character.

In other words, alongside the file NISM1204 , I also have the files OSER1204, UDDI1204, MZKR1204, HRZL1204 etc., of other characters. These are all different files of different characters saying different text-lines, but share the same code.

Hmm yes, that makes sense... I can't see an easy way around this as it stands. Does anyone else have any bright ideas?

subspark

You'd have to do some additional coding but you might be able to read your wavs in subdirectories instead of the speech root!?
Would that filter them out? You'd have to move all NISM wavs into a NISM folder and UDDI into it's respective folder, naturally.

Cheers,
Paul.

Samwise

Thanks for your answers.

My problem is not with the WAV files - they're not important at all. My problem is, that when the program creates a translation source file, it doesn't take into consideration that different characters have speech lines with the same code.

I want to use the program's translation capabilities, but my different sound files - such as NISM1204, OSER1204, UDDI1204, MZKR1204, HRZL1204 in my example - are all "translated" into a single line: &1204

So the translation file treats the text in an "absolute" manner without taking into account the character saying the text.

If possible, the best solution would of course be a translation file which would contain the "text" said (i.e. &1204) alongside its respective character, saying that text.  This type of translation file would contain the complexity of different characters saying what is seemingly "the same thing", script-wise.

However, I thought of a different approach - let me know if this type of solution is possible:

Suppose I took each of my characters, and gave them numbers from 1 to 40 (say I have 40 characters).  Now the files would read:

NISM120401
OSER120402
UDDI120403
MZKR120404
HRZL120405
since I gave these five characters different numbers.

I can add 2 last digits to each of my soundfiles. That would be a pain, but it's worth it.  My 2 questions are:

1. Would AGS be able to work with these 10 character files?

i.e.
character[NISM].Say("1204");

2. The BIG question -
Is there some way to "run" over the entire script, adding 2 last digits to each text line, according to the character saying it?

If this type of solution is doable, I think I would be able to use the program's translation capabilities.

Thanks!

(Sorry about the length...)

Scorpiorus

Quote from: Samwise on Tue 04/12/2007 13:57:18Is there some way to "run" over the entire script, adding 2 last digits to each text line, according to the character saying it?

It is the right approach you want to take. Basically, it is possible to write a specialized program that would read the source code and substitute lines accordingly:

character[NISM].Say("&1204");   --->  character[NISM].Say("&1204<<NISM>>");

There is a Dumping text to file feature in the AGS Editor to easily export the textual data from your game into a text file to be processed later.

Depending on how the translation in Excel is formatted it might be possible to then read and analyze it along with the generated translation source file to create the resulting translation source!

Pumaman

Yeah, some sort of custom perl script or something to run through and pull out all of the speech lines from the game scripts is probably your best bet to do this.

Samwise

OK, that's great.  Would you mind explaining what's a perl script, and how I can pull out all the speech lines?

(Sorry, but I'm still far from knowing all there is to know about AGS...)

Scorpiorus

So an external(separate) script/programme needs to be written by someone, to read through the game's source code to find "&1204"-style lines and replace them with "&1204+character_name" ones depending on the character's script name before "Say(...)". After that the modified source code should be imported back into the game so that a translation source could be generated containing "&1204+character_name"-style lines to indicate who is a speaker of each message. If translated text from the Excel document is structured in such a way that it is possible to identify who speaks which line, then again another programme could be written to automatically substitute Excel document's entries for "&1204+character_name" lines in the translation source.

Of course that person to write a programme should have access to the game's source code to try and make a reliable enough parsing/translating tool.

Pumaman

Yeah, this isn't an AGS feature. You'd need somebody with some scripting/programming knowledge to write a custom tool to do this.

Samwise

Hi,

I'm trying to translate my game from Hebrew into English.

I have successfully created a translation source, containing all the text strings in the game.

I should note that my game is an audio-speech game, so the "Strings" are actually codes to filenames.

Anyway, I've inserted the new English text in accordance with the proper file names.

It works OK most of the time - Hebrew speech is heard, English translation is displayed.

However, there is one problem. My main character has a special speech function. It's called Emor, and it adds transition frames before and after the talk view animation (to make the graphic transition more elegant).

So instead of using:
character[OSER].Say("&2583"); for example

I would write
Emor(cOser, "&2583"); accordingly

This function is only used by the main character, OSER.  All the other characters use the regular "say" command.
So when OSER speaks, you only hear the Hebrew speech - you don't get the English translation.

HOWEVER, the relevant strings (e.g. &2583 in my example) - DO APPEAR in the translation source file.

These strings appear in the file, and now have English texts to correspond them.

Still, English text is not displayed when these strings are called by the Emor function.

Here's the script of the Emor function:

function Emor(Character* dmut, String kovetz) {
int loopy;
loopy=dmut.Loop;
if ((loopy==4) || (loopy==6)) {loopy=0;}
if ((loopy==5) || (loopy==7)) {loopy=3;}
loopy += 8;
dmut.LockView(2);
dmut.Animate(loopy,4,eOnce,eBlock);
loopy -=8;
dmut.Loop=loopy;
dmut.Say("%s", kovetz);
loopy += 8;
dmut.LockViewAligned(2, loopy, eAlignCentre);
dmut.Animate(loopy,4,eOnce,eBlock, eBackwards);
loopy -= 8;
dmut.LockViewAligned(2, loopy, eAlignCentre);
dmut.UnlockView(); }

Any ideas?  I'd really appreciate your help.


Pumaman

This is because you're doing this:

dmut.Say("%s", kovetz);

so it's actually the "%s" that gets passed through the translation engine, rather than the text. Try this instead:

dmut.Say(kovetz);

Samwise

Yes!  It works  :D

Thank you very much, and congradulations for the 3.0, BTW...



SMF spam blocked by CleanTalk