How to use the Dialogue Feature in Blueprints

Every installation comes with demo content you can learn from. I will be using those examples here to demonstrate how to use the plugin.

The Text Generation used with Voice Generation from manual context option.

Step 1: Adding the component for dialogue context

  1. Add the AC_GPTDialogue Component to your character, actor, manager, or any blueprint that you want to generate text or voice from.

  2. Decide which type of dialogue integration you want to use. Algorithmic is best for NPC and Characters who have traits and names, manual is best for one-off use cases, and quest integration is best for mission design.

  1. Now go to the GPT Tools drop-down menu shown on the previous page and open the GPT Context Generator. add your actor with the context to a level of your choosing so it can be recongized.

  2. Fill out the details for your character with the correct dialogue type, in this case I will be generating it for manual dialogue context.

  1. Once it is filled out, click generate, it may take a few seconds to process. you will see the status change when it is completed, you can also view the output log to see realtime updates of what it is doing.

  2. Go to your actor where you generated and make sure you click compile and save, you should now have a prefilled dialogue context that is high quality.

Optional: Quest System Integration

  1. To use with a quest system, assign an integer to the map entry that aligns with your quest progress. It does not always need to be linear. For instance, if you have a main story and an actor that appears at quest progress 45, then you can start at 45.

  2. To manage quest progress, first set up integers or strings, depending on how your system tracks progress. Fill in details as you would with manual dialogue context. If hidden, click the dropdown arrow next to the progress number or text to see

  3. In your quest dialogue setup, use the "Get Integer/String Text/Voice Dialogue State" node from the component and input your quest progress. Ensure to pass it through a "Generate Dialogue Prompt" node to obtain the fallback option and return value (to be used in the generate dialogue)

Optional: Manual Dialogue Context

    1. Set up the manual dialogue context entries in the component details.

    2. Use the "Get Manual Dialogue Context" node from the component with the correct entry index.

    3. Combine this with the Generate Dialogue Prompt V2 node to produce the string needed for the Generate Text

    4. There are two different Generate Dialogue Prompt nodes, V1 and V2. V2 allows you to pass a fallback voice line and speaking character name for subtitles.

Optional: Algorithmic Dialogue Selection (Smart Dialogue Selection)

This uses Dialogue Tags applied to a component on an actor to determine which is the best dialogue to play. This is used in many big games where they need dialogue based on the character's traits, like ragdolled, angry, happy, attacking, wet, sad, etc.

  1. To use this, first set up algorithmic dialogue tags in the details panel of your character or actor. Assign an array of tags for this dialogue option, then create a dialogue context

  1. In this example, if the character has active traits of being angry and intrigued, it will likely choose this dialogue option, assuming no other dialogue entries are a better choice. You can apply the same tag to different entries as well. For example, you can have 10 different types of angry dialogue; some are intrigued, some are wet, some are dry, and some are ragdolled.

  2. To manage character tags effectively, use algorithmic dialogue nodes to assign, remove, and locate current tags. When ready to generate text, utilize the "Get Best Algorithmic Dialogue Option" node, then connect it to the Generate Dialogue Text

Optional: Using a Global Dialogue Manager for all game characters with algorithmic dialogue.

This system allows you to have a single manager in your world that contains the names and traits of all characters. It can generate dialogue, track story history, and manage game dialogue from a centralized location

  1. Compile a list or data table of all character tags that your NPCs and players will have using the Add Active Dialogue Tag node (on the characters, not the manager).

  2. Cast the character to a manager or use an interface, then pass it as a string array.

  3. In the manager, use a Clear Activate Dialogue Tags node with a for loop to determine the array length from the character. Add a dialogue tag in the loop and execute the Generate Text Dialogue Async node

    This is what the manager algorithmic dialogue function should look like.

Step 2. Generate the Text Dialogue and, optionally, generate voice dialogue.

  1. To start, in the Blueprint context menu, search for the "Generate Text Dialogue Async" node. It should be available in almost all event graphs.

  1. Once you have the node, use one of the methods outlined above to generate a prompt from the dialogue context. In this screenshot, I am using the manual

  1. Plug the return value from the "Generate Dialogue Prompt V2" or "Find Best Dialogue Option V2" into the "prompt" input. Insert the Fallback String into the "Fallback Dialogue" input

  2. Set up conditions for On Generation Success and On Generation Failure node returns

Note: In case of a generation failure, the fallback option will be returned. Therefore, if you are assigning this to a widget or character, ensure you also assign the generated text output on failure, not just the success

  1. To use the voice acting feature, follow these steps:

    1. When "On Generation Success" is executed, call the "Generate Voice Dialogue Async" node.

    2. Connect the "Generated Text" output to the "prompt" input of the voice node.

    3. Use either "Play Sound at Location" or "Play Sound 2D" for the returned voice line.

  1. Optionally, you can use the "Store Dialogue History" node after generating the text so that the AI is aware of the conversational history

Optional Step 3. Generating Dialogue from anywhere without the component.

An alternative method for generating dialogue is available if you need it in an event graph that does not support components.

  1. Get the GPT Dialogue Subsystem(Not the editor one).

  1. Drag off the subsystem and search for "Generate Dialogue" and "Generate Dialogue Prompt"

  2. On the Generate Dialogue Prompt input, use the "Make Dialogue Context" node to make dialogue context on the fly.

  3. Add a custom event off the callback to get the return value.

  4. This is what it should look like. The same process can be used for Generating Voice Dialogue on the fly.

Generating Text Dialogue without a component

Generating Pre-Baked Filler Dialogue to make the Processing wait more natural:

  1. Open the GPT Tools Menu and then open the GPT Voice Baker tool.

  2. Under Generate Voice Filler Dialogue, you can set the voice you like and the amount of different dialogue variations you would like it to generate.

  1. Click generate, wait for it to finish. you will see a notification pop up in the corner of the editor when it is complete, click the link on this notification to open the folder on your project.

  2. Once in the newly opened folder you can drag these generated voice lines into your project and set them up as sound waves or sound cues, which ever you prefer.

  3. To use these newly saved voice lines, you need to go to the AC_GPTDialogue Component on your actor you want to use them with, and create a character profile. in the demo content Quinn has one you can look.

You can have multiple character profiles for different voices.

  1. Use the Get Filler Dialogue node and combine it with play sound to have your character play a filler dialogue while the generation processes.

  1. Optionally, you can click the drop down array on Play sound, and assign a concurrency asset so the voices don't overlap one another. SCon_Dialogue is one that comes with the plugin you can use.

How to use with Data Tables:

You can store dialogue context in data tables for large stories or other cases where you need a large amount of dialogue not tied to a specific actor.

  1. Add the GPTDialogueContext Struct to your data table struct.

  1. Open the Context Generator dashboard from the GPT Tools menu and scroll to the right until you see the data table context generator feature.

  1. Fill out the context, any animations you want added, the selected data table, the exact name of the variable in your data table that has the context, and the Row Name to add to.

  2. Once all of that is filled out click Generate and then update the Row name and if necessary context details for the other rows you want to fill out.

Generating Fallback Dialogue:

You can generate fallback dialogue in the editor for components and data tables using the Context Generator Dashboard.

  1. Open the Context Generator Dashboard from the GPT Tools menu.

  2. Scroll to the right until you see the Data Table Fallback Setter or the Component Fallback setter portions.

  3. For Data Table set your data table you want it to process through, for the component, ensure your actor is in the current level you are in and then just click generate all fallbacks, it will take some time depending on the amount of data to process but when it is complete you will have fallback dialogue generated for each context.

Last updated