How thevilledev/batmud-ai-client works
Key Components to Include:
Core Application Components
• AI Integration component (Claude 3 Opus)
• Game Connection component for BatMUD interaction
• State Management system
Data Flow Architecture
• User Input → TUI → Game Logic
• Game Output → State Management → AI Processing → Game Input
• Logging System → File/Display Output
Top Level (User Interface)
• ┌─────────────────────────────────────┐
• Terminal UI │
• ┌─────────────┐ ┌─────────────┐ │
• Game View │ │ AI View │ │
• ┘ └─────────────┘ │
• ┌─────────────┐ │
• Debug View │ │
• ┘ │
• ┘
Middle Layer (Core Logic)
• ┌─────────────┐ ┌─────────────┐
• Game State │←→ │ AI Engine │
• Manager │ │ (Claude 3) │
• ┘ └─────────────┘
• ↑ ↑
• ┌─────────────┐ ┌─────────────┐
• BatMUD │ │ Config & │
• Connection │ │ Environment │
• ┘ └─────────────┘
Support Systems (Bottom Layer)
• ┌─────────────┐ ┌─────────────┐
• Logging │ │ Tools & │
• System │ │ Utilities │
• ┘ └─────────────┘
• Blue: User Interface components
• Green: Core game logic and state management
• Yellow: AI components
• Purple: External services (BatMUD connection)
• Gray: Support systems
Important Elements to Highlight:
State Flow
• How user inputs can interrupt or modify this flow
Configuration
• Environment variables configuration
• How different modes (login/create) affect the flow
Logging Architecture
• Demonstrate both file and display logging paths
• How debug information flows through the system
External Dependencies
• Anthropic API connection
• BatMUD server connection
Special Considerations:
Asynchronous Operations
• How the TUI updates independently of AI processing
State Management
• Game_state_length parameter
• How state is maintained and truncated
Error Handling
• Error flow paths
• How errors are logged and displayed
→ Synchronous data flow
⇢ Asynchronous data flow
□ Core component
◇ External service
○ Support system