title | aliases | tags | created | updated | |||||
---|---|---|---|---|---|---|---|---|---|
AI Game Master Logic |
|
|
2024-12-28 |
2024-12-28 |
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]].
- 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]].
- 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
- 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]].
- Maintain a small-scale world state (one town and immediate surroundings)
- Manage simple time progression (day/night cycle)
- 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]].
- 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]].
- Maintain a limited context of recent game events and player actions
- Implement a simple summarization mechanism to keep context within token limits
- Adopt a consistent, neutral tone for narration
- Use basic Western-themed language and terminology
For theme guidelines, see [[training-data/western-themes|Western Themes]].
- Implement simple checks to ensure narrative consistency
- Maintain a basic log of key decisions and events
- Implement basic keyword matching for player inputs
- Provide clarification prompts for ambiguous inputs
- Implement basic checks for AI-generated content relevance
- Use predefined fallback responses for unsuitable AI outputs
- Implement basic error messages for API timeouts or failures
- Guide players through a simplified character creation process
- Generate basic starting equipment
For character creation details, see [[../features/_completed/character-creation|Character Creation]].
- Implement basic skill checks using simplified Boot Hill rules
For rules reference, see [[../boot-hill-rules/base-numbers|Base Numbers Calculation]].
- Manage simplified turn-based combat
- Resolve basic attacks and damage
For combat implementation, see [[../core-systems/combat-system|Combat System]].
- 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]].
- 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]].
- 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]].
- Implement basic caching for frequently used game data
- Optimize prompt construction to minimize token usage
- 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.