- 🧙 AI Dungeon Master — A GPT-powered DM that builds your world, quests, and encounters in real time.
- 🧝 Custom Characters — Choose your race, class, and level. Auto-stats, inventory, and spells included.
- 🗺️ Dynamic World — NPCs, quests, and locations spawn based on your choices.
- ⚔️ Turn-Based Combat — With initiative tracking, enemy HP, and battle narration.
- 💾 Save and Resume — Pause anytime and pick up your journey later.
- 🎮 Streamlit UI — A modern, real-time interface with zero setup.
- Python 3.8+
- OpenAI API Key
git clone https://github.com/yourusername/dungeonlm.git
cd dungeonlm
pip install -r requirements.txt
Either input in the app sidebar or:
export OPENAI_API_KEY=your-api-key
streamlit run dungeonlm.py
- Select Provider → Use OpenAI and choose your model (gpt-4o, gpt-4-turbo, etc.)
- Create Campaign → Set a title, setting, and theme.
- Build Character → Choose name, race, class, and level.
- Start Adventure → Let the AI narrate, challenge, and surprise you.
- Combat → Initiative, turns, strategy — full D&D-style battles.
- Save Anytime → Store your campaign in one click and resume later.
- Automatically creates and connects locations like forests, villages, caves, etc.
- NPCs are dynamic with names, traits, and attitudes (friendly, hostile, neutral).
- ASCII minimap shows your current position and surroundings.
- Quest system tracks tasks, rewards, and status (active, completed).
- 🧠 LLM: OpenAI GPT (gpt-4o, gpt-3.5, etc.)
- 🖥️ Frontend: Streamlit
- 🐍 Backend: Python (all-in-one script)
- 🧳 Storage: JSON Save Files
- 🎨 Rendering: ASCII-style minimaps and battle displays
dungeonlm.py # All logic and UI
README.md # You're reading it!
requirements.txt # Dependencies
- 🗣️ Add voice commands or text-to-speech narration
- 👥 Expand to support co-op multiplayer
- 🧙 Add magic schools, item crafting, or divine blessings
- 🛡️ Visualize characters with avatar generators
- 💬 Include memory or journaling for previous choices
🎲 DungeonLM brings the magic of tabletop roleplaying to your screen — driven by imagination and AI.