Tutorial 3: AI Generation
In the previous tutorial you authored behaviors by hand in Coppola. In this tutorial you will use our AI Assistance to add additional task methods to your project.
You can use the AI Assistance either to generate methods from scratch or to take behaviors and dialogue authored outside of Coppola and format it correctly. Let’s start by looking at that second use case.
Script to Scene

Open the sample script in the Resources section of this tutorial. This file contains a dialogue between two bar patrons. Copy the contents of the script.
Open Tutorial Project in your Coppola account.
Expand the Bar Patron | Chit Chat task you created in Tutorial 2.
Click the blue Generate New Method button in the bottom right.
You will be prompted to describe the desired method. Paste the script contents into the window and click generate. If it asks if you'd like to include the current method in the prompt, uncheck it. The generate new method button will gray out as the generation process takes place. It might take a minute or so for the content to generate.
When generation completes, you will see a pop-up with your results for review. You can rename the method in the box at the top or reject the results if they are incorrect. If you like the way the new script looks, click Accept. Your new method will be added to the task.
Create from Scratch

Click on the blue Generate New Method button. You will see a check box on the generation window allowing you to include your currently open method as important context in your next generation request. Uncheck it.
Delete your first prompt from the generation window and type: Chit chat between the bar patrons. One of the bar patrons is trying to cheer up the other. Click Generate.
Wait a minute for the generation to complete and then review the results. If you get an error about unknown task parameters, refresh and try again. Your results will look different than what you see in the screenshot above. Click Accept.
Add one more method. Click Generate new Method and describe a new example of chit chat you’d like to see. In this tutorial, we used: Chit chat between the bar patrons. One of the patrons is trying to decide what to order.
Wait for your result, review, and accept it to add it to the task.
Using Chit Chat as a Subtask

Now we'll add the Chit Chat task as a subtask inside of the Socialize at Bar Task.
Expand the Bar Patron | Socialize at Bar task.
Open the Order a Drink Method.
Click Add Step.
Change the step type to Subtask. Select the task Bar Patron | Chit Chat. You have a choice with the task parameters: if you keep the defaults either bar patron might get bound to barpatron1 in the Bar Patron | Chit Chat task. If you'd like to specify that the bar patron who goes to get a drink is the same barpatron who dreams about cockroaches, then you'll want to change default to barpatron under the barpatron task parameter drop down.
Click Save Changes. You’ll see the subtask added as the last step of your task.
Click the six dots on the left hand side of the step and drag your subtask up to be the first step in this task. Your task should now look like the screenshot at the top of this section.
Building and Running Your Domain
Click Build Project in the upper right hand corner.
Open your Unreal project. The domain assets should have automatically updated. If you do not get the pop-up saying they updated, you can upload the new JSON file manually.
In the DataAssets 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. In the modal that appears, click Import. Your existing data assets will now have the updated content.
Click play. You should your new socialize at bar task play out: one of your methods of chit chat followed by the drink ordering sequence.
✨Extra Credit

If you'd like to further experiment with AI Generation and Subtasks, try adding more variation to the Cockroach dream subtask.
In Coppola go to the task tab.
Click Create Task. Name the task Bar Patron | Deal with the Roaches and click create.
Expand your new task.
Create two role task parameters: one for each bar patron.
Create three prop_type task parameters: broom, broom_hook, rag.
Open the Dealing with the Roaches google doc. This document contains three different variations for how
barpatron2might respond to his friend's admission about the cockroach dream. Copy the four lines that make up the subtask variation 1 (beginning with the barpatron2 picking up the broom, and ending with him placing it back on the hook.)Back in Coppola, click on the Generate New Method button at the bottom right hand corner of the Bar Patron | Deal with the Roaches task.
Paste your content and click Generate. Wait for your result, review, and accept to add it to the task. If you get an error about unknown task parameters, refresh and try again.
Go back to the Dealing with the Roaches google doc. Copy the contents of subtask variation 2.
In Coppola, click Generate New Method. Delete your previous prompt and uncheck Include the Current Method in the Prompt. Paste the contents of subtask variation 2 in. Click Generate.
Repeat steps 9 and 10 to add the third and final subtask variation to this task.
Expand the Bar Patron | Chit Chat task. Open the Cockroach Dream Method. The AI Generation automatically names the methods so your method may be named something slightly different.
Insert a new step. Select subtask → Bar Patron | Deal with the Roaches.
In this instance, we really care that there is consistency between the bar patrons in the parent task of chit chat and the deal with the roaches subtask. Under the Barpatron drop down change from default to Barpatron and under Barpatron_2 change from default to Barpatron_2.
Save changes.
Drag the new step up until it becomes the new line 6. Hover over line 7 ("Fine, fine. Whatever you say.") and click on the trash icon on the right side of the screen to delete it.
Repeat the steps of building and running your domain described in the previous section. Now, when you run your scene, during the socialize at bar task you will see one of your three chit chat task variations play out and if the Cockroach dream is chosen you will see one of three variations for how the bar patrons resolve the conflict at the end of the task.
Last updated