An AI-powered text adventure game that uses a hexagonal grid for movement and exploration. The game combines modern AI capabilities with classic text adventure mechanics.
- Hex-based World: Explore a world built on a hexagonal grid, offering six directions of movement
- AI-Driven Narrative: Uses Cohere's RAG-enabled AI for dynamic storytelling and world building
- Persistent World: Game state is stored in SQLite and ChromaDB for seamless continuation
- Natural Language Interface: Interact with the game using natural language commands
- Rich World Lore: Ask questions about the world and get AI-generated, contextually relevant answers
- Install dependencies:
pip install -r requirements.txt
- Set up your Cohere API key:
export COHERE_API_KEY='your-api-key-here'
- Run the game:
streamlit run game_ui.py
-
Basic Commands:
look around
: Examine your current locationwalk [direction]
: Move in any of six directions (north, northeast, southeast, south, southwest, northwest)examine [object]
: Look at something specificask: [question]
: Ask about the world's lore
-
Movement:
N NW ╱╲ NE SW ╲╱ SE S
-
Special Commands:
- Start questions with "ask:" to query the game's lore system
- Use natural language for actions
game_engine.py
: Core game logic and AI integrationgame_ui.py
: Streamlit-based user interfacetest_game.py
: Test cases for game functionalitygame.db
: SQLite database for game state (created automatically)
- Uses Cohere's Command-R model for RAG-enabled AI responses
- Combines SQLite for game state with ChromaDB for vector storage
- Implements thread-safe database access
- Provides citation support for lore answers
MIT License