AI Prompt: Fantasy Terminal Learning Game Architecture¶
Project Overview¶
Create an interactive terminal-based learning game that teaches command line skills through a fantasy RPG experience. The application should blend authentic terminal simulation with engaging gameplay mechanics, progressive skill building, and AI-powered dynamic content generation.
Core Concept¶
Vision: Transform the intimidating command line interface into an approachable, magical learning environment where users master terminal skills by completing quests, casting "spells" (commands), and exploring dynamic worlds.
Learning Philosophy: - Commands are "spells" that users learn through discovery - Each quest introduces 1-2 related commands in logical progression - Success builds confidence through immediate positive feedback - Fantasy theme removes technical intimidation
System Architecture¶
1. Application Shell & Layout¶
Main Container Structure:
┌─────────────────────────────────────────────────────┐
│ HEADER: Game Title + Mode Toggle + Quick Stats │
├─────────────────────────────────────────────────────┤
│ TOP BAR: Active Quest Display (Collapsible) │
├───────────────┬─────────────────────────────────────┤
│ SIDEBAR: │ MAIN TERMINAL AREA: │
│ - Navigation │ - Command History │
│ - Components │ - Input Field │
│ - AI Status │ - Auto-completion │
│ │ - Response Processing │
├───────────────┴─────────────────────────────────────┤
│ BOTTOM BAR: AI Companion (Toggleable) │
└─────────────────────────────────────────────────────┘
Responsive Behavior: - Sidebar collapses on mobile with floating triggers - Quest bar can be minimized to save space - AI companion slides up from bottom when activated - Terminal takes full width when sidebar is collapsed
2. Core Components Architecture¶
A. Game State Manager¶
Responsibilities: - Persistent progress tracking (XP, completed quests, learned commands) - Player profile and current location - Save/load game functionality - Session continuity across browser refreshes
State Structure:
GameState:
- currentQuest: index or ID
- completedQuests: array of quest IDs
- learnedCommands: array of mastered commands
- currentLocation: path string
- playerName: optional string
- experience: number
- sessionHistory: terminal interaction log
B. Quest System¶
Classic Mode (Structured): - Predefined quest progression - Fixed objectives and rewards - Linear skill building path - Consistent difficulty curve
Dynamic Mode (AI-Generated): - Adaptive quest creation based on progress - Personalized challenges - Infinite content generation - Context-aware objectives
Quest Object Structure:
Quest:
- id: unique identifier
- title: display name
- description: narrative context
- objective: clear instruction
- requiredCommands: array of commands to learn
- reward: description of what's unlocked
- completed: boolean status
C. Terminal Simulation Engine¶
Core Functions: - Command parsing and validation - Output generation with themed responses - Command history and auto-completion - Tab completion similar to real terminals - Error handling with educational feedback
Command Processing Pipeline: 1. Input capture and parsing 2. Validation against learned commands 3. Context-aware response generation 4. Progress tracking and quest checking 5. Output rendering with appropriate styling
Output Types:
- command: User input display
- output: Standard command results
- success: Positive feedback (green)
- error: Error messages with hints (red)
- info: Informational messages (blue)
- magic: Special game events (gold)
D. AI Agent System (Dynamic Mode)¶
Multi-Agent Architecture: Five specialized AI agents work collaboratively:
- Quest Generator Agent
- Creates personalized challenges
- Adapts to player skill level
-
Ensures progressive difficulty
-
World Builder Agent
- Generates explorable directory structures
- Creates themed file systems
-
Populates locations with interactive content
-
Narrative Master Agent
- Crafts engaging storylines
- Maintains consistent fantasy theme
-
Personalizes dialogue and descriptions
-
Reward Crafter Agent
- Designs meaningful progression rewards
- Balances incentive structures
-
Creates collectible items and abilities
-
Challenge Designer Agent
- Calibrates difficulty curves
- Creates diverse objective types
- Ensures accessibility for all skill levels
Agent Configuration: - Creativity levels (conservative to experimental) - Difficulty preferences - Narrative style settings - Content generation frequency
3. User Interface Components¶
A. Start Screen System¶
Classic Game Menu: - New Game (with optional name input) - Load Game (if save data exists) - Settings (AI configuration, preferences) - Help (tutorial and command reference)
Mode Selection: - Classic Mode: Structured quest progression - Dynamic Mode: AI-powered adaptive content
B. Quest Management Interface¶
Top Quest Bar Features: - Currently active quest display - Progress indicators - Quick stats (XP, completed quests, learned commands) - Minimize/expand controls - Mode-specific indicators (AI generation status)
Quest Log Views: - Active objectives - Completed quest history - Reward tracking - Progress visualization
C. Navigation Sidebar¶
Core Sections: - Spell Book: Library of learned commands with descriptions - World Explorer: Dynamic environment browser (Dynamic mode) - Inventory System: Collected items and rewards (Dynamic mode) - AI Companion Access: Help system toggle - Test Dashboard: Development and testing tools
AI Component Indicators: - Agent status display - Generation activity monitoring - Mode-specific tools and controls
D. AI Companion System¶
Companion Personality: - Name: Merlin (wise wizard persona) - Behavior: Helpful but not intrusive - Responses: Contextual to current situation
Help Capabilities: - Command syntax assistance - Quest objective clarification - General terminal concept explanation - Encouragement and motivation
Interface Design: - Bottom-mounted slide-up panel - Always accessible via quick buttons - Non-blocking interaction model - Conversation history
4. Learning Progression System¶
A. Command Mastery Tracking¶
Spell Book Metaphor: - Commands are "spells" to be learned - Each successful use reinforces knowledge - Visual progression indicators - Command categorization (navigation, file manipulation, etc.)
Skill Progression:
Beginner: ls, pwd, cd
Navigation: cd, pwd, ls -la
File Operations: touch, mkdir, rm, cp, mv
Text Manipulation: cat, grep, head, tail
Advanced: find, pipe operations, scripts
B. Experience and Rewards¶
XP System: - Base XP per quest completion (100 XP) - Bonus XP for exploration and discovery - Milestone rewards at XP thresholds
Reward Types: - New command unlocks ("spell learning") - Cosmetic achievements - Story progression unlocks - Dynamic content access
5. Testing and Quality Assurance¶
A. AI Testing Framework¶
Automated Testing Agent: - Simulates real user interactions - Tests both Classic and Dynamic modes - Validates all UI components - Generates comprehensive reports
Testing Categories: 1. Classic Mode Testing: Structured quest completion 2. Dynamic Mode Testing: AI content generation validation 3. UI Component Testing: Interface interaction validation
Virtual Machine Concept: - AI agent interacts with virtual terminal instance - Live monitoring of AI decision-making - Real-time test result visualization - Session persistence for review
B. Test Dashboard¶
Metrics and Analytics: - Success/failure rates - Performance measurements - User journey mapping - Component coverage analysis
Live Monitoring: - Real-time AI agent actions - Test step progression - Error detection and logging - Interactive result exploration
6. Technical Implementation Patterns¶
A. State Management¶
Persistent Storage: - Use key-value storage for game state - Session-based storage for terminal history - Settings persistence across sessions
State Synchronization: - Component state updates via callbacks - Centralized game state management - Reactive updates for UI components
B. AI Integration¶
Prompt Engineering: - Structured prompt templates - Context injection for personalization - Error handling for AI failures - Response validation and formatting
Content Generation: - On-demand quest creation - World state persistence - Content caching for performance - Validation of generated content
C. User Experience Patterns¶
Progressive Disclosure: - Start with basic commands - Gradually introduce complexity - Context-sensitive help - Optional advanced features
Feedback Systems: - Immediate visual feedback - Audio cues for important events - Progress visualization - Achievement notifications
7. Accessibility and Inclusivity¶
A. Learning Accommodations¶
Multiple Learning Styles: - Visual progress indicators - Audio feedback options - Hands-on interactive learning - Reference materials access
Difficulty Adaptations: - Adjustable challenge levels - Hint system availability - Command reference integration - Error recovery guidance
B. Technical Accessibility¶
Interface Design: - High contrast color schemes - Readable font choices - Keyboard navigation support - Screen reader compatibility
8. Extension and Customization¶
A. Content Expansion¶
Modular Quest System: - Easy addition of new quest chains - Theme variations (sci-fi, modern, etc.) - Community content integration - Localization support
B. AI Customization¶
Agent Configuration: - Personality adjustments - Content style preferences - Difficulty calibration - Generation frequency controls
Implementation Considerations¶
Technology Stack Recommendations¶
- Frontend Framework: Modern reactive framework (React, Vue, Svelte)
- Styling: Utility-first CSS framework (Tailwind CSS)
- State Management: Built-in state with persistence hooks
- AI Integration: LLM API integration with prompt templates
- Testing: Automated testing framework with AI agent simulation
Performance Optimization¶
- Code Splitting: Load components on demand
- Caching: AI-generated content caching
- Memory Management: Efficient terminal history handling
- Responsive Design: Mobile-first approach
Security Considerations¶
- Input Validation: Sanitize all user inputs
- AI Safety: Content filtering and validation
- Data Privacy: Secure storage of user progress
- Error Handling: Graceful degradation for failures
Success Metrics¶
Learning Effectiveness¶
- Command retention rates
- Quest completion statistics
- User engagement duration
- Skill progression speed
User Experience Quality¶
- Session length and return rates
- Error recovery success
- Help system usage patterns
- Feedback sentiment analysis
Technical Performance¶
- Response time measurements
- AI generation success rates
- System reliability metrics
- Cross-platform compatibility
This architectural framework provides a comprehensive foundation for building an engaging, educational terminal game that successfully bridges the gap between intimidating command-line interfaces and accessible learning experiences through gamification and AI-powered personalization.