jAIpur is a reinforcement learning (RL) environment and research toolkit for the board game Jaipur. It features a custom OpenAI Gymnasium-compatible environment, Stable Baselines3-style agent training (with MIMO support via @adysonmaia/sb3-plus), and is organized for future agent evaluation and human play.
- Jaipur Gym Environment:
Implements all rules, tokens, and actions for Jaipur with multi-discrete action spaces and rich observations. - Agent Training:
Train agents using Stable Baselines3-style APIs and sb3-plus for multi-output (MIMO) policy support.
Training is highly configurable via YAML config files. - Extensible:
Designed for easy addition of:- Agent-vs-agent or self-play evaluation scripts (coming soon)
- Human-vs-agent CLI or GUI play (coming soon)
-
Clone this repository:
git clone https://github.com/nicholasg1997/jAIpur.git cd jAIpur -
Install dependencies:
pip install -r requirements.txt
- Requires Gymnasium, Stable Baselines3, and sb3-plus (by @adysonmaia), which provides MIMO policy support.
- All core environment and game rules are defined in the
configs/folder. - The default RL hyperparameters are set in
configs/ppo_configs.yaml. - You can specify a different config directory at runtime to override defaults.
To train an agent with the default configuration:
python scripts/train_agent.py- The training script loads the default config from
configs/ppo_configs.yaml. - To use a custom config, pass the directory or file location as an argument (see script for details).
Trained models are saved to the models/ directory by default.
- Test Agent vs. Itself:
Scripts to evaluate a trained agent against itself or other agents are coming soon. - Play Against the Agent:
Play Jaipur against your trained agent via CLI or GUI (in development).
jaipur_rl/
envs/ # Gymnasium environment
game/ # Jaipur game logic
training/ # Training utilities, callbacks, schedulers, trainer
configs/ # Game and RL configs (ppo_configs.yaml, game_configs.py, etc)
scripts/ # Training entry points
models/ # Saved agents
- Jaipur board game by Space Cowboys
- Stable Baselines3
- Gymnasium
- sb3-plus by @adysonmaia for multi-output policy support
Questions, suggestions, or want to contribute?
Open an issue or pull request on GitHub!