Skip to content

Latest commit

 

History

History
141 lines (99 loc) · 5.42 KB

game-master-logic.md

File metadata and controls

141 lines (99 loc) · 5.42 KB
title aliases tags created updated
AI Game Master Logic
AI GM Logic
Game Master System
ai
core-system
mvp
2024-12-28
2024-12-28

AI Game Master Logic (MVP)

Overview

The AI Game Master (GM) is the core component of BootHillGM, responsible for creating and managing the game world, narrating the story, and facilitating player interactions within a simplified Boot Hill RPG framework. This document outlines the essential logic for implementing the AI GM in the MVP version.

For implementation details, see [[gemini-integration|Gemini Integration]].

Core Functions (MVP)

Narrative Generation

  • Create a linear main storyline with minimal branching
  • Generate basic descriptive text for locations, characters, and events
  • Adapt narrative based on limited player choices
  • Theme analysis system for contextual storytelling
  • Automatic theme detection from player actions
  • Enhanced prompts incorporating relevant Western themes

For prompt details, see [[prompt-engineering/storytelling|Storytelling Prompts]].

Character Interaction

  • Generate simple NPC dialogues based on predefined personality types
  • Respond to player inputs using pattern matching and predefined responses
  • Maintain basic consistency in NPC behavior throughout a game session

Game Mechanics Implementation

  • Interpret and apply simplified Boot Hill RPG rules
  • Manage basic skill checks and simplified combat resolution
  • Track and update essential game state (character stats, inventory, quest progress)

For rules implementation, see [[../boot-hill-rules/combat-rules|Boot Hill Combat Rules]].

World Management

  • Maintain a small-scale world state (one town and immediate surroundings)
  • Manage simple time progression (day/night cycle)

Journal Management

  • Generate narrative summaries for player actions
    • Input: Raw player action (e.g., "drink health potion")
    • Output: Narrative summary (e.g., "CHARACTER_NAME drank his last health potion")
  • Ensure summaries are concise (1-2 sentences)
  • Include relevant context (e.g., "last health potion" if it's the last one)
  • Use character name and appropriate pronouns

For journal system details, see [[../core-systems/journal-system|Journal System]].

AI Model Integration

Prompt Engineering

  • Design a set of base prompts for common game scenarios (e.g., dialogue, exploration, combat)
  • Include simplified Boot Hill RPG rules and Western setting details in prompts
  • Implement a basic system to construct prompts based on current game state

For prompt templates, see [[prompt-engineering/core-prompts|Core Prompts]].

Context Management

  • Maintain a limited context of recent game events and player actions
  • Implement a simple summarization mechanism to keep context within token limits

Game Master Personality

Tone and Style

  • Adopt a consistent, neutral tone for narration
  • Use basic Western-themed language and terminology

For theme guidelines, see [[training-data/western-themes|Western Themes]].

Consistency

  • Implement simple checks to ensure narrative consistency
  • Maintain a basic log of key decisions and events

Error Handling and Fallback Mechanisms

Input Interpretation

  • Implement basic keyword matching for player inputs
  • Provide clarification prompts for ambiguous inputs

Output Validation

  • Implement basic checks for AI-generated content relevance
  • Use predefined fallback responses for unsuitable AI outputs

Connection Issues

  • Implement basic error messages for API timeouts or failures

Boot Hill RPG Specific Logic

Character Creation

  • Guide players through a simplified character creation process
  • Generate basic starting equipment

For character creation details, see [[../features/_completed/character-creation|Character Creation]].

Skill Checks

  • Implement basic skill checks using simplified Boot Hill rules

For rules reference, see [[../boot-hill-rules/base-numbers|Base Numbers Calculation]].

Combat System

  • Manage simplified turn-based combat
  • Resolve basic attacks and damage

For combat implementation, see [[../core-systems/combat-system|Combat System]].

Web Application Considerations

State Management

  • Utilize React Context for managing essential game state
  • Implement basic state updates to reflect game progress

For state management details, see [[../core-systems/state-management|State Management]].

API Integration

  • Use Next.js API routes for fundamental AI interactions
  • Implement basic error handling for API calls

For API details, see [[../architecture/api-integration|API Integration]].

User Interface

  • Generate text-based responses for rendering in the UI
  • Provide simple formatted output (e.g., character stats, inventory lists)

For UI implementation, see [[../architecture/ui-wireframes|UI Wireframes]].

Performance Considerations

Response Time Optimization

  • Implement basic caching for frequently used game data
  • Optimize prompt construction to minimize token usage

Memory Management

  • Implement efficient storage of essential game state
  • Regularly clear non-essential information from the AI context

This document serves as a guide for implementing the core AI Game Master functionalities in the MVP version of BootHillGM. The focus is on essential features to create a functional and enjoyable basic game experience.