Skip to content

Latest commit

 

History

History
122 lines (96 loc) · 2.79 KB

File metadata and controls

122 lines (96 loc) · 2.79 KB

Adventure Game

A fantasy role-playing game powered by Large Language Models (LLMs). This game combines traditional RPG mechanics with AI-driven storytelling and character interaction.

Features

  • AI-powered character creation and interaction
  • Dynamic storytelling and world-building
  • Traditional RPG mechanics (combat, skills, spells)
  • Save/load game state
  • Self-play mode for AI-driven gameplay

Installation

  1. Clone the repository:
git clone https://github.com/dansommerfield/adventure.git
cd adventure
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the package in development mode with all dependencies:
pip install -e ".[dev]"
  1. Configure Azure Key Vault:

Usage

Start a new game:

python -m adventure.main --player player.txt --scenario scenario.txt

Load a saved game:

python -m adventure.main --load-game character_name_20240321_123456.sav

Enable debug mode:

python -m adventure.main --player player.txt --scenario scenario.txt --debug

Enable self-play mode:

python -m adventure.main --player player.txt --scenario scenario.txt --self-play

Use a different LLM endpoint:

python -m adventure.main --player player.txt --scenario scenario.txt --endpoint "https://your-endpoint"

Development

Running Tests

Run the test suite:

pytest

Run tests with coverage:

pytest --cov=adventure --cov-report=term-missing

Code Quality

Format code:

black .
isort .

Type checking:

mypy .

Linting:

ruff check .

Project Structure

adventure/
├── adventure/
│   ├── core/           # Core game logic
│   │   ├── __init__.py
│   │   ├── action.py   # Action resolution
│   │   ├── character.py # Character management
│   │   └── game_state.py # Game state management
│   ├── llm/            # LLM client
│   │   ├── __init__.py
│   │   └── client.py   # LLM client implementation
│   ├── __init__.py
│   ├── logging.py      # Logging configuration
│   └── main.py         # Main entry point
├── tests/              # Test suite
│   ├── __init__.py
│   ├── conftest.py     # Test configuration
│   └── test_*.py       # Test modules
├── pyproject.toml      # Project configuration
└── README.md           # This file

License

This project is licensed under the MIT License - see the LICENSE file for details.