Intro to Dialogue Tree 4: Customization Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi my name is Zach and in this tutorial we're going to take a closer look at some of the various ways you can extend dialog tree to customize the look and feel of dialogue in your project if you don't already know dialog tree is a free plugin available on the unreal Marketplace that offers an easy to use system for creating and editing in game dialogue I'm going to assume that you've already looked over the quick start guide as well as the tutorials on the dialogue editor and queries and events those cover much more of the basic operation of the plugin this one is going to serve is a survey of the various extension points the plugin includes to allow you to tailor it to your needs before we get down into the weeds I want to take a moment to review a few of the major objects we'll be talking about let's start with the dialogue controller this is an actor that serves as a kind of bridge between your dialogues and The Game World the dialogue controller manages the display of dialogue and how speeches and options are presented it also serves as a general interface for dialog interactivity including the starting and stopping of conversations for for example when a speaker component attempts to start dialogue what it's actually doing is redirecting that request to the dialog controller a huge amount of customization is possible here up to in including creating your own custom dialog controller in Blueprint that said for most users the included BP basic dialog controller will work well with minimal tweaks if you're using the default dialog controller it makes use of a display widget functionally this is just a umg widget that implements the bi simple dialog display interface while the default dialog controller controls the behavior of dialogue in your project it outsources the actual display to its current display widget this is done to promote flexibility as the same basic dialogue Behavior can be displayed to the screen in many different ways why are display widgets in offshoot of the default controller and not a required part of the plugin as a whole basically because I could imagine a scenario where you might want to create a custom controller that Bridges its display across multiple widgets or even bypasses the need for display widgets altogether separating things out in this way gives you the option to use the provided display Widgets or not as you see fit speaker components are the bridge between your characters and the dialogue the default option carries standard information that a dialogue might expect to have but you can extend your speaker components to include extra data or functionality however you need an example of this extension is the provided crpg speaker component which includes portrait data for the speaker two display widgets are provided with the plugin the default wbas dialog display will be the go-to option for most users when used with the default dialog controller this widget creates what I would think of as standard dialogue think of games like Skyrim The Witcher and the outer worlds in practice this means presenting a single NPC speech and a list of options for the player to respond the other provided display widget is W crpg dialogue display as the name implies this adds crpg staes like portraits and a speech log to get the most use out of it crpg speaker components should be used in place of normal speaker components this will allow you to supply the portraits for your characters on a per speaker level if you are using the default BP basic dialogue controller you can override its display widget from Project settings dialog Tree by changing the value of widget type to tweak an existing display widget you just need a basic knowledge of umg first open up your content browser settings and make sure show engine content and show plug-in content are both checked then search the content browser for dialogue tree that should bring up the plugins content folder navigate to the widget you're interested in modifying then copy and paste it into your project here it's important to make sure that you copy and paste the widget into your Project's content folder don't modify anything in the plugins content folder directly this content all exists on the engine inside and the engine doesn't like when you make changes here doing so has been known to cause crashes opening the newly duplicated widget up in umg will allow you to tweak its visuals to your liking similarly you can create your own display widgets from scratch just create a new user widget and set it to implement the B I simple dialog display interface as with all interfaces that will provide you with several functions to implement to hook your custom widget into the default dialog controller these include set controller which takes a dialog controller this allows your widget to Cache a reference to its dialog controller display options takes an array of speech detail structs and allows you to determine how Player speech options will display to the screen display speech takes a single speech detail struct and a Target speaker component it allows you to determine how NPC speeches will display to the screen on open allows you to specify Behavior to play on opening the widget and on close allows you to specify Behavior to play on closing the widget even if you decide to stick with the default dialogue controller it's inevitable that you'll want to tweak it to better fit your needs as of update 1.1 there are now several configuration options for the default controller available under project settings and then dialogue tree the widget type property as we have already discussed allows you to change the display widget that the default controller will use widget Z order allows you to change the Z order that the widget will be spawn into in the player's viewport if you're having an issue where the display widget appears but cannot be clicked on it is usually because there is a hit testable canvas panel in your project that is physically blocking the input in such cases increasing the widget Z order value can help solve the issue the default input mode is a struct that allows you to configure the input settings the default controller will use on exiting dialogue input mode defines the overall input mode that will be used this can be game only game and UI or UI only flush input allows you to set whether the existing input will be cleared on exiting dialogue hide cursor during capture as the name suggests determines whether the cursor should be hidden during capture this is only used for game in UI mode and finally Mouse lock mode determines if and how the mouse should be locked to the screen this is not used for game only mode finally the last property we have is allow game input in dialogue this allows you to determine whether normal game input will be allowed while navigating dialogue in effect setting this to True means the default dialogue controller will set the input mode to game and UI on entering dialogue setting it to false means the default dialogue controller will set the input mode to UI only on entering dialogue please note that all non-ui game input including key presses is blocked in UI only mode as a result if you want to include hot Keys a skip button or something similar in your dialogues while allow game input and dialogue is set to True you'll need to set this up via UI inputs this can be accomplished for example by creating a custom display widget and overriding on Mouse button down you can access the default controller settings in your own projects for instance if you want to implement a custom dialog controller to do this you can call get dialog manager subsystem in Blueprint followed by get settings if you want to customize the behavior of the default dialog controller you can do so by extending BP basic dialog controller and blueprint as you can see this allows us to override the individual functions that make up the controller's behavior with New Logic and if we want to call the default version of the function as part of our custom implementation all we have to do is right click on the event and select add call to parent function another way to add new behavior on top of the default controller is with a series of blueprint assignable delegates on dialog started is called whenever a dialogue opens on dialog ended is called whenever a dialogue closes and on dialog speech displayed is called whenever a speech is played and it passes the speech data along to its subscribers finally you may not want to use the default dialog controller at all in that case you can Implement your own version in blueprint by extending the base dialog controller class and extending its relevant functions with all of that said if you're going to extend or replace the dialog controller you're going to need some idea of its various functions and how they fit together with that in mind let's take a short tour around the default controller and how it operates up at the top of the event graph we have the initialize event which gets called from begin play the initialize function belongs to the default controller specifically not to the base dialog controller class if you write your own controller you may or may not want to include something similar essentially all it does is add a widget of its widget type to the screen below that we get into the first of our core dialog controller events with open display as the name suggests this opens the display widget and performs Associated tasks like changing the input mode next up we have closed display which is essentially just the inverse of open display it closes the display widget and performs any Associated tasks next display options controls how Player speech options get displayed to the screen in the case of the default dialog controller we pass the buck along to the display widget the same goes for display speech which is responsible for or displaying an individual speech and finally we have handle missing speaker this is an optional event to implement it gets called on starting the dialogue when the dialog tree asset was not provided with one of its expected speaker components handle missing speaker gives you a first opportunity to address the situation with the possible exceptions of initialize and handle missing speaker a custom dialog controller ought to implement each of these events your game won't crash or anything if it doesn't your dialogues just won't play at this point we've covered the various extension points the dialog controller includes to allow you to customize it to your needs but what kind of customizations can you do and how might you go about it here we have an example class that extends BP basic dialog controller let's say for example that you want to set up a special dialogue camera that flips back and forth between the various speakers you could add functionality switching your camera on and off to the open and close display events and under the display speech event you could add a function or event call that sets the camera's orientation based on who's speaking similarly if you want to hook in a lip sync function you could tack it on as part of your custom display speech implementation the point here is that every user-facing phase of dialogue has some function that you can Implement yourself or otherwise modify to include whatever functionality you need if none of this works the way you want you're able to scrap the default controller entirely and create your own in Blueprint the goal of this design was to create a somewhat modular approach with default options to take the user most of the way to a complete setup with minimal effort but with the flexibility for full customization if it's needed the speaker component is a kind of special case when it comes to customization given that we never really want to modify how it does its core job often however we do want to add extra functionality to help our characters better interact with dialogue we covered this somewhat in the queries and events tutorial where we made a custom speaker component with a counter to track how many times the speaker had asked a question another good example is the included crpg speaker component which includes a texture property to use as a portrait ultimately this is very open-ended so there's only so much advice I can offer here just know that custom speaker components are a good place to stash extra data or to add functionality that will interact with dialogue via queries or events in this tutorial we reviewed the major objects that can be extended to customize dialogue in your project these include the dialogue controller the display widget and the speaker components we also discussed how display widgets can be modified or replaced to customize the look of dialogue and how the dialogue controller can be modified or replace to customize the behavior of dialogue on a more fundamental level finally we discussed how the speaker component can be extended to include additional data and functionality this concludes the series of introductory tutorials I had planned to get people up to speed with dialog tree As A Brief Review the quick start covers how to get the plugin set up and actually playing dialogue in just a few minutes the the editor guide takes a detailed look at the dialog editor its nodes and their properties the queries and events tutorial focuses in on how you can create custom queries and events to have your dialogues interact with the rest of the game world and finally this tutorial explored some of the ways you can customize the plugin to fit your needs you should now have a strong foundation for how to use dialog Tree in your own projects I may add more tutorials in future as new features are added and as the need arises feel free to reach out if you have any questions or requests for a specific feature or a tutorial on a specific topic the best way to reach me is probably via my Discord Channel if this video was helpful to you please give it a like And subscribe so you get notified when videos showcasing new features come out if you're enjoying the plugin I would be Beyond grateful if you could take a few seconds out of your day to leave me a review on the unreal Marketplace finally if you'd like to support further development on the project you can do so on patreon.com links to all of that as well as the plugins documentation site will be posted in the description in the meantime thanks for watching best of luck and happy developing
Info
Channel: UnraedGames
Views: 773
Rating: undefined out of 5
Keywords: Unreal Engine 5, UE5, Dialogue Tree, Unreal Engine, Game Development, Dialogue System, Plugin, Tutorial
Id: blCsXXLg2-k
Channel Id: undefined
Length: 14min 33sec (873 seconds)
Published: Fri Mar 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.