PUN Networked Quests

Announcements, support questions, and discussion for the Dialogue System.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

PUN Networked Quests

Post by nathanj »

Hi Tony,

This is well beyond the scope of Dialogue System, but maybe you could point me in the right direction.

I'm using DS with Opsive's UCC and Behaviour Designer. I have all of my NPCs run off of a Master Client and the NPCs in the regular client scenes are synced from the master client.

So what happens is: Master Client creates the room. When the scene loads all NPCs have a script that checks if they belong to the master client. If they do then they run normally. When subsequent clients join the NPCs check if they belong to the master and when the script returns that they are not on the master client the UCC Locomotion script is disabled and their transform is synced to the corresponding NPC on the Master Client.

So, my question for you is can you think of a way that if a player speaks to an NPC on a non-master client, is there a way to send a message to a Behaviour Tree on the NPC on the master client?

No pressure to respond if this reqiures a complicated response. I completely understand.

Thansk as always,
Nathan
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: PUN Networked Quests

Post by Tony Li »

Hi Nathan,

Yes, using a custom sequencer command or C# method registered as a Lua function.

Let's say you use a sequencer command (e.g., called "BTMessagePUN"). The sequencer command's implementation can check if the NPC is on the master or a local client. If it's local, send a networked message to the corresponding NPC's BT on the master. If the message doesn't need to wait for a response, call Stop() immediately. If it needs to wait for a response, wait for it, and then call Stop(). This way the node can wait until it receives a response from the master.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: PUN Networked Quests

Post by nathanj »

Hi Tony

So this is coming along, I'll post the code when i have it working smoothly.

I'm getting a weird thing at the moment I can't figure out - going back through older builds it seems that this has been persistent, i just never noticed it as I haven't really been using Dialogue System in the project yet. Hoping you might have a silver bullet.

When I trigger a conversation from a client, all other clients have the same conversation triggered. So say client #2 starts a conversation and the same conversation appears on the screen for client #1 (as well as showing up on client#2's screen). I'm starting to think that this is the default manner in which DS functions. If so, can you suggest a way that I get each users DS to operate in an individual way?

Thanks again,
Nathan
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: PUN Networked Quests

Post by Tony Li »

Hi Nathan,

That shouldn't happen. How are you triggering the conversation? Are you triggering it on the client or on the server? Have you set up some kind of UI mirroring?
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: PUN Networked Quests

Post by nathanj »

Hi Tony,

I just converted the Dialogue System UCC demo scene to PUN and I'm getting the same behaviour. This is regular P2P networking. Two players in the same scene. When one player triggers a conversation the same conversation is displayed on both screens.

Image
Again, I know this is not something you support as is, so feel free to defer, I completely understand. But, if you think you might have a solution, I'm all ears. If so, am I able to send you these scenes? You would need the Photon Pun Addon added to the project that had UCC and the Dialogue System integration.

Thanks as always,
Nathan
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: PUN Networked Quests

Post by Tony Li »

Hi Nathan,

Would you please send the scenes to tony (at) pixelcrushers.com? I'll pull them into a Unity project that contains DS, UCC, and the PUN addon.
NEPSChris
Posts: 2
Joined: Tue Jan 12, 2021 12:53 pm

Re: PUN Networked Quests

Post by NEPSChris »

Hi, curious as to what happened with this as would like to use Dialogue stystem on PUN project from Opsive..
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: PUN Networked Quests

Post by Tony Li »

Just trigger it locally on the client. I think the original issue was that the project was set up to trigger it on the server and broadcast it to all the clients.
NEPSChris
Posts: 2
Joined: Tue Jan 12, 2021 12:53 pm

Re: PUN Networked Quests

Post by NEPSChris »

Fantastic, Thank You !
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: PUN Networked Quests

Post by Tony Li »

Glad to help!
Post Reply