JRPG Setup Help and Overall Best Practices

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
RetroVertigo
Posts: 55
Joined: Fri Apr 16, 2021 4:32 pm

JRPG Setup Help and Overall Best Practices

Post by RetroVertigo »

So, I have been messing around with this asset for a few days, and trying out some examples via the site, and I am struggling to get the dialog system where I want it, and I think it is due to too many options in front of me. So, I was hoping that with this post I might get some insight on how I should proceed.

I am trying to get an overall simple system in place, really a standard JRPG in 3d space (Octopath traveler-esque), but what I have gotten to run so far isn't working that well.

My setup:
I went off the NPC Bubble speech Package on the site, and setup my NPCs to use Dialog Actor with the bubble standard UI subtitle Panel.

Image

I have two lines of dialog both from NPC and nothing needed from PC. So, a basic run up to NPC, press interact, they say something, then interaction ends.

My outcome:
I run up to the NPC, they say the first line via a bubble speech above their head, then I press the button for next and nothing happens. My textbox is also in a bad position on the player within the world space.

Image

So, should I be using a different approach for this? I also plan to have SOME options for the dialog, but not always. Meaning, some dialog might have a yes or no option for the player, but it won't always be the case, so is this approach wrong for this usecase? Is there a way I need to go about UI modification for the UI to work within the 3d space?

Also, I wanted to get some input on dialog Databases. Should I have 1 database for the whole game? 1 per "town"? will the databases take up a lot of space or performance if used?

I appreciate any help or assistance on this I can get.

Thanks
RetroVertigo
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG Setup Help and Overall Best Practices

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!
RetroVertigo wrote: Sun Apr 18, 2021 2:11 pm I run up to the NPC, they say the first line via a bubble speech above their head, then I press the button for next and nothing happens.
I'll assume that you've set both lines to be spoken by the NPC, so they'll both be gray like this (unless you've changed the NPC's node color):

2npcLines.png
2npcLines.png (6.61 KiB) Viewed 676 times

By default, the conversation will show the first line for a duration based on the text length. Then it will automatically progress to the second line.

Have you set the Dialogue Manager GameObject's Display Settings > Subtitle Settings > Continue Button dropdown to Always? If Continue Button is set to Always, it will not automatically progress. It will wait for a continue button click. If you'd like some instructions for this, let me know.
RetroVertigo wrote: Sun Apr 18, 2021 2:11 pmMy textbox is also in a bad position on the player within the world space.
There are two ways to adjust it:

1. If you've added an instance of the bubble prefab to your NPC, you can manually move it up, or adjust it however you need.

2. If you've assigned the prefab itself to the NPC's Dialogue Actor > Dialogue UI Settings > Custom Subtitle Panel, you can specify the offset in Custom Subtitle Panel Offset. In the screenshot below, I assigned the prefab, and I set it to be offset 1 unit higher than the NPC itself:

customSubtitlePanelOffset.png
customSubtitlePanelOffset.png (35.83 KiB) Viewed 676 times
RetroVertigo wrote: Sun Apr 18, 2021 2:11 pmSo, should I be using a different approach for this? I also plan to have SOME options for the dialog, but not always. Meaning, some dialog might have a yes or no option for the player, but it won't always be the case, so is this approach wrong for this usecase? Is there a way I need to go about UI modification for the UI to work within the 3d space?
You're using the right approach. If you don't want the bubble to be obscured by things such as the player that are closer to the camera:

1. Change the bubble prefab and its children to the "UI" layer.

2. Add a child GameObject to your Camera GameObject. Make sure its local position and rotation are (0,0,0) so it's in the exact same position as the Camera GameObject. Add a Camera component to it, set the Culling Mask to only UI, and set the Depth to a higher value than the main Camera's Depth. Set the main Camera's Culling Mask to everything except UI.

If you want the player's response menu to be in 3D space also, add a Dialogue Actor to the player. Assign the bubble menu panel prefab (or an instance that's a child of the player), and set Use Menu Panel For: to Me And Responses To Me:

bubbleMenuPanel.png
bubbleMenuPanel.png (37.84 KiB) Viewed 676 times
RetroVertigo wrote: Sun Apr 18, 2021 2:11 pmAlso, I wanted to get some input on dialog Databases. Should I have 1 database for the whole game? 1 per "town"? will the databases take up a lot of space or performance if used?
The average dialogue database, with all towns, characters, quests, etc., typically takes up the same space as a single texture image. This is because it's all text, and text is small.

It's much simpler to use 1 database. But multiple databases are supported, too. Here's info and tips:
Working With Multiple Databases
RetroVertigo
Posts: 55
Joined: Fri Apr 16, 2021 4:32 pm

Re: JRPG Setup Help and Overall Best Practices

Post by RetroVertigo »

Tony
I can't thank you enough. I am working through this stuff so I might have more questions but your answers are really thorough and I REALLY appreciate it. I am going to keep cracking away at this and see if I can use the asset to it's fullest. Also, wanted to let you know I am leaving a great rating, which I think is earned purely on the support here alone, but the full suite of this product is really something. You built a great asset. thanks!

On your one question:
Have you set the Dialogue Manager GameObject's Display Settings > Subtitle Settings > Continue Button dropdown to Always? If Continue Button is set to Always, it will not automatically progress. It will wait for a continue button click. If you'd like some instructions for this, let me know.
Yes, it is set to Always, and I have played around a little bit with the input buttons (I am planning to use all gamepads for the game) but I am hesitant on this as I am using the ReWired asset, so is there an easy way to call the operations via C# within my scripts? I would like to put my player in the "interact" state when conversation initializes, and then pull them back out once completed, and if I can call the dialog to fire off with the NPC when pressing my designated interact button, then it should flow smoothly. And I am working through the Rewire asset as well to use it across the board, multiple gamepads, multiple consoles, etc. so I am trying to keep it all in sync. Hope that makes sense.
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: JRPG Setup Help and Overall Best Practices

Post by Tony Li »

Hi,

Thank you very much for the review!

To use Rewired with the Dialogue System:
  • Import the package Plugins ► Pixel Crushers ► Common ► Third Party Support ► Rewired Support. (info)
  • Add an Input Device Manager Rewired component to the Dialogue Manager GameObject. (Leave the original Input Device Manager on the Dialogue Manager, too.)
  • Inspect the Input Device Manager component. By default, the Back Button is set to "Cancel" and the Submit Button is set to "Submit". You can either clear these fields, or define corresponding actions in your Rewired Input Manager. Feel free to change them to UICancel and UISubmit if you've already defined those for use with the Unity UI Rewired Standalone Input Module.

Starting Conversations
You can use your own interaction system, or you can use the Selector or Proximity Selector provided as a convenience in the Dialogue System. From your screenshot, I'm guessing you may want to use Proximity Selector. If you do, set the Proximity Selector's Use Button to the name of your "interact" Rewired action.

If you want to use your own interaction system, you can manually call the DialogueSystemTrigger's OnUse() method (pass the conversation actor's transform) or use DialogueManager.StartConversation() to completely bypass the Dialogue System Trigger, too.


Start/End Conversation Hooks
To run your own code or UnityEvents when conversations start and end, you can:
  • Add a Dialogue System Events component to the Dialogue Manager or either conversation participant. This exposes several UnityEvents. If the component is on the Dialogue Manager, the events will run for all conversations. If it's on a participant, the events will only run when that participant GameObject is involved in the conversation. (See: Character GameObject Assignments)
  • Or hook into the C# events or script messages in your own scripts.
It's common, for example, to use Dialogue System Events (or script messages) to disable player movement controls during conversations.


Continue Button
If you want the player to press the Submit / UISubmit button to advance the conversation:
  • Add a continue button to the bubble subtitle panel.
  • If you don't want it to be visible, you can make remove the child Text object and set the Image's alpha color to zero. To prevent it from impacting the bubble size, add a Layout Element and tick Ignore Layout.
  • Configure the button's OnClick() event to call the StandardUISubtitlePanel component's OnContinue() method.
  • Inspect the Dialogue Manager's Input Device Manager component and tick Always Auto Focus. This will keep focus on the continue button so the Submit input can click it.
  • Assign it to the StandardUISubtitlePanel component's Continue Button field

Other misc. tips:
  • You can add a typewriter effect to the Subtitle Text if you want.
  • If you want to switch to TextMesh Pro, see here: TextMesh Pro Support.
  • If you want fancy text animation and don't mind spending a few more dollars, take a look at the Text Animator integration. Text Animator is 50% off right now in the Asset Store's Spring Sale.
Post Reply