Question How to create natural alternating dialogues between player and female character

Messages
102
Reactions
11
Points
18
I was trying create dialogues between the female character in the scene and the player. The female will speak from head audio source (with lipsyc pluggin added) and player will speak from another audio source. The dialog will be started with a trigger button

But I have trouble realizing this though "play next" options. I want the female speak each of her sentences after the player (manually added audio source) finishes speaking, but what is happening is that two people speak simultaneously and separately with their sentences in the dialogue... They don't alternateo_Oo_O

Example: For the dialogue:

M: how are you?
F: I am good.
M: Go for a drink?
F: I wish I could.

I always get male speaking
M: how are you?
M: Go for a drink?

while at the same time female speaking
F: I am good.
F: I wish I could.
 
One possible way is to use the logic "female head audio plays next clip if make audio source is not playing " and vice versa. Maybe this is realizable through the plugin "logic bricks" but I don't know how to do it exactly...
 
Upvote 0
In this case, since you want "linear" conversations, I think Timeline might be a good option. You create a single triggers track, use "real time" mode so slow framerates don't break the expected rythm, and trigger the audio on both models. You can also simply use an AnimationPattern to do that, since you just want to do triggers (but I think it only supports game time). In both cases you can create multiple conversations and trigger the animation pattern / Timeline animation whenever you want to start a series of sentences.

Or, just make two big audio clips with synchronized pauses :)
 
Upvote 0
In this case, since you want "linear" conversations, I think Timeline might be a good option. You create a single triggers track, use "real time" mode so slow framerates don't break the expected rythm, and trigger the audio on both models. You can also simply use an AnimationPattern to do that, since you just want to do triggers (but I think it only supports game time). In both cases you can create multiple conversations and trigger the animation pattern / Timeline animation whenever you want to start a series of sentences.

Or, just make two big audio clips with synchronized pauses :)
Thanks!just curious, is game time different from real time? That is truly mind blowing for me...
 
Upvote 0
Yeah, in Unity time will "slow down" so the game can run the expected amount of physics updates between each render frames, to avoid physics doing crazy stuff. Usually, that's what you want, and you won't notice it unless you have very low framerates. But it will desync audio... for short clips that's fine, but if you have longer clips, using real-time (or "clock time") will keep things more in sync.
 
Upvote 0
An alternative approach might of course be using LogicBricks StateMachine or SequenceMachine bricks.

Here is an example scene that does multiple-choice dialog using the StateMachine brick. Its using SpeechBubbles, but you could easily replace that with recorded audio. You can use a EventAudioQueueEmpty brick to detect once the audio finished playing and send a "TriggerSync" signal to the StateMachine. If you don't want any branching dialog, just plain one thing after the other, using the (new) SequenceMachine is the better choice.

This example scene is also explained in a bit more detail in the StateMachine Advanced tutorial:

With LogicBricks you can also smoothly handle transitions to other subscenes, hiding the scene load with a nice fade to black:
 
Upvote 0
Aah I didn't know about SequenceMachine @MacGruber :) Also there's tons of other approaches, I think some people made plugins for conversations, other made systems on top of existing plugins (see spacedog scenes)... but if you just want to sequence audio, anything that can run triggers sequentially (animation pattern, logic bricks or timeline, I'm sure there are others from e.g. jayjaywon) will do. Often you'll end up using more than one plugin to achieve exactly what you're looking for.
 
Upvote 0
Back
Top Bottom