Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by lcn_mc »

In my project, I have the ability for the player to hit a key to enable autoplay. (When a specific key is pressed, a Message (via Send Message) is sent to the Dialogue Manager Game Object to call the ToggleAutoPlay method on or off.)

When doing some testing today (as part of trying to solve a different bug I ran into), I noticed that certain steps in my conversations were seemingly being skipped while autoplay was active. After doing more digging, I found that the steps aren't being skipped as much as they are simply occurring in a single frame.

As an example, think of a conversation that has three steps (or nodes, if you were looking at it in the Conversation Editor in Unity), where the characters John and The Narrator are the actor/conversant:
  1. John says "Hello", which is displayed as the normal typewriter text.
  2. The Narrator says "John whistles.", which is displayed as normal typewriter text. Simultaneously, a whistling SFX is played as a sound effect through a Sequencer Command.
  3. John says "I just whistled. Did you hear it?", which is displayed as normal typewriter text.

In the above, if autoplay was on, the player experience would be:
  • The player sees the 'John: "Hello"' step.
  • The player sees the 'John: "I just whistled. Did you hear it?' step while hearing the whistle SFX at the same time, despite never seeing the 'The Narrator: "John whistles." text.
I did an experiment with a twelve-step conversation, where each step tried different combinations of Sequencer Commands (or the absence thereof) to see which steps would be skipped and which would be correctly displayed. Here were my findings:
  • If there was nothing in the Sequencer Command field, the typewriter text for the step would display correctly.
  • If there was a typical AnimatorPlay command (like AnimatorPlay(Narrator_Normal_Idle, speakerportrait); required AnimatorPlay(Narrator_Normal_Idle, speakerportrait)@{{end}};), the typewriter text for the step would display correctly, while all other Sequencer Commands in the step would also complete as expected.
  • If there was any other type of Sequencer Command that resolves instantly (such as FSMEvent(), SetActive(), etc), the step would occur in one frame and no typewriter text would be shown. All of the Sequencer Commands would still occur successfully, to be clear. (As in the 'John whistles' example above.)
  • If there was a Sequencer Command that involved a time-based element (such as MoveTo()), the typewriter text would appear as expected.
So, it seems like there's something related to which Sequencer Commands can be present in a conversation step for the autoplay functionality to either resolve that step normally (and show typewriter text), or resolve that step in 1 frame (and bypass showing any typewriter text).;

In my unique case, the fix will be to ensure that all conversation steps have an AnimatorPlay Sequencer Command (most do, but I had a generic 'Narrator' character that didn't have any attached animations), but other people could be in a situation where this apparent bug occurs more commonly.

Figured I'd call it out here for both Tony's awareness, and for anyone else who might be using autoplay and wondering why some dialogue steps seem to be disappearing.
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by Tony Li »

Hi,

Subtitles will stay onscreen for the duration of their dialogue entry's Sequence. If the Sequence ends immediately, as with the Audio() or AnimatorPlay() commands, the subtitle text will end immediately. However, if you use AudioWait() or AnimatorPlayWait(), the subtitle text will end when those commands end.

You can find more details in: How To: Control the Duration of Subtitle Text
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Re: Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by lcn_mc »

Tony,

Thanks for clarifying. That's what I was assuming, but the subtitles appearing normally when the Sequence field was empty part is what was confusing me.

I assume the absence of any Sequence means 'Don't end immediately and wait for subtitles to finish?'
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by Tony Li »

No, when the Sequence field is empty, it plays the Default Sequence configured on the Dialogue Manager GameObject in Display Settings > Camera & Cutscene Settings. The Default Sequence on your Dialogue Manager is probably set to the initial value of Delay({{end}}).

You can also include the Default Sequence in your dialogue entry's Sequence by using the {{default}} keyword:

Code: Select all

Audio(beep);
{{default}}
lcn_mc
Posts: 57
Joined: Wed Jun 29, 2022 1:56 pm

Re: Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by lcn_mc »

Tony,

Ah, that clarifies. Yes, I just checked and my Default Sequence is indeed the default 'Delay ({{end}})' one.

Ok, this answers my question and puts a bow on the issue I was describing in the initial post. Thanks, as always. :)
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: Possible Autoplay Bug: Conversation Steps Skipped During Autoplay

Post by Tony Li »

Glad to help!
Post Reply