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 author new behaviors for your characters. In this tutorial we’ll cover how to do so by hand. A future tutorial will demonstrate how to use AI assistance to author them even faster.

Creating a Chit Chat Task

Sign-up for a Coppola account and download our desktop app, if you haven't already. You can do so by following this link.
You’ll see Tutorial Project prelisted in the Projects folder of your account.
Click into Tutorial 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 it 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.
Select + New Task in the upper left corner to create a new task. Name your task Bar Patron | Chit Chat.
Right click on your new task and choose + Add method. A method is a variation of a task. You can write multiple methods to create varying ways in which the bar patrons might talk to each other.
Name this new method Quiet Night.
Now that we have a method, we'll begin 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.

At the very bottom of the left-side menu, you should see a preview of the task method. Click the pen next to the method's name. You should now see a description field, task settings, and task parameters. Click the + next to Task Parameters
Under Select Role choose
Barpatronfrom the drop-down. The tool will automatically suggest a name for the task parameter.Click Create.
Add a second bar patron 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.
Either exit out of the settings window OR click on the Quiet Night task method. Click + Add step.
In the drawer to the right, you’ll be prompted to select which action you want to add. Search for, and select, the speak to action.
Fill in the action details with the following values:
Instigator →
barpatronTarget →
barpatron_2Utterance → It’s quiet in here tonight.
Save your changes. Your method now has one step.
Click + Add step. Search for the speak to action and fill in the action details with the following values:
Instigator →
barpatron_2Target →
barpatronUtterance → It'll pick up later.
Save your changes.
Your method should now look like the screen shot at the top of this section.
Building Your Project

If you haven't already, click Set game directory in the upper right-hand corner. Find the project where you have the plugin installed in File Explorer and assign the
BitpartDomainArtifactsfolder as the assigned directory.Connecting to this folder allows Coppola to automatically create and update domain assets.
Click Build project in the upper right hand corner.
Open your Unreal project. If this is your first time importing content into Unreal, it will prompt you to import upon opening the project. You can toggle
Don't ask againif you'd rather not be prompted moving forward.In the Content Browser, navigate to Content → Bitpart-Tutorial → DataAssets. Look for the asset named BDA_Tutorial. Open the asset, and choose Import From Json File. Choose the JSON file in the
BitpartDomainArtifactsfolder. Save and close the asset.When you hit build in Coppola, it should automatically update the domain assets in Unreal when you open it. Since it's our first time building, we'll do so manually to make sure everything is there.
You can also manually import new JSON files if you ever find that the auto-import is not working.
In the same folder open the data asset called BDS_Tutorial. If you open it you should see the list of task names from your project. 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.
In the DataAssets folder find and open the data table called DT_TutorialUtterances. This table will contain a list of all the dialogue lines in your project. It will be empty when you open it. In the toolbar at the top of the data table select Window → Data Table Details.
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 downloaded from Coppola (in the folder you set as the Game Directory). 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.
Right click on the data table asset in the Content Browser. Under Bitpart Actions, select Import Utterances. Hit Import when the Bitpart Import Utterances modal appears on your screen.
Two new data assets will appear in the DataAssets Folder:
DA_BarPatron1andDA_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.In the Content Browser, search for
BP_NPC_Patron_Tutorial. Open the blueprint. Click into the NPC's BitpartCharacterComponent (you may need to Open Full Blueprint Editor first). Under Details → Bitpart → Utterance assignDA_BarPatron1to this blueprint. Compile, save, and close out of the asset.
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

Go back to Coppola.
Create a new task called Bar Patron | Socialize at the Bar.
Right click on the task name and choose + Add method. Name the new method Order a Drink.
Open your new task. We're going to add three roles to our list of task parameters: 2 bar patrons and 1 barkeep.
Click the plus icon next to Task Parameters.
Under the Role drop down select Barpatron
The tool will automatically suggest the name barpatron for the task parameter.
Click Create.
Click the plus icon next to Task Parameters.
Under the Role drop down select Bar Patron.
The tool will automatically suggest the name barpatron_2 for the task parameter.
Click Create.
Click the plus icon next to the word Task Parameters in the sidebar.
Under the Role drop down select Barkeep.
The tool will automatically suggest the name barkeep for the task parameter.
Click Create.
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.
Under the prop type drop down select glass.
Click Create.
Return to your task method. Add step. Select the speak to action. Fill in the action details with the following values:
Instigator → BarPatron
Target → BarPatron2
Utterance → I’m going to get a drink.
Click Add Step.
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.
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.
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.
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.
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.
Save changes.
Add a Step. Select the speak to action. Instigator → Barkeep, Target → BarPatron, Utterance → Here you go.
Add a Step. Select the speak to action. Instigator → Barpatron, Target → Barkeep, Utterance → Cheers.
Add a step. Choose the Pick Up Action. Instigator → Barpatron, Object → glass.
Add a step. Choose the Drink Action. Instigator → Barpatron, Surface → glass.
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.
In the left hand sidebar, click the pencil next to the task name to 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
Click Build Project in the upper right hand corner of your Coppola project. Open your Unreal project. You should see a pop-up in the bottom left corner confirming the domain assets automatically updated.
Open the data asset called BDS_Tutorial. You should see your most recent task appear in the list. Save and then close the asset.
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.
Right click on the data table asset in the Content Browser. Under Bitpart Actions, select Import Utterances. Click Import in the modal that appears. You should see one new data asset appear:
DA_Barkeep. The two existing data assets will update with the new content.In the Content Browser, search for
BP_NPC_Barkeep_Tutorial. Open the blueprint. Click into the NPC's BitpartCharacterComponent (you may need to Open Full Blueprint Editor first). Under Details → Bitpart → Utterance assignDA_Barkeep(the one with a star next to it) to this blueprint. Compile, save, and close out of the asset.Click play. You should the socialize at bar task play out
Last updated