Skip to content

Choices System

Last Updated: 2025-01-16
Primary Source: docs/project_status.md
Service File: backend/src/services/aso.service.ts


Overview

The Choices System enables the AI Director to dynamically generate choice options, giving players agency in the narrative and allowing the story to branch based on player decisions.


Architecture

Choice Generation Flow


Choice Format

AI Director Command

Tool Command:

json
{
  "choices": [
    "Option 1: Accept the quest",
    "Option 2: Decline politely",
    "Option 3: Ask for more information"
  ]
}

Response Format

NpcResponse:

typescript
{
  text: "Here are your options:",
  choices: [
    "Option 1: Accept the quest",
    "Option 2: Decline politely",
    "Option 3: Ask for more information"
  ],
  sender: "Yexian"
}

Choice Processing

Frontend Display

Process:

  1. ASO response includes choices array
  2. Frontend displays choices as buttons
  3. User clicks choice
  4. Choice sent as user message
  5. ASO processes choice and continues narrative

Memory Storage

Process:

  1. User's choice stored in memory
  2. Choice context included in future conversations
  3. ASO remembers player's decisions
  4. Narrative adapts based on choices

Narrative Impact

Branching Narrative

Concept: Choices influence:

  • Story direction
  • Relationship development
  • Quest availability
  • Character reactions
  • Future dialogue options

Choice Consequences

Examples:

  • Accepting quest → Quest starts
  • Declining quest → Alternative path
  • Asking questions → More information revealed
  • Emotional choices → Relationship flags set

Integration with Other Systems

Quest System

  • Choices can trigger quest offers
  • Choices can complete quest objectives
  • Quest choices affect story progression

Relationship System

  • Choices can set relationship flags
  • Emotional choices impact relationship level
  • Choices remembered in relationship context

Timeline System

  • All choices recorded in timeline
  • Choice history visible in timeline
  • Choices contribute to narrative progression

Source Files

Primary Sources:

  • backend/src/services/aso.service.ts - Choice generation in ASO
  • backend/src/types/types.ts - NpcResponse type definition

ASO Universal Consciousness System Documentation