Jibble

Author Topic: MODULE: TotalLipSync v0.5  (Read 10183 times)

bx83

  • Get ‘er doooooone
Re: MODULE: TotalLipSync v0.5
« Reply #20 on: 07 Jun 2017, 03:16 »
Exactly how does the EXE reference it's own install dir? Should I make it '/sync/' or 'C:/moci/Compile/Windows/sync' or...?
It seems the directory where the TSV files are stored is hard-coded in, so it will only work if the game is in '/programme files (x86)/moci/sync', and nothing else -- which makes it hard for testing.
A bigger, betterer game.

bx83

  • Get ‘er doooooone
Re: MODULE: TotalLipSync v0.5
« Reply #21 on: 07 Jun 2017, 03:17 »
Ah, okay.
A bigger, betterer game.

Re: MODULE: TotalLipSync v0.5
« Reply #22 on: 07 Jun 2017, 03:21 »
Exactly how does the EXE reference it's own install dir? Should I make it '/sync/' or 'C:/moci/Compile/Windows/sync' or...?

In script you reference install dir using $INSTALLDIR$ tag like
Code: Adventure Game Studio
  1. File.Open("$INSTALLDIR$/sync/data.dat");
  2.  

There is also "old style" without such tag:
Code: Adventure Game Studio
  1. File.Open("sync/data.dat");
  2.  
But that will work only to read files, not write.

Also, AGS does not allow to use absolute paths (like C:/...), it simply won't open anything even if such file exists. This is done for security reasons.

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #23 on: 07 Jun 2017, 07:43 »
I notice '$INSTALLDIR$/sync' - is this "C:\Program Files (x86)\Adventure Game Studio 3.4.0\sync" or "my installed game\sync" dir, or "my currently un-installed un-compiled game directory\sync", or...?
Exactly how does the EXE reference it's own install dir?

:-\

AFAIK when you run the game from the Editor (with F5), game does not look into Compiled at all, it gets files and subfolders that are located right in the project's root folder.

Well, I just tested it, and if you have a "sync" folder inside "Compiled", it will be read when you run the game from the editor and reference files in "$INSTALLDIR$/sync". (But you are correct that the directory is not automatically copied into "Compiled/Windows/sync"; you have to do that yourself when you're ready to distribute the game.)

Re: MODULE: TotalLipSync v0.5
« Reply #24 on: 07 Jun 2017, 15:05 »
AFAIK when you run the game from the Editor (with F5), game does not look into Compiled at all, it gets files and subfolders that are located right in the project's root folder.

Well, I just tested it, and if you have a "sync" folder inside "Compiled", it will be read when you run the game from the editor and reference files in "$INSTALLDIR$/sync". (But you are correct that the directory is not automatically copied into "Compiled/Windows/sync"; you have to do that yourself when you're ready to distribute the game.)

Oh right... probably I had a moment of amnesia; it was just couple of months ago what I was working around that, because in 3.4.1 Compiled folder is now Compiled/Data.

So, yes, when debugging from Editor the rules are a bit complicated, the "installdir" is actually "made" of three folders:
- working directory, which is project root folder: for example game takes font files from there
- Compiled folder: I think this was made to take speech.vox from there, and maybe something else, like translation files.
- AudioCache folder: it takes audio files from there.

Basically it looks into project root first, and if it did not find needed files, it also checks either Compiled or AudioCache, depending on what kind of material it is looking for.

Why it was made so: I think to increase compilation speeds when testing, because it does not have to gather/package all those files every time.
« Last Edit: 07 Jun 2017, 15:09 by Crimson Wizard »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #25 on: 07 Jun 2017, 15:22 »
For the record, I think this is a good thing, because it means you can keep all your "to be distributed" files in "Compiled/", and you don't need separate copies for each target platform (with the potential nightmare of keeping all the copies in sync).

(I might split this whole discussion off as a separate thread, since it doesn't really have much to do with this module specifically.)

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #26 on: 13 Jan 2018, 12:50 »
I wrote a little script to help people who use Rhubarb to do lip-syncing.

Rhubarb does the lip-sync tracking automatically by analyzing the audio, but you can also supply the actual text of the dialog to help guide it, improving the results. Using something like this batch file, you can then create the lip-sync tracking for the entire game automatically:

Code: Bash
  1. for %%F in (clips/*.wav) do (
  2.     rhubarb.exe clips/%%~nxF -d guide/%%~nF.txt > sync/%%~nF.tsv
  3. )

There hasn't been a convenient way to create these guide files from AGS, however. This script helps to automate the task.

It works with the voice acting HTML scripts generated by the Speech Center plugin. Once you've created the voice acting scripts, place them in a subfolder (e.g. /VoiceScripts) inside your compiled game folder. Place a call to this function in your game, and run it to extract the guide files, like so:

Code: Adventure Game Studio
  1.   ExtractVoiceScriptLines("$INSTALLDIR$/VoiceScripts", "$APPDATADIR$/guide");

(The output directory must be in $APPDATADIR$ or an existing subfolder of it. Where %APPDATADIR% is pointing can be set in winsetup.exe under Advanced.)

Here's the script (yeah, I know it's ugly, but it seems to work OK):
Code: Adventure Game Studio
  1. #define SCRIPT_TOKEN_LINE_NUMBER "<span class=\"lineNumber\">"
  2. #define SCRIPT_TOKEN_TEXT_START ":</b> "
  3. #define SCRIPT_TOKEN_TEXT_END "</span>"
  4.  
  5. static String ExtractVoiceScriptLines(String sourceDirectory, String targetDirectory)
  6. {
  7.   int i=0;
  8.   String tokenLineNumber = String.Format("%s", SCRIPT_TOKEN_LINE_NUMBER);
  9.   String tokenTextStart = SCRIPT_TOKEN_TEXT_START;
  10.   String tokenTextEnd = SCRIPT_TOKEN_TEXT_END;
  11.   while(i < Game.CharacterCount)
  12.   {
  13.     String prefix = character[i].GetSpeechPrefix();
  14.     String scriptPath = String.Format("%s/char%s.html", sourceDirectory, prefix);
  15.     if(File.Exists(scriptPath))
  16.     {
  17.       File* scriptFile = File.Open(scriptPath, eFileRead);
  18.       String lineNumberPrefix = prefix;
  19.       while(!scriptFile.EOF)
  20.       {
  21.         String scriptLine = scriptFile.ReadRawLineBack();
  22.         int startLineNumberTag = scriptLine.IndexOf(tokenLineNumber);
  23.         if(startLineNumberTag != -1)
  24.         {
  25.           int startLineNumber = scriptLine.IndexOf(lineNumberPrefix);
  26.           int endLineNumber = scriptLine.IndexOf("]");
  27.           if(startLineNumber > 0 && endLineNumber > 0 && endLineNumber > startLineNumber + lineNumberPrefix.Length)
  28.           {
  29.             String strLineNumber = scriptLine.Substring(startLineNumber+lineNumberPrefix.Length, endLineNumber - startLineNumber - lineNumberPrefix.Length);
  30.             int lineNumber = strLineNumber.AsInt;
  31.             //Display("Writing %s%d", prefix, lineNumber);
  32.             if(lineNumber>0)
  33.             {
  34.               String message = "";
  35.               String dialogLine = scriptFile.ReadRawLineBack();
  36.               int startTextTag = dialogLine.IndexOf(tokenTextStart);
  37.               int endTextTag = dialogLine.IndexOf(tokenTextEnd);
  38.               if(startTextTag > 0)
  39.               {
  40.                 while(endTextTag == -1 && !scriptFile.EOF)
  41.                 {
  42.                   dialogLine = dialogLine.AppendChar(' ');
  43.                  dialogLine = dialogLine.Append(scriptFile.ReadRawLineBack());
  44.                   endTextTag = dialogLine.IndexOf(tokenTextEnd);
  45.                 }
  46.                 int textLength = endTextTag - startTextTag - tokenTextStart.Length;
  47.                 if(startTextTag > 0 && endTextTag > 0 && textLength >= 0)
  48.                   message = dialogLine.Substring(startTextTag+tokenTextStart.Length, textLength);
  49.                
  50.                 String linePath = String.Format("%s/%s%d.txt", targetDirectory, prefix, lineNumber);
  51.                 //Display("Writing line \"%s\" to file %s", message, linePath);
  52.                 File* lineFile = File.Open(linePath, eFileWrite);
  53.                 if(lineFile != null)
  54.                 {
  55.                   //Display("Writing line \"%s\" to file %s", message, linePath);
  56.                   lineFile.WriteRawLine(message);
  57.                   lineFile.Close();
  58.                 }
  59.                 else
  60.                   Display("Couldn't write line \"%s\" to file %s", message, linePath);
  61.               }
  62.             }
  63.           }
  64.         }
  65.       } // while(!scriptFile.EOF)
  66.       scriptFile.Close();
  67.     }
  68.     i++;
  69.   }
  70. }
« Last Edit: 13 Jan 2018, 12:54 by Snarky »

bx83

  • Get ‘er doooooone
Re: MODULE: TotalLipSync v0.5
« Reply #27 on: 20 Jun 2018, 05:02 »
Hi Snarky,

The speech animation delay seems to be too slow for TotalLipSync - no matter what I set a characters to (1, 5, -25, 30), it doesn't make a difference.
What Speech Animation Delay does TLS use?
ATM I'm using 120fps ('GameSpeed'), so I can use a AnimationDelay=1, and not -7 as it was before (on 40fps). I was told using negatives for AnimationSpeed, WalkSpeed, etc. was bad and 'unknowns'.

Code: [Select]
cJulius.ChangeView(1); //julius
cJulius.SpeechView=2; //julius speech
cJulius.AnimationSpeed=1; //normal animation speed
cJulius.SetWalkSpeed(7, 6); //normal walk speed

...though I still use some negatives - for an old man:
Code: [Select]
cJulius.AnimationSpeed=0; //old animation speed
cJulius.SetWalkSpeed(1, 1); //old walk speed

No negatives have caused problems, but still.
I have 30frames walking for all characters.

So aaaaaanyway, how does TLS do it's timing?
How does Rhubarb do it's timing,
considering it's file is in tenths of a second:

Code: [Select]
0.00 A
0.50 F
0.83 C
0.90 G
0.97 A
1.05 B
1.53 A
1.61 C
1.80 B
1.87 X
2.38 X
A bigger, betterer game.

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #28 on: 20 Jun 2018, 07:04 »
Hi Snarky,

The speech animation delay seems to be too slow for TotalLipSync - no matter what I set a characrs to (1, 5, -25, 30), it doesn't make a difference.
What Speech Animation Delay does TLS use?

TotalLipSync doesn't use animation delay: it reads the timing data from the sync files and displays the corresponding frame.

Problems could potentially occur if the computer can't run the game at the game speed you've set. The animation might then fall behind the speech. So...

Quote
ATM I'm using 120fps ('GameSpeed')

Don't.
Film runs at 24 fps. A lot of cheaper animation runs at 12 fps, literally one tenth of the framerate you have set: you're showing ten frames for each one of theirs! AGS by default runs at 40 fps, which is plenty for a point-and-click game, and twitch-based games like FPSs aim for 60 fps, which is also how fast most monitors refresh. Which is all to say that 120 fps is an insane framerate for an adventure game.

More significantly: with a high-res game like yours, many (most) computers won't be able to keep up, and this could affect lip sync (and other sync situations).

Quote
so I can use a AnimationDelay=1, and not -7 as it was before (on 40fps). I was told using negatives for AnimationSpeed, WalkSpeed, etc. was bad and 'unknowns'.

No negatives have caused problems, but still.
I have 30frames walking for all characters.

Well, the "cure" is worse than the disease in this case. A better question might be, do you really need 30-frame walkcycles? If you cut it to 15 (every second frame) or even 10 (every third), do you lose noticeable quality?

Quote
How does Rhubarb do it's timing,[/b] considering it's file is in tenths of a second:

Code: [Select]
0.00 A
0.50 F
0.83 C
0.90 G
0.97 A
1.05 B
1.53 A
1.61 C
1.80 B
1.87 X
2.38 X

Those are hundredths.

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #29 on: 20 Jun 2018, 08:45 »
Two more things...

ATM I'm using 120fps ('GameSpeed'), so I can use a AnimationDelay=1, and not -7 as it was before (on 40fps). I was told using negatives for AnimationSpeed, WalkSpeed, etc. was bad and 'unknowns'.

Code: [Select]
cJulius.ChangeView(1); //julius
cJulius.SpeechView=2; //julius speech
cJulius.AnimationSpeed=1; //normal animation speed
cJulius.SetWalkSpeed(7, 6); //normal walk speed

...though I still use some negatives - for an old man:
Code: [Select]
cJulius.AnimationSpeed=0; //old animation speed
cJulius.SetWalkSpeed(1, 1); //old walk speed

A. 0 is not a negative number.
B. At 120 fps, a 30-frame walkcycle will run 4 times a second. Since a cycle includes two footsteps, that's 8 footsteps/second. That seems faster than necessary. (Edit: By comparison, the world's fastest runners sprint at a max pace of about 4.4 – 4.8 steps/second.)
« Last Edit: 21 Jun 2018, 12:16 by Snarky »

bx83

  • Get ‘er doooooone
Re: MODULE: TotalLipSync v0.5
« Reply #30 on: 31 Jul 2018, 03:26 »
My Inventory window icons dissappear when the character is talking, even if it's just .Say
Is this an AGS thing or a TotalLipSync thing?
A bigger, betterer game.

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #31 on: 31 Jul 2018, 07:51 »
Just a quick guess, but have a look at 'General Settings' in the AGS Editor. In the category 'Visual', check the setting "When player interface is disabled, GUIs should" and make sure it's set to 'Display normally'.
That could be at least one cause of the icons disappearing.

bx83

  • Get ‘er doooooone
Re: MODULE: TotalLipSync v0.5
« Reply #32 on: 31 Jul 2018, 07:56 »
That's the one, thankyou :D
A bigger, betterer game.

Olleh19

  • I'm an AGS n00b, please don't kill me
Re: MODULE: TotalLipSync v0.5
« Reply #33 on: 14 Oct 2020, 16:29 »
This is SO great, thank you very much Snarky!

I have a question tho. Some of the lipsync might not turn out "so great" (Swedish, probably the reason why..). Is there a possibiity to combine the automatic lipsync with manual adjustments with either Pamela or Papa?

I've tried manual with Papagaoya, and Pamela inside the "lip sync manager", before i've got the rhubarb running, and i think i prefered editing inside the lipsync manager with Pamela.

Is that possible?

I've read that some of the programs share the same phonomemes(probably spelled wrong), perhaps they could be used in conjunction for optimal result.

Funny fact. I get a grey tooth on my 16 Color "babe", i have no idea what is going on. It's not in the sprites, i've checked several times. Even went in and redrawn the colors and hit save, replaced the source. Deleted the sprites inserted them again in the project, etc.
Still on one sprite image i get a gray pixel. Any idea what could be the cause?  (laugh)

Thanks for a great module!


Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #34 on: 14 Oct 2020, 17:29 »
This is SO great, thank you very much Snarky!

Glad it's of use!

I have a question tho. Some of the lipsync might not turn out "so great" (Swedish, probably the reason why..). Is there a possibiity to combine the automatic lipsync with manual adjustments with either Pamela or Papa?

I've tried manual with Papagaoya, and Pamela inside the "lip sync manager", before i've got the rhubarb running, and i think i prefered editing inside the lipsync manager with Pamela.

Is that possible?

I don't really have an overview of the lip sync editors that exist and what formats they can read. It wouldn't be terribly hard to write a tool to convert the files from one format to another so you could edit them—and perhaps a tool like that already exist—but this module does not do it.

Funny fact. I get a grey tooth on my 16 Color "babe", i have no idea what is going on. It's not in the sprites, i've checked several times. Even went in and redrawn the colors and hit save, replaced the source. Deleted the sprites inserted them again in the project, etc.
Still on one sprite image i get a gray pixel. Any idea what could be the cause?  (laugh)

Try to just display that sprite on an object, to see whether it's anything to do with the module or something else. Is the game actually 16-color?

Olleh19

  • I'm an AGS n00b, please don't kill me
Re: MODULE: TotalLipSync v0.5
« Reply #35 on: 14 Oct 2020, 18:51 »
This is SO great, thank you very much Snarky!

Glad it's of use!

I have a question tho. Some of the lipsync might not turn out "so great" (Swedish, probably the reason why..). Is there a possibiity to combine the automatic lipsync with manual adjustments with either Pamela or Papa?

I've tried manual with Papagaoya, and Pamela inside the "lip sync manager", before i've got the rhubarb running, and i think i prefered editing inside the lipsync manager with Pamela.

Is that possible?

I don't really have an overview of the lip sync editors that exist and what formats they can read. It wouldn't be terribly hard to write a tool to convert the files from one format to another so you could edit them—and perhaps a tool like that already exist—but this module does not do it.

Funny fact. I get a grey tooth on my 16 Color "babe", i have no idea what is going on. It's not in the sprites, i've checked several times. Even went in and redrawn the colors and hit save, replaced the source. Deleted the sprites inserted them again in the project, etc.
Still on one sprite image i get a gray pixel. Any idea what could be the cause?  (laugh)

Try to just display that sprite on an object, to see whether it's anything to do with the module or something else. Is the game actually 16-color?

Damn, maybe you are onto something. I don't think i've set it to 16colors. It's just the Ega Palette that's used for the art. I will try some experiments. It's no biggie anyway, game should be "re-done" in unlimited colours, but i thought it was a bit funny.
The reason i wrote ofc is i believe it might actually come from the module, but i have to experiment more. You gave some ideas to try, I should try take away licsync manager aswell, see if that does anything, could just as easily be that.



Edit: False alarm it was nothing. Let's laugh together. I'll show you guys how dumb i really am. >:( 8-0 :-[

Looks nice on the surface, right? WRONG


https://imgur.com/qCe9bbx



Look again zoomed in:





https://imgur.com/F2ORCuy


« Last Edit: 14 Oct 2020, 20:29 by Olleh19 »

Olleh19

  • I'm an AGS n00b, please don't kill me
Re: MODULE: TotalLipSync v0.5
« Reply #36 on: 01 Nov 2020, 00:22 »
Hey Snarky!


First i want to share an important Accident/Lesson i've got today, and second a question. I think you should add this to the first post, btw (Unless i'm blind and don't see it, already being there). I didn't realise the importance of wave length.
Today i've made a little birthday cutscene "game", with Silly Voices, so ofc i used your Total lipsync. Everything went fine until i ran into a wall completely. I Used Display "test",
and thought "Yeah, the code is running, but why is the text stuck on the screen forever after the speech is done?!" (at least that's how i feelt it). I went out for a bluecup of tea,

and came back to my computer and to my surprise the code had actually taken up on where i wanted it to go instantly. So......That got me thinking. Maybe something is off with the sync files? So i edited them. I saw in the end there were huge gaps. Between B and X, timing wise. Changed that to more "normal values", didn't solve it. It turns out that all voiceclips needs to be cut VERY precise in the endings or else, no matter what your syncfile info says. The biggest impact seems to be the sound source's ending length. So even if you have a little bit of silence in the end. (In my case wasn't that little, 5seconds).  (laugh)

The Silence get's picked up as "sound", when it ain't supposed to be. So make sure to cut your wave/ogg files, so you don't end up with text on the screen for 5seconds longer then expected!
Always cut your wave/ogg files at the endings,. I use Audacity for that, great freeware. Lesson: Don't leave space left in the sound source, unless you intentionally want the text to stay longer on screen ofc.



Question: I have played around with the lipsync and the results are pretty ok! But i'm still thinking i want to see if it's possible to do it differently i am doing pixelart only. I don't need a "specific mouth shape for S or T or A or B". All i want is movement, and stops. I want to be able to run the actual animation all the way thru that is frame 2 to 8 on all single letters, apart from one letter (that is never used in the game text ofc) That should represent the closed mouth shape. So forexample.  letter A is typed = Edit: Images 2,3,4,5,6,7,8 get's played in a row. If letter is B same thing.
I'm using Rhubarb and the standard settings for it. You might wonder why i want to do this? Well to avoid the stops between words ofc. The silences are almost always spot on. It's the rest that ain't. Rarely at least!

I am guessing i should be able to modify it to be able to not have the animation "stop" at certain points by playing all frames on every letter, and just keep going and then "reset" itself once a new letter is executed (If possible). Or it all becomes a giant glitch fest, you would know! (laugh)

the letter ü or öäå perhaps would be fiting for the silent mouth shape. Or else it would be a disaster, ofc!
 
Is it do able? Please let me know!





« Last Edit: 01 Nov 2020, 00:40 by Olleh19 »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #37 on: 01 Nov 2020, 07:52 »
First i want to share an important Accident/Lesson i've got today, and second a question. I think you should add this to the first post, btw (Unless i'm blind and don't see it, already being there). I didn't realise the importance of wave length.

It turns out that all voiceclips needs to be cut VERY precise in the endings or else, no matter what your syncfile info says.

This doesn't really have anything to do with TotalLipSync. If you use voice speech in AGS, the character is considered to be speaking for as long as the audio clip lasts.

Question: I have played around with the lipsync and the results are pretty ok! But i'm still thinking i want to see if it's possible to do it differently i am doing pixelart only. I don't need a "specific mouth shape for S or T or A or B". All i want is movement, and stops. I want to be able to run the actual animation all the way thru that is frame 2 to 8 on all single letters, apart from one letter (that is never used in the game text ofc) That should represent the closed mouth shape. So forexample.  letter A is typed = Edit: Images 2,3,4,5,6,7,8 get's played in a row. If letter is B same thing.

I don't really understand what you're asking for (you say that Rhubarb gets the silences right, so why do you need a hack for the closed mouth shape?), but in any case it doesn't sound like what this module is for.

The module merely plays animations defined in external sync-files. The result will depend on the quality of those sync files; it is not something the module can control, and it has nothing to do with the text you put in the dialog. If you type one line in the game text, use a different voice clip, and a sync file for another different clip, it will of course play the animation from the sync file (though it will be cut off when the voice clip ends), and it won't match either what is written or what is said: it's only by keeping all three consistent that things stay in sync, but the module has no way to know that.

If you want the animation to be based on the written dialog text, you can use AGS's built-in text-based lipsync.
« Last Edit: 01 Nov 2020, 07:59 by Snarky »

Olleh19

  • I'm an AGS n00b, please don't kill me
Re: MODULE: TotalLipSync v0.5
« Reply #38 on: 01 Nov 2020, 12:47 »
Quote
This doesn't really have anything to do with TotalLipSync. If you use voice speech in AGS, the character is considered to be speaking for as long as the audio clip lasts.

Ahh, ok. My bad, thanks for informing! It's still useful to know for those who try to sync up and get's confused why it might stay on screen for longer then expected. (nod)


Quote
I don't really understand what you're asking for (you say that Rhubarb gets the silences right, so why do you need a hack for the closed mouth shape?), but in any case it doesn't sound like what this module is for.

The module merely plays animations defined in external sync-files. The result will depend on the quality of those sync files; it is not something the module can control, and it has nothing to do with the text you put in the dialog. If you type one line in the game text, use a different voice clip, and a sync file for another different clip, it will of course play the animation from the sync file (though it will be cut off when the voice clip ends), and it won't match either what is written or what is said: it's only by keeping all three consistent that things stay in sync, but the module has no way to know that.

If you want the animation to be based on the written dialog text, you can use AGS's built-in text-based lipsync.


I've tried that alternative before and yes the animation plays correct, but the timings for when the speech is in a short breath or pauses for a millisecond, are not present, and the animation just keep on playing no matter if there is sound or not in the voiceclip. Unless i failed to see how to change that from happening. But again if that logic is "true" then how come it wasn't with the Lipsync? When you clearly said the Lipsync does not have anything to do with how long the text stays on screen. So no matter if there is silence in the audio file or not, the animation will just keep playing. If my basic logic isn't completely faulthy.  (laugh) Which is not the intended behaviour for what i'm trying to achieve. I'm trying to have just the timing for the X's  Intact (closed mouth shape). I will try a new example. Thank you very much for your patience so far, Snarky!

Edit: Here's an example when i did this "theory" in Sony Vegas. I exported 10 frame talk (or however many frames it was i dont remember). IN a row, and went in manually and just found the X's (if talking lipsync, but i didn't use lipsync, but you get the idea, hopefully). and at places where there should be closed mouth shape, i inserted that manually, but the lipsync could do that for me! The rest is just constant animation in a row flow with abrupt mouthclosings here and there.

https://www.instagram.com/p/CFcCD8fpnYi/

Example. OK here is a example of what i mean editing a Syncfile manually. I guess the textfiles would only need to be the right amount of letters, and not "the actual letters". Because then this clearly would not work.

Code: Adventure Game Studio
  1. 0.00    X
  2. 0.67    B            //<--you replace these letters so they all come in the correct "animation row" as exported from Photoshop (Until the X shows up, and not have them "spaced out" acording to their timing numbers (as it is here, 00.67 - 00.93 a "gap").
  3. 0.93    A           //Perhaps i could edit these manually, and save a template where all letters come in a row (if it's not possible any other way). So that would mean some work, i wouldn't mind. I'm very concerned about it looking "better". If possible.  
  4.                       //these come in a row like in the actual Photoshop talk animation. That's why the X or "the closed mouthshapes" timing of the synctool would be very benificial.
  5.                      // to create the illusion of sync, even tho like you as in your confused state of mind have noticed. There barely is [u]no syncing[/u], apart from the X's. Are you following my idea now? If not here comes the "fixed" version (in theory that is).
  6.  
  7.                      
  8.                       //Replacement idea of previous example (I have no idea, if this would work in theory, please let me now). Forexample say i wanted a 5 second Delay Speech animation)
  9.                      //Going in manually and editing in notepad the syncfile TSV this way. Now i want the photoshop animation to come in a ROW.
  10.  
  11. 0.00 X
  12. 0.05 A - Frame 1   //Photoshop frame 1!
  13. 0.10 B - Frame 2  //Photoshop frame 2,
  14. 0.15 C - Frame 3  //Photoshop frame 3, etc etc.
  15. 0.20 D - Frame 4    //so now let's pretend a silence comes here acording to the sync tool.
  16. 0.25 X -                  // Closed Mouth. and Restart the photoshop pattern..Or perhaps pickup where the last frame ended? Wouldn't matter, aslong as there is mouth movement (in my mind!).
  17. 0.30 - Frame 5
  18. 0.35 - Frame 6
  19. 0.40 - Frame 7
  20. 0.45 - Frame 8
  21. 0.50 - Frame 9
  22. 0.55 - Frame 10
  23.                            //And this pattern keeps on going until the next X Shows up with it's correct timing (as you can see all other timings are replaced.
  24.  
  25.                           //Is it possible to do theese kind of edits manually in notepad and just replace the syncfiles??
  26.  
  27.  
  28.  

This (if working) Would look 10times better for what i'm doing at least. But this is also a question of taste.
Would it look realistic? Probably not. Is pixelart realistic 3d faces that needs perfect sync? No. But it still would be nice to have a illusion of sync (a little sync with the X's, and no sync with the rest and just a constant flow of animation).


Edit 3: Clearly it works to edit it in Notepad which is cool. However i do get an script error when i try to add more rows to accomplish the task of having movement all the time until the next X comes.


 

« Last Edit: 01 Nov 2020, 15:43 by Olleh19 »

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: MODULE: TotalLipSync v0.5
« Reply #39 on: 01 Nov 2020, 18:11 »
Instagram links are (usually) only viewable by people with Instagram accounts. Please use a public image host, like Imgur, ImgBB, PostImage, or FreeImage.

But again if that logic is "true" then how come it wasn't with the Lipsync? When you clearly said the Lipsync does not have anything to do with how long the text stays on screen.

I said the TotalLipSync module bases its animation on the sync files, not the dialog text. But what we're talking about here is the built-in AGS lipsync support. AGS has two different kinds of lipsync:

1. Text-based lipsync is based on the dialog text and ignores the voice audio (you don't even need to have any voice clips).
2. Voice-based lipsync is based on the voice audio (actually, the sync-files created for the voice audio clips) and ignores the dialog text.

Currently, TotalLipSync offers an improved version of voice-based lipsync only (though I have an in-development version that also supports text-based sync). But the main point is that you have to choose: there's no feasible way to combine both methods.

Now, if I understand your issue correctly, it's that you don't actually want the animation to lip-sync when speaking: you just want it to play a generic "talking" animation loop. The only thing you want the "lip sync" functionality for is to determine when the characters are actually speaking, and when they are silent.

I have two suggestions:

1. Don't have significant silences in your speech files. Divide the lines whenever there is a long pause, and trim the audio files to contain near-constant dialog. Forget about lipsync and just use regular AGS talk animations.
2. As you have tried to do, edit the sync-files to only distinguish silent periods (frame X in Rhubarb terms) from speaking periods, and then fill the speaking periods with a standard sequence of frames. Since this is tedious work, it would be best to automate it unless the number of lines to sync is very small.

If you are getting errors with the edited sync files, you have made some error in the editing. Without seeing the files or the error message there is no way to tell what that might be, but one possibility is that your text-editing app uses the wrong format for the line endings (one way to test this would be to take a sync file that is confirmed to work, and delete and reinsert a line ending and see if it breaks).