Multiple simultaneous conversations of the same type

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
stephenscottday
Posts: 3
Joined: Tue Nov 22, 2022 8:20 pm

Multiple simultaneous conversations of the same type

Post by stephenscottday »

Image
THE GOAL SIMPLIFIED:
To have a room full of NPCs, all having conversations (one-on-one conversations), multiple of which can be having the same conversation, but because of generated character data the path of the conversation turns out different for each. So imagine if there was only one conversation: a series of questions about the characters favorite color, music, book, etc. The answer would be different for each, but they're all having that same conversation. You may even imagine a super primitive version of this in which the initial moment the conversations start, half of the room simultaneously says "So what's your favorite color?" but then the reply from the other half is varied "Blue" "Red" "Yellow".

Image

ADDITIONAL DETAILS:
These characters are generated at runtime. There would be multiple conversations other than "favorite things", so something like "what did you do today?" and "tell me about your family" might be other conversations that could be had-- still imagine that several NPCs are having all these same conversations simultaneously.

WHAT I HAVE SO FAR:
I've managed to setup the "bubble template standard UI subtitle panel" just fine, shockingly straightforward. So I can see two NPCs having a conversation.

WHAT I'M STUCK ON:
But as soon as I duplicate those NPCs, I realize the conversation can only be had by the first set of NPCs, and not by the second set.

Image

Is this possible? Also it's important to note that I'm a PlayMaker dev. I have some basic C# skills and may be able to craft a custom action if needed, but am hoping this is achievable with the stock actions shipped with DialogSystem.

Anyone who took their time to read and consider this, I appreciate it very much. Thank you!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple simultaneous conversations of the same type

Post by Tony Li »

Hi,

Tick the Dialogue Manager GameObject's Other Settings > Allow Simultaneous Conversations checkbox.

In your PlayMaker Start Conversation action (or in the Dialogue System Trigger component if that's what you're using), assign the participant GameObjects to the Conversation Actor and Conversation Conversant fields. (See Character GameObject Assignments for an explanation of how this works.)

In your dialogue database, create two general-purpose actors -- for example named "Interviewer" and "Interviewee". In the When you write your conversation, assign these actors to the conversation's properties (Menu > Conversation Properties) and the individual nodes. In the screenshot below, I selected Menu > Show > All Actor Names to make it clear who's speaking:

colorConv.png
colorConv.png (37.91 KiB) Viewed 438 times

Then say your room has four NPCs: A, B, C, and D. If you want A to be the interviewer and B to be the interviewee, assign them as the Actor and Conversant:

startConv.png
startConv.png (15.28 KiB) Viewed 438 times

And if you want C and D to be the interviewer and interviewee, respectively, in a second simultaneous conversation, assign them as the Actor and Conversant. Here's an example using a Dialogue System Trigger:

startConv2.png
startConv2.png (32.89 KiB) Viewed 438 times
stephenscottday
Posts: 3
Joined: Tue Nov 22, 2022 8:20 pm

Re: Multiple simultaneous conversations of the same type

Post by stephenscottday »

Tony Li wrote: Tue Nov 22, 2022 10:36 pm Hi,
startConv2.png
Wow, the one thing I was missing was to just set the Actor and Conversant fields in the actual StartConversation action. That's exactly what I needed to make this work. Thank you!

The next step I'm trying to get to is letting the player participate in the same conversation, and I'm assuming it has something to do with setting the IsPlayer value to true at runtime--- or am I wrong? I've gone through some posts on the forum about setting the IsPlayer bool at runtime, but before I spend some time trying to get a custom PlayMaker action for that I was hoping to get some confirmation as to whether or not I'm on the right track. (I'm assuming it would take a custom action, unless I'm misunderstanding the SetLuaField action??)

So if I had this room full of NPCs, all having their own conversations with each other, but there was one lone NPC the player could walk up to and have that same conversation, how might I do that? Again characters are built at runtime, and player is no exception (since the player is initially an NPC but all AI gets turned off in exchange for input/controls).

I'm imagining that everytime an NPC starts the conversation with another NPC, it ensures that IsPlayer bool is false for both by setting it to false. But if it engages in conversation with the Player, then it sets one actor's IsPlayer bool to true. Is this close?

Again, much appreciated for the speedy and thorough response on that last problem!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple simultaneous conversations of the same type

Post by Tony Li »

Hi,

If the conversation doesn't use any response menus (i.e., player has to choose a response from multiple options), you can just run the conversation with the player as the conversation actor.

However, if the conversation will present a response menu when the player is involved, there's a bit of a snag. By design, if the conversation links only to two or more dialogue entries assigned to a player actor (that is, an actor whose Is Player checkbox is ticked), the Dialogue System will show a player response menu. This happens even if you've assigned an NPC to the Dialogue System Trigger's Conversation Actor field. This is because the decision to show a response menu is based solely on the actor that's assigned to the dialogue entries in the dialogue database, not the Dialogue System Trigger. (Note: If the Dialogue Manager GameObject's Input Settings > Always Force Response Menu is ticked, it will also show a menu if one entry, not two or more, links to a player actor.)

One solution would be to make two "Opinions" conversations -- "Opinions NPC" for NPC-to-NPC conversations and "Opinions Player" for NPC-to-Player conversations. This may not be the hassle that it seems. You may actually want to have different conditions on your NPC-to-NPC conversation than on your Player-to-NPC conversation. For example, in the NPC-to-NPC conversation you could use the RandomizeNextEntry() command to make the NPC choose Blue, Red, or Green randomly. Whereas in the NPC-to-Player conversation you wouldn't use that command and would instead let the player choose from a menu.

Another option would be to create a conversation that branches based on the current actor assigned to the Dialogue System Trigger's Conversation Actor. You can check the Dialogue System variable "Actor" or "ActorIndex". The "Actor" variable will be set to the Conversation Actor's Display Name, while the "ActorIndex" variable will be set to the Name (with spaces and punctuation replaced by "_".) For example:

opinions.png
opinions.png (75.24 KiB) Viewed 400 times

I used Groups to visually distinguish the two branches and group nodes with Conditions.
stephenscottday
Posts: 3
Joined: Tue Nov 22, 2022 8:20 pm

Re: Multiple simultaneous conversations of the same type

Post by stephenscottday »

Tony Li wrote: Wed Nov 23, 2022 8:53 am One solution would be to make two "Opinions" conversations -- "Opinions NPC" for NPC-to-NPC conversations and "Opinions Player" for NPC-to-Player conversations. This may not be the hassle that it seems. You may actually want to have different conditions on your NPC-to-NPC conversation than on your Player-to-NPC conversation. For example, in the NPC-to-NPC conversation you could use the RandomizeNextEntry() command to make the NPC choose Blue, Red, or Green randomly. Whereas in the NPC-to-Player conversation you wouldn't use that command and would instead let the player choose from a menu.

Another option would be to create a conversation that branches based on the current actor assigned to the Dialogue System Trigger's Conversation Actor. You can check the Dialogue System variable "Actor" or "ActorIndex". The "Actor" variable will be set to the Conversation Actor's Display Name, while the "ActorIndex" variable will be set to the Name (with spaces and punctuation replaced by "_".) For example:
Tony, this has clarified my problem very much, and both of these solutions seem very reasonable. I think I'm gonna try duplicating the conversation and just StartConversation's based on a string which can look for some suffix in the string denoting either player or NPC.

The thoroughness of your answers with accompanying visuals is very very very very much appreciated. Thank you!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiple simultaneous conversations of the same type

Post by Tony Li »

Glad to help!
Post Reply