Help me understand (and solve weird issues)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
yonson
Posts: 3
Joined: Thu Apr 29, 2021 4:58 am

Help me understand (and solve weird issues)

Post by yonson »

Hello Tony,

I'm Jonas and our company has acquired the Dialogue system and I've watched all of the video tutorials, looked into the documentation and tinkered around with it for 2 days. The system seems very robust, has tons of features and overall it's a well developed tools.

However, I feel like the user manual leaves out a lot (most likely due to the overall complexity of the system) and some main concepts remain unanswered. So I'm hoping you can clear some things up for me.

The prototype I'm working on is a 3D adventure, and for now I am looking to print the dialogue subtitles into speech bubbles (in the future the subtitle will be printed elsewhere, facial animation and voiceovers will be added - Entrytags and sequence commands seem really great for this). I need to make conversations happen among NPCs in the background as well as other conversations with the player and change the flow based on player decisions.

1. First issue I encountered happened when I tried to have two NPCs say their lines at the same time. So far, through the method of scientific poking, I have determined, that I can't have two characters speak their lines from the same conversation set (correct me here if I'm wrong), because a conversation is a linear sequence of phrases spoken between one or more characters and only one line can be displayed at a time. So I must treat the lines of the secondary character as a separate conversation.

Imagine the following hypothetical scenario: Player and A are having a conversation X (two adults having a serious talk), meanwhile in the background B and C are having a secondary separate conversation Y (imagine BC are 2 obnoxious children). BC conversation becomes annoying and distracting so an option is presented to the Player to interrupt the children, the player can choose to continue their current conversation or to snap at B and C. In response to this I want B and C to react differently but at the same time. What would you suggest as the best approach to set up such a scenario using your system?

So far I am thinking of these options: A) use sequence area to send a message to end conversation Y and separately trigger apologetic barks for B and C, then continue conversation X. This might not be appropriate if I want B and/or C to talk back and present new options for the player. This would now be treated as a new back and forth conversation between player and BC. so... B) End conversation Y, end conversation X part 1, Start conversation Player-BC (yet B and C still cannot talk at the same time, over each other). If I'm looking to change the dialogue of A based on the result of conversation Player-BC then I would change a variable and start conversation X part 2.

I'm sure there could be other ways to solve this, but what I'm really asking about is the intended scope of the "conversation" object. Intuitively I want to treat this entire scenario as a single conversation between 4 actors, yet I don't see a way how I can have two separate branches of the conversation running at the same time.

2. I've gotten really quite confused about the concept of "Dialogue UI". Not even sure how start asking the question... Maybe it will help if you could explain this strange behaviour:

I am using the Bubble Subtitle Example 2 from the extras page.
Screenshot_1.png
Screenshot_1.png (25.5 KiB) Viewed 352 times
I enabled Allow Simultaneous Conversations in the Dialogue System Controller, renamed the player object to NPC1 and duplicated it (renaming the duplicate as NPC2). Then in the Bubble Subtitle Example database i created two conversations that are copies of the original New Conversation 2 and changed the actor and conversant to NPC1 and NPC2 respectively. Both characters have Dialogue Actor and Dialogue System Trigger components set to NPC1 and NPC2 respectively.
Screenshot_2.png
Screenshot_2.png (170.82 KiB) Viewed 352 times
When I run this setup both speech bubbles appear OnStart as intended, but one of them blinks and disappears for an unknown reason... See here:
This is where I become confused and start looking for info in the manual and the forums. I stumble upon a forum post where it is advised to use the OverrideDialogueUI component on one of the actors. And it works. Both bubbles are displayed now.
Screenshot_3.png
Screenshot_3.png (165.56 KiB) Viewed 352 times
But why? :?: The system is instantiating separate Bubble UI Subtitle panels above character heads already so why do I need a Basic Standard Dialogue UI (two of them at that) at all?

I see how when working on games of a different type (JRPG or a visual novel) all of the UI elements in the Standard Dialogue UI prefab would be useful, but in our case this seems excessive, we don't need the UI (in the classic sense at all), so I'm looking for a way to just isolate the functionality that will be useful for our game. Do you have any advice on how to do it? Assigning an OverrideDialogueUI component to each character and creating an instance of the UI prefab for each just in case it so happens that two conversations happen at the same time in the game seems too wasteful, especially, if these UI prefabs are not even used at all... Maybe there's a way to bypass the default UI, so that the conversations lines are only sent to the speech bubbles? :?:

3.
How does the continue button work? It seems to be unrelated to the conversation that the bubble instance is showing. How can I set it up so that the continue button affects only the conversation it is related to?

4. Somewhere in the documentation or the forum I've read your example on reusing dialogue for shopkeepers. This is great and very practical! I wanted to try this out:
and it seems to work great as long as the same dialogue is not triggered at the same time. When trying this out, I expected the dialogue on the duplicate to start from the beginning without having an effect on the dialogue of the original. Seems I was too naive to expect that :D , but let's say i would want to have multiple characters (maybe a crowd of cultists) repeating the same words with some delay, how would you go about setting that up? Or is such behaviour beyond the scope of this plugin?

I am sorry for this wall of text, but I am just trying to understand this system as well as I can because we are aiming to base our game around it. I can see how much work has been put into it, yet the tutorials and the documentation hasn't helped to understand it to the extent I require. Really looking forward to your reply.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help me understand (and solve weird issues)

Post by Tony Li »

Hi Jonas,
yonson wrote: Thu Apr 29, 2021 10:55 am1. First issue I encountered happened when I tried to have two NPCs say their lines at the same time. So far, through the method of scientific poking, I have determined, that I can't have two characters speak their lines from the same conversation set (correct me here if I'm wrong), because a conversation is a linear sequence of phrases spoken between one or more characters and only one line can be displayed at a time. So I must treat the lines of the secondary character as a separate conversation.
That's correct. There are two ways you can handle the player snapping at B & C:

1. Stop the BC conversation. Then play barks simultaneously on B & C.

2. Or provide your own implementation of IDialogueUI, or subclasses of StandardUISubtitlePanel, that play B & C's subtitles simultaneously. Technically one will play after the other, but you can set up the conversation so that B's dialogue entry shows the subtitle and then immediately progresses to C's dialogue entry without hiding B's subtitle.

Most devs use the StandardDialogueUI implementation of IDialogueUI. It's pretty good at handling most UI needs, and you can always subclass individual pieces such as StandardUISubtitlePanel to customize behavior further. But you always have the option to provide your own implementation(s) of IDialogueUI, and the Dialogue System will work happily with them.

Also, the Extras page has a patch for version 2.2.16 that contains some updates in the pending version 2.2.17 that may help your dialogue UI handling.

If B & C want to talk back to the player, you can add them to Player & A's conversation. If you have any questions about doing this, please let me know. Tip: If the conversation is currently showing a player response menu and you change the conditions that determine which responses to offer, call DialogueManager.UpdateResponses() to re-evaluate the conditions and update the menu.
yonson wrote: Thu Apr 29, 2021 10:55 am2. I've gotten really quite confused about the concept of "Dialogue UI".
Each active conversation should use its own dialogue UI. OverrideDialogueUI is a good way to set it up. If you're using bubble subtitle panels, just assign the Basic Standard Dialogue UI to OverrideDialogueUI. It doesn't use any extra textures, so it's very lightweight.

When a character has a DialogueActor component that uses a custom (bubble) subtitle panel, the dialogue UI diverts that character's content to the custom panel. So a dialogue UI is required even if the conversation doesn't actually show any of its UI elements.
Why each conversation uses its own dialogue UI, if you're interested.
Each active conversation uses a Model-View-Controller (MVC) architecture. The ConversationModel handles the logic (condition evaluation, variable updates, etc.). The ConversationController mediates between the ConversationModel and ConversationView. The ConversationView handles UX. The ConversationView manages two main pieces: a sequencer (camerawork, voiceover, etc.) and a dialogue UI. The ConversationView sends commands to the dialogue UI such as "show response menu" and receives responses such as "player clicked this response menu button". Since the ConversationView listens for responses from the dialogue UI, it should be the sole owner of the dialogue UI. Otherwise, if a dialogue UI were being used by two conversations, each ConversationView may not know who the response is intended for.
The blink issue in your video may be fixed by the patch on the Extras page, or it may be an animation issue. Please try the patch first.
yonson wrote: Thu Apr 29, 2021 10:55 am3. How does the continue button work? It seems to be unrelated to the conversation that the bubble instance is showing. How can I set it up so that the continue button affects only the conversation it is related to?
If the patch and using separate dialogue UIs doesn't address the issue, please let me know.
yonson wrote: Thu Apr 29, 2021 10:55 am4. Somewhere in the documentation or the forum I've read your example on reusing dialogue for shopkeepers. This is great and very practical! I wanted to try this out: [video]
and it seems to work great as long as the same dialogue is not triggered at the same time.
I'm not quite sure what's going on there. But the basic setup should be:
  • To each NPC (let's say shopkeeper for now), add a Dialogue Actor component, and set the Actor dropdown to a unique actor (e.g., Shopkeeper Adam, Shopkeeper Bob, etc.).
  • Assign the NPC GameObject itself to the Dialogue System Trigger's Conversation Conversant. (See Character GameObject Assignments for more details.)
This should work in all cases except the [var=Conversant] tag, which is commonly used in Dialogue Text, such as:
  • Dialogue Text: "Hi! I'm [var=Conversant]. Welcome to my shop!"
When a conversation starts, it sets the Lua variable Variable["Conversant"] to the name of the conversation's conversant. When showing Dialogue Text, the [var=Conversant] tag will be replaced with the value of this variable. However, since the Variable[] table is global, Variable["Conversant"] will be set to the conversant in the most recently started conversation. You're fine if you only use [var=Conversant] at the start of the conversation. But if you allow simultaneous conversations and want to use it later in the conversation (possibly after another conversation may have started and overwritten the variable value), you'll have to use something different than [var=Conversant]. It's easy to resolve, but it's something to keep in mind.
yonson
Posts: 3
Joined: Thu Apr 29, 2021 4:58 am

Re: Help me understand (and solve weird issues)

Post by yonson »

Hello Tony,

thank you very much for your reply and thank you for elaborating on the reason for each conversation to have it's own UI.

I have installed the patch, and the blinking issue remains while the characters don't have Override Dialogue UI attached (but overriding solves it).

On the other hand, I'm sad to let you know that the continue button functionality is unchanged, still works as previously

in the video the two characters have Dialogue Actor components set to different characters, OverrideDialogueUI components and Dialogue System Triggers set to OnStart that start separate conversations with Conversation Actor fields set to corresponding GameObjects. As you can see, the buttons only affect one conversation, and the other remains still. I am using the Example Bubble Standart UI Subtitle prefabs from the example scene. The buttons are set to StandartUIContinueButtonFastForward.OnFastForward(). Does it not find the UI for that conversation?

Now to the shopkeeper example - I've set up the characters to have Dialogue Actor components with unique actors and Dialogue System Trigger components with characters themselves assigned into the Dialogue System Trigger's Conversation Actor (as I've assigned the lines to the actor) to OnUse with the same conversation - "New Conversation 2". Now it updates correctly and the same conversation runs on two characters independently (I've set the continue button to "Never" in the Dialogue Manager as there's still the issue with the button). It would be fine, but a new inconsistent behaviour that appears even for two DIFFERENT conversations running simultaneously:


As you can see in the video, as the second conversation is started the bubble for the first conversation blinks when the
second conversation advances, this however is not consistent as sometimes the the bubble blinks only on the change from the first line to the second, and sometimes for every change. Moreover I am now getting the error that you can see at the end of the video. It sometimes happens when one of the conversations ends, and sometimes I can trigger a conversation multiple times before this happens. Take a look here:


Looking forwards to your response.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Help me understand (and solve weird issues)

Post by Tony Li »

Hi Jonas,

I think it might be faster if you could send a reproduction project to tony (at) pixelcrushers.com. If you can do that, please include:
  • The steps I should follow to reproduce the issues,
  • The correct result you expect to see, and
  • The incorrect result you're currently seeing.
yonson
Posts: 3
Joined: Thu Apr 29, 2021 4:58 am

Re: Help me understand (and solve weird issues)

Post by yonson »

Reproduction project sent.
Post Reply