Hundreds of Random Conversations?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mokiedokes
Posts: 9
Joined: Wed Feb 23, 2022 11:20 am

Hundreds of Random Conversations?

Post by mokiedokes »

Hello. I'm working on a mobile game, similar to a visual novel, primarily comprised of hundreds of conversations. The screen will be mostly text, with a static image of the speaker. I want the majority of these conversations to be randomly initiated.

This might be a silly question (I'm new at all this!), but would it make more sense to have either:

A. 1 scene with 100+ randomized conversations: the scene would load, one random conversation would be selected and run. There would be several hours before the user could receive another conversation.
or
B. 100+ randomized scenes with 1 conversation each.

I wasn't sure how Dialogue System for Unity stores the data for the conversations and if 1 scene with 100+ conversations available to run would be unwieldly for mobile apps to load/run or not.

Thank you.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hundreds of Random Conversations?

Post by Tony Li »

Hi,

Scenes are more of a headache to manage than conversations, so I'd go with option A (one scene).

If each conversation is completely unique, you'll want to write each one manually. However, if you title them using a consistent naming scene such as Conversation 1, Conversation 2, Conversation 3, etc., then you can start them randomly from code like:

Code: Select all

string title = "Conversation " + Random.Range(1, 100);
DialogueManager.StartConversation(title);
If your conversations are more like templates, you can set some variables beforehand like:

Code: Select all

DialogueLua.SetVariable("Mood", "happy that you're here");
DialogueManager.StartConversation("Generic Greeting Conversation", playerTransform, npcTransform);
where the conversation might have lines like:
  • NPC: "Hi! I'm [var=Conversant]."
  • Player: "Nice to meet you, [var=Conversant]! How are you?"
  • NPC: "I'm feeling [var=Mood]."
mokiedokes
Posts: 9
Joined: Wed Feb 23, 2022 11:20 am

Re: Hundreds of Random Conversations?

Post by mokiedokes »

Yeah, I was leaning toward the 1 scene solution. Each conversation will be completely unique. They would take about 2-4 minutes of playtime to get through. I am going to use numeric naming elements to allow me to randomly access them, like you suggested. Some conversations will be unlocked only upon certain conditions, such as having completed certain previous conversations, or a certain number of previous conversations, etc.

My biggest concern with the 1 scene option is if the game would have to load in all those possible dialogue conversations or not. Would the 1 scene have to load them all in or just pull each one up as they are randomly selected? If loading them all in, is that too much for a mobile game or is that a needless concern?
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hundreds of Random Conversations?

Post by Tony Li »

It's just text, so it's not a concern. A typical single texture for a model is usually about the same size as an entire dialogue database.

Tip: You can use forward slashes in conversation titles to group conversation dropdowns into submenus. If you're only going to be selecting conversations programmatically, it might not be any use. But if you expect to ever have to select a conversation title from a dropdown, you might want to put them in groups of, say, 20. Here's an example that titles them in groups of 10:

Conversations 1-10/1
Conversations 1-10/2
Conversations 1-10/3
Conversations 1-10/4
Conversations 1-10/5
Conversations 1-10/6
Conversations 1-10/7
Conversations 1-10/8
Conversations 1-10/9
Conversations 1-10/10
Conversations 11-20/11
Conversations 11-20/12
Conversations 11-20/13
Conversations 11-20/14
...
mokiedokes
Posts: 9
Joined: Wed Feb 23, 2022 11:20 am

Re: Hundreds of Random Conversations?

Post by mokiedokes »

Lovely. That's exactly what I was wondering.

I will be having various "tiers" of conversations, so your groups tip was very helpful. Thank you for your time and help!
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hundreds of Random Conversations?

Post by Tony Li »

Glad to help!
Post Reply