How to have two Dialogue System Controller running at the same time?

Announcements, support questions, and discussion for the Dialogue System.
Timeberwell
Posts: 7
Joined: Sat Apr 17, 2021 2:17 pm

How to have two Dialogue System Controller running at the same time?

Post by Timeberwell »

Greetings, Tony!

I have searched the forum and couldn't find anything this complicated, so here I am.
I'd like to apologize in advance for a long post.

I have two sets of actors.
The first pair is player and NPC, Player and TestNPC, they use a modified Standard Dialogue UI, and the usual stuff.
The second pair is two NPCs, Hrugor and Kihae, they use a modified Bubble Standard Bark UI to do "bark conversations", since both require vastly different display settings, these two NPCs would override the Dialogue System Controller's settings when they start a conversation.

However, when one pair starts their conversation before another finishes, they would fight for the control of the single Dialogue System Controller, making a huge mess. So I thought that the easiest way to have this all working is to have two Dialogue System Controllers.

Can you show me some pointers? Or am I missing something really obvious?


And if it helps, I have attached photos of my setup.

And here is a more detailed description of my bugs:
One is that:
When I start the Npc-player-conversation and then trigger the npcs-conversation before Npc-player-conversation finishes, the current line of npc-player-conversation would disappear. And then if I choose the option that ends the conversation, one of the npcs, Hrugor (the npc that triggers the npcs-conversation) would disappear.
The log says that "Unregistering transform Hrugor from actor 'Hrugor'."

Second bug is that:
When I start the Npc-player-conversation and finish it, then start the npcs-conversation and also let it finish. Sometimes, the npc-player-conversation would refuse to start, even though there is not condition blocking it, however, the npcs-converstaion works fine.
The console outputs: "Dialogue System: Bark (speaker=TestNPC (UnityEngine.Transform), listener=Player (UnityEngine.Transform)): 'Greetings!' speaker has no bark UI."
It seems like the npc is not overriding the display settings back properly.

The conversations worked flawlessly when I built them individually and didn't try to start the two at the same time. So I love the tool Tony, don't get me wrong, I just want to get this working. And I'm so so sorry for the long post. If you need more info, I will provide.
Attachments
Scene Tree.png
Scene Tree.png (30.59 KiB) Viewed 515 times
Pair 2 NPC 2.png
Pair 2 NPC 2.png (73.66 KiB) Viewed 515 times
Pair 2 NPC 1.png
Pair 2 NPC 1.png (38.5 KiB) Viewed 515 times
Pair 1 Player.png
Pair 1 Player.png (57.45 KiB) Viewed 515 times
Pair 1 NPC.png
Pair 1 NPC.png (76.19 KiB) Viewed 515 times
Dialogue System Controller setup.png
Dialogue System Controller setup.png (76.57 KiB) Viewed 515 times
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Tony Li »

Hi,

The Dialogue Manager/DialogueSystemController works as a singleton. There should only be one in the scene. Set it up to work with the Player and TestNPC conversation.

Add an Override Display Settings component to Hrugor or Kihae. Configure it to use whatever settings you need for their conversation.

If that doesn't do the trick, please let me know what issue(s) are occurring with it.
Timeberwell
Posts: 7
Joined: Sat Apr 17, 2021 2:17 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Timeberwell »

Thanks for the quick reply but I have tried this. In fact, this is also what I have setup currently, as shown in the pictures.

This is the bug I'm encountering.
Say that the NPCs start their conversation and overrides the Dialogue System Controller to do their thing.
Before they finish, the Dialogue System Controller will have the setting overridden by the NPCs.
And if I start a NPC-player-conversation, which the Dialogue System Controller was originally designed for, it would use the NPCs display settings instead.

To counter this, I have also added the Display Settings Override module to the NPC that was supposed to talk to the player.
However, my NPCs would randomly get deleted or the one NPC that's supposed to talk to the player won't start their conversation.

The detail to both bugs I have found are already stated in the original post, along with the console output.
Let me quote myself here.
One is that:
When I start the Npc-player-conversation and then trigger the npcs-conversation before Npc-player-conversation finishes, the current line of npc-player-conversation would disappear. And then if I choose the option that ends the conversation, one of the npcs, Hrugor (the npc that triggers the npcs-conversation) would disappear.
The log says that "Unregistering transform Hrugor from actor 'Hrugor'."

Second bug is that:
When I start the Npc-player-conversation and finish it, then start the npcs-conversation and also let it finish. Sometimes, the npc-player-conversation would refuse to start, even though there is not condition blocking it, however, the npcs-converstaion works fine.
The console outputs: "Dialogue System: Bark (speaker=TestNPC (UnityEngine.Transform), listener=Player (UnityEngine.Transform)): 'Greetings!' speaker has no bark UI."
It seems like the npc is not overriding the display settings back properly.
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Tony Li »

Hi,

Sorry, when you asked about two DialogueSystemControllers running at the same time (not allowed), it confused me.

What do you mean by "my NPCs would randomly get deleted"?

I'm just trying to get all the information to be able to provide as accurate an answer as possible.
Timeberwell
Posts: 7
Joined: Sat Apr 17, 2021 2:17 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Timeberwell »

It's alright, I'm sorry for now showing this clearly.

Here's a video demonstration the intended effects and the bugs:


00:00 Normal Player-NPC conversation, expected behaviour.
00:11 Normal NPCs conversation, expected behaviour.
00:40 "NPC would randomly get deleted", one of the NPCs in NPCs-conversation gets removed when I end Player-NPC conversation, which is totally unrelated.
00:58 NPC stops talking to the player after the settings has been overridden by the other two NPCs. Note that the NPC that stops talk also has a Display Setting Override script attached.
01:30 Current line disappears when another conversation starts.

And I have also attached my conversation setup.
The nodes has only simple scripts such as

Code: Select all

Continue()@1
and

Code: Select all

randomValue == 2
for conditions.

Thanks again, Tony, for sticking with me here.
Attachments
Player-NPC conversation setup.png
Player-NPC conversation setup.png (152.83 KiB) Viewed 507 times
NPCs-Conversation.png
NPCs-Conversation.png (157.71 KiB) Viewed 507 times
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Tony Li »

Thanks for the details. It looks like a bug. I can reproduce it here. I'll work on a fix and try to have it ready by the end of tomorrow.
Timeberwell
Posts: 7
Joined: Sat Apr 17, 2021 2:17 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Timeberwell »

Nice! I'm glad that it's reproducible on your end.
I look forward to seeing all my bugs vanish.
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Tony Li »

I have a fix that passes all of my test cases. It will take a little time to make sure it won't have any impact to existing projects. I'll try to send you a patch to test by tomorrow morning.
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Tony Li »

Hi,

Please try this patch:

DS_SimultaneousConversationOverridePatch_2021-04-20.unitypackage

These changes will be in version 2.2.17 also.
Timeberwell
Posts: 7
Joined: Sat Apr 17, 2021 2:17 pm

Re: How to have two Dialogue System Controller running at the same time?

Post by Timeberwell »

New problem.

The current conversation ends abruptly when the new conversation with UI override starts.
Here's a video demonstrating this.


Are there problems with how my objects are setup? Am I using the right scripts? Everything has remained the same from the previous screenshots.
Post Reply