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

Tutorial 2: Creating Behaviors in Coppola

In tutorial one the behaviors you saw were created in our authoring tool, Coppola. You can use the same tool to create new behaviors for your characters. In this tutorial we’ll cover how to author these behaviors by hand. A future tutorial will demonstrate how to use AI assistance to author them even faster.

If you prefer to watch a video tutorial, follow the link for the video in the Resources section below this paragraph. Each section of this tutorial is marked with time codes that correspond to the parts of the video that cover that section.

Resources you'll need for this tutorial

  1. A completed Tutorial One map with all characters and props setup

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

Creating a Chit Chat Task [0:21-3:18]

  1. Go to app.bitpart.ai and create an account.

  2. You’ll see one project added to your Coppola account: The Tutorial Project.

  3. Click into that project to get started. This project has a handful of pre-designed tasks, or behaviors. Open Barkeep | Make a Drink. Click into the pour drink task method in the menu on the left to see what this task looks like. This task describes the series of steps a barkeep needs to execute in order to make a simple drink—pick up the glass, put it on the counter, pick up the bottle, and pour from the bottle into the glass.

  4. Click Back to Tasks in the upper left hand corner to return to your task list.

  5. Select Create Task in the upper right corner to create a new task. Name your task Bar Patron | Chit Chat.

  6. Click into your new task. We'll begin by by creating task parameters. A task parameter is a variable that allows a task to bind to a specific character or prop instance in Unreal at runtime.

    1. Click the plus icon next to the word Task Parameters in the sidebar.

    2. Under the Role drop down select Barpatron.

    3. The tool will automatically suggest a name for the task parameter.

    4. Click Create.

    5. Add a second Barpatron task parameter. Notice that this time it automatically named the parameter barpatron_2. At runtime, either of your bar patrons could be assigned to either of these parameters.

    6. These steps are demonstrated between 1:36-2:01 in the video overview.

  7. Click the plus icon next to Task Methods in the sidebar to create a new method. A method is a variation of a task. You can write multiple methods to create many different ways in which the bar patrons might chit chat. Name this new method Quiet Night.

  8. Click Add step. In the drawer on the right, you’ll be prompted to select which action you want to add.

  9. Search for, and select, the speak to action.

  10. Fill in the action details with the following values:

    1. Instigator → barpatron

    2. Target → barpatron_2

    3. Utterance → It’s quiet in here tonight.

    4. These steps are demonstrated between 2:01-2:55 in the video overview.

  11. Save your changes. Your method now has one step.

  12. Click Add step. Search for the speak to action and fill in the action details with the following values:

    1. Instigator → barpatron_2

    2. Target → barpatron

    3. Utterance → It'll pick up later.

    4. Save your changes.

  13. Your method should now look like the screen shot at the top of this section.

Building Your Project [3:19- 6:28]

  1. Click Build project in the upper right hand corner. This exports all the content in your domain, downloading it to your computer. If you open the zip folder you’ll see two files: a JSON file and a CSV. You’ll need both of these in the next step. Unzip the folder.

  2. Open your Unreal project. In the Content Browser, navigate to Bitpart Archetypes → Tutorial. Look for the data asset called BDA_Tutorial. This is a domain asset, and it holds all of the content associated with the planning domain/project you’re editing in Coppola. Open the data asset.

  3. 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_Tutorial. In this asset, select Refresh Task List. You should see Bar Patron | Chit Chat appear in the subsequent list. This is a domain setting asset, and it’s showing you all the tasks that exist in your domain. They should all be toggled on. Save and close the asset.

  5. In the Tutorial folder find and open the data table called DT_TutorialUtterances. This table contains a list of all the dialogue lines in your project. It will be empty. In the toolbar at the top of the data table select Window → Data Table Details.

  6. Switch tabs to the Data Table Details and under File Path → Source File, click the ellipses to the far right and point to the CSV file you downloaded from Coppola. Click Reimport at the top of the window. In the Data Table tab the dialogue lines you created should have populated. Save and close the table.

  7. Right click on the data table asset in the content browser. Under Bitpart Actions, select Import Utterances. In the pop-up, choose the Tutorial Folder as the Target Folder then Import.

  8. Two new data assets will appear in the Tutorial Folder: DA_BarPatron1 and DA_BarPatron2. Both data assets contain the same information: all the dialogue lines that a bar patron might say in your project. In a future tutorial you will need both of these assets. In this tutorial you only need one.

  9. In the Content Browser, search for BP_NPC_Patron. Open the blueprint. Click into the NPC's BitpartCharacterComponent (you may need to Open Full Blueprint Editor first). Under Details → Bitpart → Utterance assign DA_BarPatron1 to this blueprint. Compile, save, and close out of the asset.

  10. Click play. Walk up to the Bar Patrons and you should see your chit chat task play out. For now, since we haven't set any restrictions on the tasks not repeating or needing to be on cool down, you should see the task repeat on loop.

Creating the Socialize at Bar Task [6:29-11:21]

  1. Go back to the web tool—Coppola.

  2. Create a new task called Bar Patron | Socialize at the Bar.

  3. Open your new task. We're going to add three roles to our list of task parameters: 2 bar patrons and 1 barkeep.

  4. Click the plus icon next to the word Task Parameters in the sidebar.

    1. Under the Role drop down select Bar Patron.

    2. The tool will automatically suggest the name barpatron for the task parameter.

    3. Click Create.

  5. Click the plus icon next to the word Task Parameters in the sidebar.

    1. Under the Role drop down select Bar Patron.

    2. The tool will automatically suggest the name barpatron_2 for the task parameter.

    3. Click Create.

  6. Click the plus icon next to the word Task Parameters in the sidebar.

    1. Under the Role drop down select Barkeep.

    2. The tool will automatically suggest the name barkeep for the task parameter.

    3. Click Create.

  7. In addition to the three roles, we're going to add a task parameter for a prop. Click the plus icon next to Task Parameters. This time change the type from role to prop_type.

    1. Under the prop type drop down select glass.

    2. Click Create.

  8. Add a new task method and name it Order a Drink. Click the plus icon to add a new step to your task.

  9. Search for, and select, the speak to action. Fill in the action details with the following values:

    1. Instigator → BarPatron

    2. Target → BarPatron2

    3. Utterance → I’m going to get a drink.

  10. Click Add Step.

  11. Add a speak to, with barpatron as the instigator, barkeep as the target, and “Wallace, could I get a drink?” as the utterance. Don't include the quotation marks when you copy this text into the utterance field.

  12. Add another step, a speak to, with barkeep as the instigator, barpatron as the target, and “Coming right up.” as the utterance. Don't include the quotation marks when you copy this text into the utterance field.

  13. You could list out the steps required for the Barkeep to make a drink. However, as you saw earlier in the tutorial, this domain already has a task that describes how the Barkeep should make a drink, and you can reuse that. Add a new step. Instead of adding a new action, select Subtask.

  14. In the subtask drop down select the Barkeep | Make a Drink task. You’ll be prompted to fill in task parameters for this subtask. Within the context of the parent task Bar Patron | Socialize at the Bar, binding the parent task's parameter to a subtask parameter specifies that the same value should be reused for the subtask. If left unassigned, the value assigned to the subtask parameter is chosen by the director according to the constraints defined on that subtask, but this value can be any valid assignment, which may or may not be one used for the parent task parameter.

    1. For example, if a nearby glass is assigned to the glass parameter of the Socialize at Bar task, but the director is left to pick a random glass for the Barkeep | Make a Drink subtask, it may select an entirely different glass. To avoid this outcome, click into the glass parameter and change from default → glass. Now the glass that gets bound to actions in Make a Drink is guaranteed to be the same glass that gets bound to actions in Socialize at Bar.

  15. Save changes.

  16. Add a Step. Select the speak to action. Instigator → Barkeep, Target → BarPatron, Utterance → Here you go.

  17. Add a Step. Select the speak to action. Instigator → Barpatron, Target → Barkeep, Utterance → Cheers.

  18. Add a step. Choose the Pick Up Action. Instigator → Barpatron, Object → glass.

  19. Add a step. Choose the Drink Action. Instigator → Barpatron, Object → glass.

  20. Add a final step. Choose the Put Down action. Instigator → Barpatron, Object → glass, Surface → bar_table. You haven't yet created a task parameter for the bar_table. To add it, in the task parameter drop down, click Create New Task Parameter and create a prop_type parameter for the bar_table. Save changes.

  21. In the left hand sidebar change the priority of this task. By default your new task has been set to medium priority. Click into the priority drop down and change the priority of this task to High. The planner will select high priority tasks over medium or low priority, providing the task is valid given the state of the game.

Building and Running Your Domain [11:22-14:00]

  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. Look for the data asset called BDA_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.

  3. Open the data asset called BDS_Tutorial. In this asset, select Refresh Task List. You should see your most recent task appear in the list. Save and then close the asset.

  4. In the Tutorial folder find and open the data table called DT_TutorialUtterances. As long as the new CSV you generated from Coppola is in the same location on your computer as the old one, clicking Reimport will refresh the table with your new utterances. If the CSV is in a new location, then go to the Data Table Details and point at the correct source file before reimporting. Save and close the table.

  5. Right click on the data table asset in the Content Browser. Under Bitpart Actions, select Import Utterances. In the pop-up, choose the Tutorial Folder as the Target Folder then Import. You should see one new data asset appear: DA_Barkeep . The two existing data assets will update with the new content.

  6. In the Content Browser, search for BP_NPC_Barkeep. Open the blueprint. Click into the NPC's BitpartCharacterComponent (you may need to Open Full Blueprint Editor first). Under Details → Bitpart → Utterance assign DA_Barkeep to this blueprint. Compile, save, and close out of the asset.

  7. Click play. You should the socialize at bar task play out

Last updated