LLM characters can be used in their default state, or defined and guided in the editor by using prompts. The LLM can be further redefined at runtime using Verse not only to drive a story forward with spontaneous dialog, but to become an integral part of your game’s core mechanics.
Read the Conversation Template Companion Pages for a complete understanding of what each companion page contains and how it can help you use LLMs in your game development.
Default Characters vs Scripted LLM Characters
The Character Definition provides access to multiple default Fortnite characters.
Default characters are good for experiences where you want a Fortnite LLM character with a set personality, but can still have unscripted interactions and dialog, such as with an NPC companion.
Some Fortnite characters are hardcoded and cannot be changed. For a full list see Developing Personas.
The Conversations template uses Structured Output to narrow parameters and provide instructions the LLM uses in its interactions and dialog throughout the gameplay.
Using an LLM as a central gameplay mechanic is achievable with Structured Output. Structured Output provides a way to bind your own functions to specific situations or responses. These bindings use structs that you define to pass variables from the response to the bound function when the specified criteria is met. You determine the type of variable, when the variable should be assigned, and how it should be assigned within the struct's variable description.
Once the LLM ingests the Structured Output, it responds to players based on these bindings. The structs that the LLM reads can also be used to advance gameplay by telling the LLM what to do under certain circumstances.
Structs create the parameters that the LLM uses to determine interactions with players. For example, a garage mechanic NPC uses structs to determine how many items it must receive from a player before granting the player a vehicle. You can also achieve and fine-tune this type of functionality with Verse.
Randomized LLM Characters
You can use randomized characters with default Fortnite characters or with scripted personas.
To use random LLM characters select, Cosmetic Modifier > CharacterLook > Random Fortnite Character in the Character Definition.
In the template, all random characters are assigned in the NPC Spawner as a modifier. Verse uses the function ChooseCharacter() to randomly select a buyer persona and assign the persona to the NPC Spawner.
The LLM uses a mapping system to inform its choices and create the NPC’s dialog, as well as build a background story during the character introduction.
For example, this can include information about what vehicle type a character is shopping for, and their budget.
During gameplay, the LLM receives information from the player and instructions from the Verse code. This results in unique interactions between players and NPCs. The player tries to persuade the NPC to make a deal on a car and tries to get the most money the NPC is willing to pay. The LLM is triggered to take the offer based on the instructions in the Verse code and the vehicle information the player provided.
Structured Output: Data for Interactions
Verse uses Structured Output to provide additional data to the LLM to drive gameplay through Verse based on the LLM’s responses. The LLM fills out the struct’s variables based on the ai_description you provide. The structs use variables to define the parameters of gameplay with one or more of the following struct types:
logic- Used in logical reasoning that handles true and false values or ranking. For example:Searching players for necessary data to continue or complete a task.
Rank players based on whether they have passed a milestone.
int- Numbers that can be used to make decisions. For example:Determine the number of items players need.
The total cost of an item the LLM character holds.
float- A range of numbers that can be used to make decisions.For example:Determine player ranking.
Select a random number within a given range.
message- Can be applied as a classification for certain data or information. For example:A secret password.
A description for how the LLM character is supposed to react to certain stimuli.
Each page below is independent of the other pages. Click the topic you're interested in knowing more about.