Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kernelshreyak/ai-rpg-text

AI Generated text adventure RPG with fully configurable mechanics
https://github.com/kernelshreyak/ai-rpg-text

dungeons-and-dragons langchain langchain-python rpg rpg-game text-adventure-game

Last synced: 25 days ago
JSON representation

AI Generated text adventure RPG with fully configurable mechanics

Awesome Lists containing this project

README

        

# AI RPG Text Adventure

This project is a text-based RPG adventure game driven by an AI Dungeon Master (DM). The DM generates a solo RPG adventure inspired from Dungeons & Dragons (DnD) rules, but with simplified mechanics. The player interacts with the game by typing commands, and the AI responds by advancing the story.

## Features

- AI-driven Dungeon Master to generate and control the game world. Uses the latest gpt-4o-mini for fast response
- Conversational Memory support to maintain conversation context throughout the game session.
- Simplified DnD mechanics for ease of play.
- Easy to use Web UI created using Streamlit
- Modify initial inventory, starting scenarios etc using prompts
- Configureable prompt templates to modify pre-defined game mechanics using text
- Save to and load game session using JSON

## Planned features
- Better object-oriented control of game mechanics
- Support for other LLMs

## Installation

1. **Clone the repository:**
```bash
git clone https://github.com/yourusername/ai-rpg-text-adventure.git
cd ai-rpg-text-adventure

2. **Create a virtual environment:**
```bash
python -m venv .venv
source .venv/bin/activate
```
3. **Install the dependencies:**
```bash
pip install -r requirements.txt
```
4. **Set up environment variables (for OpenAI or Google Gemini models):**
```bash
export OPENAI_API_KEY=""
export GOOGLE_API_KEY=""
```
## Usage
Run the game by executing the main script via streamlit:

```bash
streamlit run ai-rpg-text.py
```

![screenshot](./screenshot.png)