Better DM - Enhanced Campaign Management System
Overview
Better DM is an advanced AI-powered Dungeon Master system that maintains a clear, comprehensive campaign roadmap from the very first interaction. Unlike traditional AI DMs that generate content reactively, Better DM proactively plans entire campaigns and intelligently adapts them based on player actions while maintaining story coherence.
Key Features
🗺️ Campaign Roadmap Management
- Complete Campaign Planning: Generates full campaign structure from the start
- Chapter & Scene Organization: Breaks down campaigns into manageable, structured segments
- Objective Tracking: Maintains clear goals and progression markers
- Dynamic Adaptation: Intelligently modifies the roadmap based on player choices
🤖 Advanced AI Integration
- Context-Aware Responses: Every response considers the full campaign context
- Roadmap Coherence: Ensures all AI responses align with the planned story arc
- Emergency Scenarios: Handles unexpected player actions gracefully
- Quality Assurance: Built-in response quality monitoring and improvement
📊 Progress Tracking
- Visual Progress Display: Clear indication of campaign advancement
- Real-time Updates: Roadmap updates reflect immediately in the UI
- History Tracking: Complete record of player choices and adaptations
- Save/Load System: Persistent campaign state management
🎮 Enhanced User Experience
- Intuitive Interface: Clean, modern design optimized for storytelling
- Campaign Setup Wizard: Guided campaign creation process
- Real-time Roadmap Viewing: Live campaign overview and progress tracking
- Export Capabilities: Save campaign logs and states for future reference
System Architecture
Core Components
1. Campaign Roadmap Manager (campaignRoadmap.js
)
Handles the creation, management, and adaptation of campaign roadmaps.
Key Features:
- Generates comprehensive campaign structures
- Tracks current position in the story
- Adapts roadmap based on player actions
- Maintains story coherence across adaptations
Structure:
Campaign Roadmap {
title: String,
theme: String,
overallGoal: String,
chapters: [{
title: String,
scenes: [{
title: String,
type: String, // combat, exploration, social, puzzle, story
objectives: Array,
difficulty: Number (1-10)
}]
}],
npcs: Array,
locations: Array,
plotThreads: Array,
emergencyScenarios: Array
}
2. Better DM AI (betterDMAI.js
)
The enhanced AI system that integrates roadmap management with intelligent response generation.
Key Features:
- Roadmap-aware response generation
- Automatic story progression tracking
- Emergency mode for off-track scenarios
- Quality assurance and response refinement
Core Methods:
initialize(campaignPrompt, characterInfo)
: Sets up the entire campaign
processPlayerAction(action, context)
: Handles player inputs with roadmap consideration
adaptToPlayerAction(action, result)
: Updates roadmap based on player choices
3. Better DM App (betterDMApp.js
)
The main application controller that manages UI, user interactions, and system coordination.
Key Features:
- Campaign setup wizard
- Real-time progress display
- Save/load functionality
- Export capabilities
Getting Started
1. Setup and Installation
- Open the Better DM system:
Open: better-dm/index.html in your web browser
- Configure AI API (if using external AI):
- Edit
betterDMAI.js
- Update the
getAPIKey()
method with your HuggingFace API key
- Modify AI model preferences if needed
2. Creating Your First Campaign
- Launch the Application
- Open
index.html
in a modern web browser
- Wait for the system to initialize
- Campaign Setup Wizard
- Campaign Prompt: Describe your desired campaign
Example: "A dark fantasy adventure where ancient evils stir beneath
a peaceful kingdom. The players must uncover a conspiracy that threatens
to plunge the world into eternal darkness."
- Character Information: Provide details about the character(s)
Example: "A level 3 Human Paladin named Sir Gareth, devoted to justice
and protecting the innocent. Has a personal vendetta against undead
creatures due to his village being destroyed by necromancers."
- Campaign Settings:
- Length: Short (3-4), Medium (6-8), or Long (10+) sessions
- Difficulty: Easy, Normal, Hard, or Epic
- Theme: Heroic Fantasy, Dark Fantasy, Mystery, etc.
- Campaign Generation
- Click “Generate Campaign & Start Adventure”
- Wait for the AI to create your comprehensive roadmap
- Review the generated opening story
3. Playing the Campaign
- Understanding the Interface
- Main Story Area: Where the narrative unfolds
- Input Area: Where you describe your actions
- Sidebar: Campaign progress and roadmap overview
- Roadmap Panel: Detailed view of the entire campaign structure
- Taking Actions
- Type your desired action in the input field
- Press Enter or click “Take Action”
- Watch as the AI responds with roadmap awareness
- Observe automatic progress tracking
- Monitoring Progress
- Current Chapter/Scene: Always visible in the sidebar
- Objectives: Current scene goals and requirements
- Full Roadmap: Click “View Full Roadmap” for complete overview
Advanced Features
Campaign Roadmap Adaptation
The system intelligently adapts the roadmap when players make unexpected choices:
- Automatic Detection: Recognizes when player actions deviate from expected paths
- Impact Analysis: Evaluates how choices affect the overall story
- Smart Adaptation: Modifies upcoming scenes while maintaining story coherence
- Emergency Scenarios: Provides backup content for completely unexpected situations
AI Response Signals
The AI uses special signals to communicate with the system:
[SCENE_COMPLETE]
: Indicates current scene objectives are met
[CHAPTER_ADVANCE]
: Suggests moving to the next chapter
[ROADMAP_UPDATE]
: Triggers roadmap adaptation
[EMERGENCY_MODE]
: Activates emergency scenario handling
Save and Export System
Campaign Saving:
- Complete campaign state preservation
- Roadmap progress and adaptations
- Full conversation history
- Character progression data
Export Options:
- Campaign logs in text format
- Roadmap structure as JSON
- Progress reports and statistics
Configuration Options
AI Configuration (betterDMAI.js
)
aiConfig: {
models: ['microsoft/GODEL-v1_1-large-seq2seq', ...],
temperature: 0.8, // Response creativity (0.1-1.0)
maxTokens: 300, // Response length limit
maxRetries: 3 // Retry attempts on failure
}
Roadmap Configuration (campaignRoadmap.js
)
roadmapTemplate: {
estimatedSessions: 6, // Default campaign length
difficultyProgression: 'gradual', // 'gradual', 'steep', 'plateau'
maxHistoryLength: 15 // Conversation memory limit
}
UI Configuration (betterDMApp.js
)
// Modify these values to customize the interface
maxRecentResponses: 5, // Number of recent responses to track
actionDebounceTime: 2000, // Milliseconds between actions
autoSaveInterval: 300000 // Auto-save every 5 minutes
Best Practices
For Campaign Creation
- Be Specific: Detailed prompts generate better roadmaps
- Include Character Motivation: Personal stakes improve story integration
- Set Clear Themes: Consistent themes lead to better narrative coherence
- Consider Player Agency: Leave room for player choice and creativity
For Playing Campaigns
- Engage with Objectives: Work toward scene goals for best experience
- Be Descriptive: Detailed actions receive richer responses
- Embrace Adaptation: The system adapts to your choices - be creative!
- Monitor Progress: Check the roadmap to understand story direction
For DMs Using the System
- Review Generated Roadmaps: Modify or guide the AI if needed
- Watch for Adaptation Points: Observe how player choices affect the story
- Use Emergency Scenarios: Don’t worry about players going off-track
- Save Regularly: Preserve good campaign states for reference
Troubleshooting
Common Issues
Campaign Won’t Generate:
- Check internet connection for AI API calls
- Verify campaign prompt is descriptive enough
- Try different theme/difficulty combinations
AI Responses Seem Off-Topic:
- Review current scene objectives
- Check if roadmap adaptation is needed
- Try more specific action descriptions
Progress Not Updating:
- Ensure scene objectives are being met
- Look for completion signals in responses
- Manually advance if stuck
For Better Response Times:
- Use shorter, more focused prompts
- Reduce conversation history length
- Consider simpler campaign themes
For Better Roadmap Quality:
- Provide detailed character backgrounds
- Include specific setting preferences
- Use consistent terminology throughout
API Reference
CampaignRoadmapManager
Methods
initialize(campaignPrompt, characterInfo)
: Initialize roadmap
getCurrentScene()
: Get current scene data
getCurrentChapter()
: Get current chapter data
progressStory()
: Advance to next scene/chapter
adaptToPlayerAction(action, result)
: Update roadmap based on action
getCampaignContext()
: Get formatted campaign context for AI
BetterDMAI
Methods
initialize(campaignPrompt, characterInfo)
: Setup AI system
processPlayerAction(action, context)
: Handle player input
getCampaignState()
: Get current campaign state
exportState()
: Export complete system state
importState(data)
: Import saved system state
BetterDMApp
Methods
startCampaign()
: Begin new campaign
submitPlayerAction()
: Process player input
showRoadmapModal()
: Display full roadmap
saveCampaign()
: Save current state
exportLog()
: Export conversation log
Development Notes
Extending the System
Adding New AI Models:
- Update the model list in
betterDMAI.js
- Adjust parameters for optimal performance
- Test with various campaign types
Customizing Roadmap Structure:
- Modify templates in
campaignRoadmap.js
- Update parsing logic for new fields
- Adjust UI display accordingly
Enhancing the Interface:
- Edit styles in
better-dm-styles.css
- Add new UI components in
betterDMApp.js
- Update HTML structure as needed
Future Enhancements
- Multi-player Support: Campaign sharing and collaboration
- Advanced Analytics: Detailed campaign statistics and insights
- Custom AI Training: Fine-tuned models for specific campaign styles
- Integration APIs: Connect with existing tabletop tools
- Voice Interface: Audio input/output for hands-free play
Contributing
To contribute to Better DM:
- Review the codebase structure
- Identify areas for improvement
- Test thoroughly with various campaign types
- Document any changes or additions
- Consider backward compatibility
License and Credits
Better DM builds upon the DiceTales foundation and represents an evolution in AI-powered campaign management. The system is designed to enhance storytelling while maintaining the collaborative spirit of tabletop RPGs.
Ready to create epic adventures? Start your Better DM experience today!