Skip to main content

Claude Code Review

🧠 Quoridor-RL: A Multi-Agent RL Environment for the Quoridor Board Game

Quoridor-RL is a Python-based simulation environment for the Quoridor board game, compatible with the Gymnasium API and multi-agent RL training using Ray RLlib. It also includes a 3D interactive web viewer built with Three.js, and supports human interaction, imitation learning, and deployment on Hugging Face Spaces.

Quoridor Board

✨ Features

  • ✅ Fully rule-compliant 2- and 4-player Quoridor engine
  • ♻️ Multi-agent training support (Ray RLlib)
  • 🎮 Human-agent interaction mode
  • 📈 Episode logging for imitation learning
  • 🧠 Gymnasium-compatible environment
  • 🌐 3D visualization in the browser (Three.js)
  • 🚀 Hugging Face Space ready

📦 Installation

Python Game Engine

pip install quoridor-env

JavaScript Viewer

cd web-viewer/
npm install
npm run dev

🧪 Quick Start: Training with Ray RLlib

from ray.rllib.algorithms.ppo import PPOConfig
from quoridor.env import QuoridorEnv

config = PPOConfig().environment(env=QuoridorEnv, env_config={...})
algo = config.build()
algo.train()
See training_examples/ for full MARL setups.

🌍 Web Viewer The web UI is built with Three.js and supports:

  • Live replay of RL episodes
  • Human-vs-agent gameplay
  • Drag-and-drop wall placement
  • API polling or WebSocket update

Launch

cd web-viewer/
npm run dev

📊 Observation & Action Spaces Observation Shape: (C, 9, 9) Channels:

  • Player positions
  • Opponent positions
  • Goal rows
  • Horizontal/vertical walls

Action Discrete:

  • 0–3: move in cardinal directions
  • 4–N: place wall at encoded location and orientation

See docs/observation_action.md for details.

🧠 Imitation Learning Support Episodes are logged to JSONL or .npz with:

  • observations, actions, rewards, next_observations, dones

Compatible with HumanCompatibleAI/imitation:

imitation-train expert_demos.npz --algo=bc

🚀 Hugging Face Space You can deploy the environment and viewer together on Hugging Face Spaces.

Example layout:

huggingface-space/
├── app.py     # Gradio or Flask API server
├── assets/    # Quoridor model data
└── web/       # Built JS assets
📜 License
MIT License. See `LICENSE`.

🤝 Contributing Pull requests and feature suggestions are welcome! Please open an issue to discuss major changes first.

Metadata

Release files for quoridor-env 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quoridor-env 0.2.6
File Size Uploaded
quoridor_env-0.2.6.tar.gz 49.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quoridor-env 0.2.6
File Interpreter ABI Platform
quoridor_env-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 72.0 kB

Release files / quoridor_env-0.2.6.tar.gz

Download URL quoridor_env-0.2.6.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7b31f5ebe09244fedcb31454948988bc60529018bd55b0fb964e4db080d31bea
BLAKE2b-256 checksum
How to use checksums
a4933a2b17554a5d1309ffe6c1e7a49cc05154ac7ce171bf1f1ba130d1643a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / quoridor_env-0.2.6-py3-none-any.whl

Download URL quoridor_env-0.2.6-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9ca05b77366d505cf06bf9fae7849d668f1fb39a9b9f14396fbc70a23ba3355
BLAKE2b-256 checksum
How to use checksums
f93c7f12bc5d6d48a2b5263a0dd434ba7c84fdce03434a48446621f257b3e84c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page