Dialogue For Split Screen Using a Gamepad

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Hello everyone. I just bought this asset and I'm trying to learn some basic things to start with. I am using the Dialogue System Integrated with the Opsive UCC (Third Person Version). I am also using 2 players in a split screen co-op and a Gamepad Controller for both players. Here is my question:

1. So I followed the video tutorial, except I made two Dialogue Managers for my two players. The New Conversation I made is supposed to show up in player 2's side of the split screen, but it doesn't (On Start or On Use). The Action button (The North Face Button, or Y Button) is supposed to trigger the interaction but it doesn't work. I also went to the Opsive site and looked at the integration documentation and saw that I was supposed to add different components, so I did, but still, nothing. So, what am I doing wrong?

I attached some images, too. I don't know if it covers everything that was done, as I honestly can't remember, but I hope it helps someway.
Attachments
Usable.gif
Usable.gif (402.74 KiB) Viewed 1728 times
Selector.gif
Selector.gif (378.47 KiB) Viewed 1728 times
InteractableTarget.gif
InteractableTarget.gif (411.92 KiB) Viewed 1728 times
Abilities.gif
Abilities.gif (378.52 KiB) Viewed 1728 times
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

It sounds like the issue is with Opsive interaction. If you're using Opsive's interaction system, you can remove the player's Selector component and the NPC's Usable component (and possibly its TriggerEvent unless you're using it for something else).

It'll probably work best to break it down piece by piece.

Opsive Interaction
Let's make sure the Opsive part is working by itself before involving the Dialogue System. For the Interact ability that's intended to interact with DialogueSystemTriggerInteractables, set the UI > Ability Message Text and/or Ability Message Icon:

uccInteractTalk.png
uccInteractTalk.png (50.96 KiB) Viewed 1723 times

When you approach the NPC, make sure you see the Ability Message. If not, then the Interact ability isn't detecting the NPC. If it's not detecting the NPC, check the NPC's layer and collider, the Interact ability's Object Detection mode and Angle Threshold, etc.


Before we get into the Dialogue System stuff, I recommend going through at least the Quick Start tutorial, and preferably watch the videos for the Interaction Tutorial and Quest Tutorial.


Dialogue Manager / Dialogue Database
Once basic Opsive interaction is working, we need to address the Dialogue System stuff. There should only be one Dialogue Manager in a scene. You can store both players' info in their corresponding actors. For example, in the screenshot below each player actor has a field (variable) named "Met NPC A" that you can use to keep track of whether each one has met NPC A:

multiplePlayerActors.png
multiplePlayerActors.png (53.75 KiB) Viewed 1723 times

Add a Dialogue Actor component to each player. Set player 1's Actor dropdown to Player1 and player 2's Actor dropdown to Player2 (assuming the same actor as in the example database above).


Dialogue UI
How do you want dialogue UIs to work? A shared UI? A screen-space UI in each player's part of the screen? Overhead bubble UI above the player?

If each player gets its own UI, then you'll want to add an Override Dialogue UI component to the player, and assign a dialogue UI or prefab. We can get into more details about UI interaction when I know a bit more about how you want dialogue UIs to work. Unity's UI Event System is not great with shared input, so it can be a bit of work to set up. But no sense going into the details unless you need it.


Quests
If your game will have quests, will they be shared or individual per player? If they're shared, no problem. The Dialogue System has a single Dialogue Manager that manages its quests.

If each player needs its own separate quest log with different quests, let me know. I'll get you a copy of Quest Machine. It integrates with the Dialogue System, and it was designed to handle multiple questers and other advanced quest features.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Okay, thanks for helping so far! So I tried a few of the things, but they aren't completely working. It isn't showing the Ability Text or the Icon when I approach the NPC. The layer on the NPC is Default (should it be different?) and it also has a sphere collider with a trigger. I changes the Object Detection of the Player to Everything (to test) and Default is one of the Detection Layers, so I assumed this would work. But it doesn't. So I'm missing something. If I change the NPCs conversation to OnStart, it seems to work, but if I change it back to OnUse, no buttons activate the conversation.

With the Dialogue UI, the overhead bubble sounds cool. Would it appear as a talking bubble on whichever character is speaking? ie: if player 1 is talking to npc 1, npc 1's bubble will appear on player 1's screen?

I actually want the Quests to be individual at times depending on the quest, or shared if it requires both players. ie: Sometimes one player can do their own thing, but the main quest would require both players doing separate jobs with a common goal.

I actually have watched the Quick Start video over and over again, but reading it helped a little, too. I deleted the Selector Component from the Players and the Usable Component from the NPC.

So, some progress, but not completely there yet.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,
Lockes_TheThief wrote: Wed Apr 14, 2021 5:23 pmSo I tried a few of the things, but they aren't completely working. It isn't showing the Ability Text or the Icon when I approach the NPC.
Compare your setup to the Dialogue System / Opsive integration example scene. The two NPCs in the example scene (Private Hart and Sergeant Graves) are set up for the Opsive interaction system. Maybe try configuring the Interact ability with a different detection method such as Raycast or CapsuleCast. If you get completely stuck, feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
Lockes_TheThief wrote: Wed Apr 14, 2021 5:23 pmWith the Dialogue UI, the overhead bubble sounds cool. Would it appear as a talking bubble on whichever character is speaking? ie: if player 1 is talking to npc 1, npc 1's bubble will appear on player 1's screen?
Yes. See: How To: Set Up Overhead Conversation Bubble Text. The key is to add a bubble subtitle panel and bubble menu panel as children of each player. Then add a Dialogue Actor component to the player, set the panel number dropdowns to Custom, and assign the bubble panels.
Lockes_TheThief wrote: Wed Apr 14, 2021 5:23 pmI actually want the Quests to be individual at times depending on the quest, or shared if it requires both players. ie: Sometimes one player can do their own thing, but the main quest would require both players doing separate jobs with a common goal.
Please check your PMs. Quest Machine might be a good fit. It's another system to learn, though. (Although the learning curve is simpler than the Dialogue System.)
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Cool, thanks. I'll check it all out when I get the chance and keep you updated!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

I understand that it's quite a lot to get all those moving parts working together -- since you're basically building out the majority of the game's functionality -- so if you have questions or get stuck on anything, please let me know.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Thank you.
So I got some of it working after finding a mistake I made on my own. I realized my Action button was set to keyboard so I set it to gamepad. Also I changed the object detection to trigger, which brought up the "Talk" (but very small)
Talk.gif
Talk.gif (662 KiB) Viewed 1713 times
As you can see, "Talk" is also coming up on both players' screen.

Next I was able to get the bubble to work, sort of...It seems to favor player 1's screen
Hello1.gif
Hello1.gif (682.8 KiB) Viewed 1713 times
Hello2.gif
Hello2.gif (655.95 KiB) Viewed 1713 times
When player 2 is trying to talk, the conversation bubble seems to stay more focused on player 1

Also, I couldn't get the player's themselves to say "goodbye". It is still popping up on the screen like this:
goodbye.gif
goodbye.gif (511.92 KiB) Viewed 1713 times
Even though I gave them bubbles just like the NPC.

There's more, but I think ironing out these issues would be best for now.
Thanks again!
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

Hi,

I haven't set up Opsive UCC split screen myself. I think an example scene is in order. I'll put one together later today and share it here. In the meantime, to address some of your questions, and to ask a few questions before putting together the example:
Lockes_TheThief wrote: Fri Apr 16, 2021 2:06 amSo I got some of it working after finding a mistake I made on my own. I realized my Action button was set to keyboard so I set it to gamepad. Also I changed the object detection to trigger, which brought up the "Talk" (but very small)
The attachment Talk.gif is no longer available
That's entirely Opsive UCC. You can probably adjust the Canvas to make things on it bigger (e.g., add a Canvas Scaler and set its mode to Scale With Screen Size).
Lockes_TheThief wrote: Fri Apr 16, 2021 2:06 amAs you can see, "Talk" is also coming up on both players' screen.
I'll check this out when I set up an example scene and let you know what's going on.
Lockes_TheThief wrote: Fri Apr 16, 2021 2:06 amNext I was able to get the bubble to work, sort of...It seems to favor player 1's screen
The default bubble prefab has a short script named AlwaysFaceCamera that orients the bubble to face whatever camera Unity has designated as the "MainCamera". Since you're in split screen mode, presumably with two cameras, it looks like it's just arbitrarily choosing one of the cameras. We'll probably need to use a modified version of AlwaysFaceCamera.

Should bubbles appear on both sides? Or only the side of the player who's talking with the NPC?
Lockes_TheThief wrote: Fri Apr 16, 2021 2:06 amAlso, I couldn't get the player's themselves to say "goodbye".
You'll need to add a bubble menu prefab, or a separate screen space dialogue UI for each player.

Menu navigation and selection will be another challenge, and it's not specific to the Dialogue System. Unity's UI system wasn't designed for local multiplayer. The UI EventSystem runs as a singleton, meaning only one copy can exist in the scene, and it can only have focus on one UI element at a time.

The way I've handled this in past local multiplayer games is to tie responses to joystick button input instead of a navigable menu:

buttonMenu.png
buttonMenu.png (288.82 KiB) Viewed 1711 times

This way, the player doesn't need to navigate a menu of UI buttons. Instead, they can just press a gamepad button choose a response. Let me know if that will work for your design. If so, I'll set it up in the example scene. It's quite easy to do in the Dialogue System.
Lockes_TheThief
Posts: 41
Joined: Tue Apr 13, 2021 11:46 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Lockes_TheThief »

Ah thank you. I would say I do want bubbles to appear on both screens if the speaking NPC is in view. And the button menu looks good, I would definitely want that, too. And the bubble for the menu dialogue, would that be the section right under the subtitle panel number?

Other than that, if you could make an example project for me to look at, I'd appreciate it. Also, I'm not completely sure where I am supposed to use the Quest Machine Voucher?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue For Split Screen Using a Gamepad

Post by Tony Li »

To use the voucher, go to the Asset Store website. Click on your profile image in the upper right. This will open a dropdown menu. Click Redeem Voucher.


Which Opsive third person asset are you using? UCC? TPC? UTPM? UTPS?

Which input system are you using? Built-in Unity input? Unity's new Input System package? Rewired?

The area to assign the bubble menu panel would be on the Dialogue Actor component below the subtitle panel area.
Post Reply