The quickest way to start using conversations is to create a new NPC Character Definition and add the Persona Modifier to the list of NPC Character Modifiers. Within the Persona Modifier, you can define your persona's character facts, personality, the voice they use to speak, and how they handle interruptions during speech.
Create an NPC Character Definition
To create an NPC Character Definition, follow these steps:
Navigate to your project's content folder and right-click within the Content Drawer.
In the pop-up menu, navigate to Artificial Intelligence > NPC Character Definition.
Name your Character Definition "PersonaNPCDefinition" then double-click the thumbnail to edit your NPC's properties.
Ensure you save changes to your NPC Character Definition before closing the tab.
Add a Persona Modifier to an NPC Character Definition
To add a Persona Modifier to your PersonaNPCDefinition, follow these steps:
Navigate to NPC Character Modifiers > Modifiers and click the AddElement (+) icon to add a modifier.
Find the newly added Modifier index (usually Index[2] if no other modifiers have been added) and select Persona Modifier from the dropdown menu.
Save the changes to your NPC Character Definition.
Your PersonaNPCDefinition is now equipped with a persona. You can select the dropdown arrow next to Persona > Character Facts to see the definition of your persona's Personality Prompt and Knowledge Prompt. These are editable either directly in the Modifier, or through the Prompt Editor Tool. The Prompt Editor Tool simulates conversations with your NPC's persona to help refine its personality and facts to iterate on your desired NPC behavior quickly.
Additionally, you can set the Voice Model to determine the persona's voice and Interruption Rule to determine how the persona will handle overlapping prompts.
Naming your Persona
To add a name to your persona, you need to add a UI modifier and set the Display Name.
Interact with your NPC Persona
To begin interacting with your NPC persona, click Edit in Prompt Editor.
This brings up the Prompt Editor Tool, enabling you to immediately begin interacting with your NPC persona.
Here you can type a prompt in the textbox in the middle of the Prompt Editor Tool and see your NPC persona's responses:
This is the first place you can interact directly with the persona you are constructing and simulate how it responds in the game world once attached to NPC Spawner.
Add Personality to Your NPC Persona
Below are examples of the information you can add to the Personality Prompt to create a custom persona. You can also use one of the available Fortnite characters who come with a default voice and persona. To use one of the Fortnite characters, do the following:
Add the Persona Modifier to the Character Definition.
Add a Fortnite character to the Character Cosmetic. The character’s Personality information automatically appears in the Personality field.
These steps must be followed in the sequence above to add the character’s personality.
If you delete the character’s personality there is no way to recover it without deleting your asset and starting from scratch.
Personality
The configuration of characteristics and behavior make up a persona’s unique personality and behavior.
Think about a character’s background and their motivations for what they do and how they interact with the world around them.
You can also use Verse to modify your LLM-character's personality at runtime with the Personality variable, which can be treated as a Getter and Setter.
# Declare the Message that we will add to the Personality at runtime
PersonalityAddition<localizes>:message = "Here are my new orders for you, Persona"
# Declare a separator we will use later when we Join() our two Messages. This will be inserted between the two Messages
MessageSeparator<localizes>:message = "\n"
persona_npc_behavior := class(npc_behavior):
# This function takes a Message and adds it to the current Personality of the NPC that is running this behavior
ModifyPersonality(Addition:message):void=
if:
To learn more, see Add an NPC to a Conversation.
For example, to create a Fortune Teller persona, you could add the following prompts:
Personality Traits:
Your name is Gizellda.
You have an air of mystery about you.
You are perceptive and thoughtful.
Telling the future isn’t just a job, you feel a duty to impart knowledge and understanding to your clients.
You speak in riddles when you greet clients.
Humor Style:
You have a sharp, dry wit. The funniest lines are the ones that you deliver when greeting customers.
When a client’s future isn’t clear you blame the stars. (Orion is drinking from the Big Dipper at the moment. I can’t see much beyond that.)
Character Bio:
You predict a player's fortune when asked for a prediction.
You are a helpful, kind fortune teller.
You grew up in the desert. (If the player mentions anything about the desert, recite a haiku about the beauty of the desert.)
Physical Description:
You wear a fringed bandana on your head. You wear an ankle length flowy dress.
You’re a woman in her forties.
Add this personality and fact information to your NPC Persona and see how the response changes.
Voice Models
The Persona Modifier provides a way to create a unique voice for your NPC character through the Default Voice. When you use a Fortnite character, you can listen to the character’s voice by selecting the Play button.
To create a custom voice for your LLM character, think about how the character talks. This can be broken into two categories; vocal tone and communication style.
Vocal tone is often called timbre, it refers to the perceived quality of a sound. Think of it as the unique voice every person has that comes from physical and genetic characteristics. These characteristics shape the voice and give it color.
Communication style refers to the characteristics of how information is communicated. This includes how a person or character receives information, responds to conflict and feedback, as well as how ideas are shared.
Below are examples of vocal tone and communication style.
Vocal Tone | Communication Style |
Pitch | Passive / Caring |
Tone | Combative / Calm |
Cadence | Dismissive / Sympathetic |
Emphasis | Assertive / Unsure |
Accent | Coherent / Incoherent |
Sing-song | Truthful / Untrustworthy |
Monotone | Clear and concise / Rambling and vague |
The more detail you provide for how the voice should sound and how the character communicates, the more believable your character will be in the role they play in your game.
To see a complete list of the available Fortnite Characters and each character’s communication style and vocal tone, see the Fortnite Character section below.
Structured Output
You have further control over how your LLM character interacts with players through Structured Output tab in the Prompt Editor. Structured Output provides a way to add more structs to your LLM’s behavior script. These structs determine how the LLM character answer questions. This is important because LLM characters answer differently depending on the player’s input (voice versus type).
You want to ensure that the LLM’s response to voice is accurate, and can return multiple structured outputs at once in the code, but not in the Prompt Editor.
An example use case would be locking gameplay behind an LLM character. To determine whether a player knows the secret password, or knows the answer to a riddle. The struct is then used in a RegisterAction() function that queries the player’s progress level. Based on the query results the LLM character denies or provides access to the gameplay.
To create a struct using the Prompt Editor, do the following:
Select Structured Output in the Prompt Editor tool.
Select the +Add button to add the struct field.
Select the + button to add a struct to the character.
Select the Struct field and choose a struct type from the struct dropdown menu.
Add a variable to your struct type in the empty field that appears. This variable can be queried to provide functionality or trigger events.
In your Verse script you can refer to these character’s structs or add structs directly in the code.
Export Persona Data to Verse File
The Prompt Editor also provides a way to export your struct data to a Verse file. This creates a public struct in the form of a module for a character. This file can be shared or used across projects.
To export your Structured Output to a Verse file, do the following:
Select the Export icon in the Prompt Editor toolbar.
Select a folder for the Verse file.
When the file exports into the folder it will be named, personaname_YOURLLMNAMEHERE.verse.