A Python implementation of the Scoundrel card game
Project description
📋 Table of Contents
🎮 The Game
Scoundrel is a dungeon-crawling card game where players navigate through rooms, collect cards, and battle monsters.
🎯 Playing the Game
play [--seed SEED]
Play interactively in the terminal. Use --seed for deterministic deck shuffling (same seed = same game sequence).
🚀 Quick Start
# Clone the repository
git clone https://github.com/Lizzard1123/scoundrel.git
cd scoundrel
# Create conda environment
conda env create -f environment.yml
conda activate scoundrel
# Install package
pip install -e .
# Play the game
play
⚙️ Setup
Using Conda (Recommended)
conda env create -f environment.yml
conda activate scoundrel
pip install -e .
🤖 Agent Approaches
This implementation includes two AI agent approaches for playing Scoundrel:
🌳 MCTS Agent
Monte Carlo Tree Search agent with parallelization support for high-performance gameplay.
Features:
- ⚡ Parallel simulation workers
- 🧠 Transposition table caching
- 📊 Performance visualization tools
- 🎯 Configurable exploration parameters
Console Scripts:
| Command | Description |
|---|---|
mcts |
Watch the MCTS agent play interactively |
mcts-eval |
Evaluate MCTS agent performance |
mcts-plot |
Visualize MCTS episode performance |
Usage Examples:
# Interactive gameplay
mcts --num-simulations 1000000 --num-workers 8
# Performance evaluation
mcts-eval --num-games 10 --verbose
# Episode visualization
mcts-plot --num-simulations 1000000 --batch 5 --confidence
Interactive MCTS visualizer showing real-time gameplay
Average outlook of the action picked at each turn
MCTS performance variability across multiple runs (6 out of 10 runs won)
🎯 MCTS Data Collection (AlphaGo Style)
MCTS data collection pipeline for training AlphaGo-style neural network agents with supervised learning from expert gameplay.
MCTS data collection showing game statistics and performance distribution
Data Collection Results:
Games: 5041
Statistics:
Wins: 1316 (26.11%)
Average score: -21.45
Best score: 30
Worst score: -188
Average turns per game: 42.8
Total turns: 215803
🧠 RL Agent
Reinforcement learning agent using a Transformer-based architecture with PPO training.
Features:
- 🔄 Transformer encoder for sequence planning
- 🎯 MLP for immediate tactical decisions
- 📈 TensorBoard integration
- 💾 Checkpoint management
Training:
cd scoundrel/rl/transformer_mlp/scripts
./train.sh
🛠️ Development
Running Tests
pytest
Code Formatting
black .
isort .
Project Structure
scoundrel/
├── game/ # Core game logic
├── models/ # Game state models
├── rl/ # AI agents
│ ├── mcts/ # MCTS implementation
│ └── transformer_mlp/ # RL agent
└── ui/ # Terminal UI
Made with ❤️ for card game enthusiasts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scoundrel-0.1.0.tar.gz.
File metadata
- Download URL: scoundrel-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed88f1335e0673685cb4e98fd4b982c4427f04a4553daab43d95ff005507a3f
|
|
| MD5 |
118b0d6bf3ed4450ef1c64e956b2397e
|
|
| BLAKE2b-256 |
e98a264d3fd09a4265509d3e775c52807edb0308b10c1e36899d771f5cf1e2c3
|
File details
Details for the file scoundrel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scoundrel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3585d937aaef43d6ec95a1e13415d9960102f462e5bd2df7aabc44eb01220231
|
|
| MD5 |
ec7c7a9ee3d567c504e1e108d80b542c
|
|
| BLAKE2b-256 |
dfd51b3b98d445f68f153fd1a3a1f2f2c911aeb59fa57868d59dba888ac6fcb9
|