Scenario
Online game with AI-driven NPC dialogue and dynamic quests that adapt to each player’s style and choices.Extraction
From gameplay events and chat with NPCs, GetProfile tracks:play_style: stealthy, aggressive, completionist, explorerrisk_tolerance: likes high-risk high-reward vs safe pathsstory_preferences[]: political intrigue, romance, horror, humormoral_alignment: tends to spare enemies vs ruthless choices
Injection
Before generating NPC dialog or a quest:-
Game server calls the LLM through GetProfile:
- It injects the player profile:
- “Player is an explorer completionist who loves political intrigue, hates horror, usually plays ‘good’ moral options.”
- It injects the player profile:
-
It injects a few key story memories:
- important past quests,
- big choices they made.
Impact
- NPCs comment on the right past events.
- Quest offers and story beats match their style and morals.
- Same system works across multiple AI features (quests, barks, codex entries) via a shared profile.
Implementation
Trait Schema Example
Related Resources
Memories API
Store quest completions and significant player choices
Traits API
Update player traits based on gameplay events