In the Conversations template, the gameplay centers around the player bartering with the LLM and trying to find a price the LLM is willing to accept for the vehicle.
The pages here provide insight to various functions available in the Conversations features, including:
How to use an LLM as a central part of a game’s mechanics by showing how to spawn random NPCs with one NPC Spawner device.
How to use an LLM as a gameplay element, code LLM behavior, and use the LLM dialog in the user interface (UI).
How to create captions for the LLM character’s dialog.
You can control how the LLM formulates responses and makes decisions by engineering prompts and using Structured Output in your code that the LLM reads as instructions.
In the Conversations template, the persona_component provides instructions for how the LLM responds to player interactions by making decisions based on the example’s Structured Output. The script then takes the LLM’s response output and passes the text between the persona_behavior device and the ui_manager device to display the LLM’s dialog in a closed-caption box in the HUD.
The template and companion documents are for developers at any skill level.
To begin, in Unreal Editor for Fortnite (UEFN), open the Feature Examples section of the Project Browser and select the Conversations Template project.
The project elements are packaged in the content browser. Explore the template folders and files to learn more about creating random NPC characters and a custom-captioned UI:
CharacterDefinitions folder: Includes one Character Definition.
UIAssets folder: Includes two UserWidgets that contain the UI designs for the catalog and captions.
persona_behavior Verse Class: A script that contains the instructions and parameters for the buyer personas and gameplay.
ui_manager Verse Class: A script that controls the UI and captions.
Each page below is independent of the other pages. Click the topic you're interested in knowing more about.