Page 1 of 1

Understanding Networking

Posted: Mon Feb 24, 2025 12:39 am
by rayll
Hi Tony,

I'm using dialogue system with netcode. I'm starting to implement the dialogue system to sync over the network: In the game, there may be instances where the two players talk to each other AND also have isolated conversations with the NPCs.

From my understanding you recommend using dialogue system events methods but passing subtitle to the other client through rpcs (using OnConversationLine) is not allowed?

I'm a little lost and trying to understand what is the ideal way to go about this.

Thanks for any help on this.

Re: Understanding Networking

Posted: Mon Feb 24, 2025 7:52 am
by Tony Li
Hi,

The Dialogue System should always run locally on each client.

For isolated (local client-only) conversations, you don't need to do any networking.

For shared conversations, there are at least two kinds of conversations you could run:

1. If it's a player-to-player conversation, this is probably best done outside of the Dialogue System, perhaps using freeform chat.

2. If it's a conversation between an NPC and multiple players, you can use the Dialogue System for that. One player's client will initiate the conversation. The other players' clients will not start an actual Dialogue System conversation. Instead, you should set up a bit of code and UI that mirrors the conversation from the initiating client to the other participating clients. For example, on the initiating client, you can use OnConversationLine() and OnConversationResponseMenu() to know what content to show on the other clients. The other clients can either show the content in a custom UI of your making, or you can manually open and show the content in the participating client's dialogue UI. In this case, the Dialogue System won't be controlling the dialogue UI. Your code will control it by calling the dialogue UI's Open() method, ShowSubtitle() method, etc.

Re: Understanding Networking

Posted: Fri Feb 28, 2025 2:27 am
by rayll
Thanks much, I will get to implementing this soon.

Re: Understanding Networking

Posted: Fri Feb 28, 2025 7:08 am
by Tony Li
Sounds good. If any questions come up, don't hesitate to ask.