For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tutorial 7: Adding Player Dialogue

In this tutorial you'll add the player as a role to your domain and configure branching dialogue with the Townsperson and the Farmer.

Resources you'll need for this tutorial:

If you have questions that are not answered by our documentation, join our Discord server and post in #support.

Creating the Dialogue Tasks

  1. Go to app.bitpart.ai and click Projects → Tutorial Project.

  2. We'll start by creating three empty tasks. In the main task view, click Create Task in the upper right corner to create a new task. Name your task The Newcomer.

    1. Create a second task and name this task Skilled at Archery.

    2. Create a third task called Welcome to Town.

  3. Click into Skilled at Archery to open your task.

  4. To create task parameters for this task, click the plus icon next to Task Parameters and create a role task parameter for player. Click the plus icon next to Task Parameters a second time to create a role task parameter for farmer . Repeat this to add a third task parameter for townsperson.

  5. Open the sample script (also found in the Resources section of this tutorial). This document contains content for three tasks with three methods for each task. There are two ways to add this content into your domain, depending on which features you have access to in Coppola.

    1. Method One: If you have the AI Generation feature in your Coppola account.

      1. Copy all three methods, with their method names, click the blue Generate New Method button, paste the methods, and hit Generate.

      2. AI Generation should return all three methods. Accept each.

    2. Method Two: If you do not have AI Generation, you will create each step manually.

      1. Click the plus icon next to Task Methods in the sidebar to create a new method. Name this new method Highly Accomplished.

        1. Click Add Step. Add a Speak To action. Instigator → Player, Target → Farmer, Utterance → I got my first bow for my sixth birthday.

        2. Click Add Step. Add a Speak To action. Instigator → Farmer, Target → Player, Utterance → Did you now? Well, sounds like you’d be a big help to Darius.

        3. Click Add Step. Add a Speak To action. Instigator → Townsperson, Target → Farmer, Utterance → He might actually shoot something that isn’t blind or lame.

      2. Repeat these steps to add the other two methods: A True Beginner and What's Archery?

  6. In the left side panel, under Task Settings there are three settings: Priority, Allow Director Initiation, and Dialogue Entry Point. Priority we've discussed in a previous tutorial. The other two serve the following functions:

    1. Allow Director Initiation. If toggled on, the AI director can proactively choose to start this task when considering what should happen next in the world. In the case of the Skilled at Archery task, the player is the actor who initiates this task. Uncheck this box.

    2. Dialogue Entry Point. If checked on, this task will be used as a source of new conversations. In other words, if you have dialogue that you would like to initiate when the player goes up to an NPC and interacts with them then this setting should be checked. We're going to use this task as a nested choice inside a player dialogue so keep this box unchecked.

  7. Once you've added all three methods to this task, click Back to Tasks in the upper left hand corner to return to the main task list.

  8. Open the Welcome to Town task.

  9. Create task parameters for this task, by clicking the plus icon next to Task Parameters. Create a role task parameter for player. Click the plus icon next to Task Parameters a second time to create a role task parameter for farmer . Repeat this to add a third task parameter for townsperson.

  10. Open the sample script. Scroll down to the Welcome to Town task.

  11. Add the three methods of this task (Burned Before, We Hope You Like it, Please Stay) to Coppola using either the AI Generation (described in 7.a above) or manual (described in 7.b) method.

  12. Once you've created all three methods of the task set the following task settings:

    1. Allow Director Initiation: Uncheck this box

    2. Dialogue Entry Point: Keep this box unchecked.

  13. Click Back to Tasks and open The Newcomer task.

  14. Create task parameters for this task, by clicking the plus icon next to Task Parameters. Create a role task parameter for player. Click the plus icon next to Task Parameters a second time to create a role task parameter for farmer . Repeat this to add a third task parameter for townsperson.

  15. Return to the sample script. Add the three methods of this task (Looking for Word, Looking for Fun, Heard any Gossip) to Coppola using either the AI Generation method (described in 7.a above) or manual (described in 7.b)

  16. On first read the three methods of The Newcomer won't be coherent. That's because we've designed them to demonstrate how you can use subtasks to add branching dialogue and variety to conversations with and between NPCs. Open the Looking for Work method.

  17. Right click on the first line of the task ("I'm new here. Know of anyone looking for help?") and select Insert Step Below. Switch to Subtask and choose Welcome to Town in the drop down. Change the task parameters so:

    1. Player → Player

    2. Townsperson → Townsperson

    3. Farmer → Farmer

    4. Setting these task parameters ensures that the farmer bound in the Newcomer task will be the same farmer in Welcome to Town task. It is not strictly necessary in this tutorial to set these since you'll only be using one farmer, one townsperson, and one player. It is, however, best practice and will help you avoid experiencing unexpected behavior. Save Changes.

  18. Right click on the fifth line of the task ("Do you have any skill with the bow?") and select Insert Step Below. Switch to Subtask and choose Skilled at Archery in the drop down. Change the task parameters so:

    1. Player → Player

    2. Townsperson → Townsperson

    3. Farmer → Farmer

    4. Save Changes.

  19. Open the Heard any gossip method. Right click on the third line of this task ("We've only just met you.") and select Insert Step Below. Switch to Subtask and choose Welcome to Town in the drop down. Change the task parameters:

    1. Player → Player

    2. Townsperson → Townsperson

    3. Farmer → Farmer

    4. Save Changes.

  20. In task settings, set the following settings:

    1. Allow Director Initiation: Uncheck this box

    2. Dialogue Entry Point: Check this box! This will be a dialogue that the player initiates with the Farmer and the Townsperson.

Building and Running the Domain

There is a new step in these instructions for setting up the player's data asset. Even if you know these steps well by now, pay close attention beginning on step 6.

  1. Click Build Project in the upper right hand corner. Unzip the downloaded folder.

  2. Open your Unreal project. In the Content Browser, navigate to Bitpart Archetypes → Tutorial → DialogueTutorial. Open the DemoMap-Dialogue Map.

  3. Look for the data asset called BDA_Dialogue_Tutorial. Open the data asset. In the data asset, select Import From JSON File and choose the JSON you just downloaded from Coppola. Save and close the data asset.

  4. Open the data asset called BDS_Dialogue_Tutorial. In this asset, select Refresh Task List, save, and then close it.

  5. In the Tutorial folder find and open the data table called DT_Dialogue_Tutorial. Go to the Data Table Details and point at the correct source file before reimporting. Save and close the table.

  6. Right click on the data table asset in the Content Browser. Under Bitpart Actions, select Import Utterances. In the pop-up choose Dialogue Tutorial Folder as the Target Folder then Import Utterances. You will see DA_Farmer, DA_Townsperson , and DA_Player appear in the folder.

  7. In the Content Browser, open the red BP_NPC_Farmer in the DialogueTutorial folder. Open the Bitpart Character Component. Under Details → Bitpart → Utterance assign DA_Farmer to the Bitpart Utterance Data Asset field. Compile, save, and close the asset.

  8. In the Content Browser, open the blueBP_NPC_Townsperson in the DialogueTutorial folder. Open the Bitpart Character Component. Under Details → Bitpart → Utterance assign DA_Townsperson to the Bitpart Utterance Data Asset field. Compile, save, and close the asset.

  9. In the Content Browser, search for BP_FirstPersonCharacter blueprint and open it. If your project has multiple BP_FirstPersonCharacter blueprints in it, make sure to select the one in BitpartAI → StarterPack → Characters.

  10. Open the Bitpart Character Component. Under Details → Bitpart → Utterance assign DA_Player to the Bitpart Utterance Data Asset field. Compile, save, and close the asset.

  11. Click play. You should be able to walk up to the Farmer (the red mannequin) and press E to bring up a dialogue box.

Last updated