Multiplayer dialogue system with Photon

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Wojciech Grodzicki
Posts: 2
Joined: Thu Jun 06, 2024 10:33 am

Multiplayer dialogue system with Photon

Post by Wojciech Grodzicki »

Hi!

I need to create a relatively simple dialogue system for a multiplayer game. I'm using Photon PUN2 for multiplayer and I would like to make it work with the Dialogue System for Unity.

The basic idea is that the game will involve 3 players, any of whom should be able to start a conversation with an NPC. The others should be able to join, provided they are close enough. Each player will see the same dialogue lines spoken by the NPC, but they will be presented with different, unique response options. They will talk to each other via a voice chat to decide which option to choose. The final response used in the conversation will be the one chosen by the player who clicks on any of their responses first. So all players will basically act as a single actor, but split into 3 parts.

Since this is only a prototype for now, there are no complex quests and I don't need to store different info for each player in the database. I just want them to share a synchronized conversation and split the available responses among the players. How should I approach this from the point of view of the Dialogue System for Unity and Photon?

Best,
Wojciech
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiplayer dialogue system with Photon

Post by Tony Li »

Hi Wojciech,

There are two ways you could approach this:

1. Run the conversation on one player's client, and "mirror" it to the other clients. This is similar to what I recently described in Multiplayer Synced conversations except instead of making the response menu non-interactable you can make it interactable and send the click result back to the client that started the conversation. You'll probably want to make a custom subclass of StandardUIMenuPanel to override the menu panel's functionality to do this.

2. Or start the conversation separately on each client. Again override the StandardUIMenuPanel to send the response back to all clients in order to keep them in sync.
Wojciech Grodzicki
Posts: 2
Joined: Thu Jun 06, 2024 10:33 am

Re: Multiplayer dialogue system with Photon

Post by Wojciech Grodzicki »

Thank you for such a quick response! These sound like good starting points. I'll reach out for more help in case I get stuck.
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: Multiplayer dialogue system with Photon

Post by Tony Li »

Glad to help!
Post Reply