Skip to main content

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, explorer
  • risk_tolerance: likes high-risk high-reward vs safe paths
  • story_preferences[]: political intrigue, romance, horror, humor
  • moral_alignment: tends to spare enemies vs ruthless choices
All learned from in-game decisions and occasional user text.

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 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

Memories API

Store quest completions and significant player choices

Traits API

Update player traits based on gameplay events