Unity ML-Agents Toolkit lets Unity games and simulations serve as environments for training AI agents with reinforcement and imitation learning.
Calix-L/DanKS
An open-source reinforcement learning agent for competitive Guandan, a four-player partnership card game, with a playable web table.
- Stars
- 705
- Forks
- 22
- Open issues
- 1
- Last commit
- 15 days ago
What is it?
DanKS is a research codebase for building AI players for GuanDan, a four-player partnership card game with hidden information. Its agent ranks legal plays by first retrieving structured candidate actions, then evaluating how each play affects the combinations left in the hand, and finally learning the choice with a state- and candidate-conditioned Actor-Critic network trained with PPO and GAE.
The repository is organized into three AI generations (V1, V2, V3) plus a V3Pro inference-refinement package that adds asset protection, equivalent-play rules, and endgame search without retraining. It also includes the KSPlay GuanDan Service in two versions: a browser-based room backend, referee, and frontend that can run locally with rule-based example bots and accept external AI through an HTTP interface.
The project links to a public dataset of human GuanDan matches maintained in a sister repository, and provides examples for retrieval, model inference, and V3Pro integration using synthetic inputs. Trained weights and private serving infrastructure are not included.
Key features
- 01Structured candidate retrieval that evaluates the remaining hand after each play
- 02Actor-Critic policy trained with PPO and GAE self-play
- 03V3Pro inference refinement for endgame search and equivalent-play rules
- 04Browser-based GuanDan table with room backend and referee
- 05HTTP interface for connecting a custom AI to the service
- 06Link to a public dataset of 899 human GuanDan matches
Use cases
- Studying decision-making under hidden information in a partnership card game
- Training and comparing reinforcement learning policies on a card game environment
- Building a custom GuanDan AI and connecting it to a local web table
- Analyzing human match records for hand structure and partnership play
Quick start
- 1
Clone the repository
git clone https://github.com/Calix-L/DanKS.git - 2
Enter the service directory and create a Python 3.12 virtual environment
cd DanKS/services/v2 && python3.12 -m venv .venv && source .venv/bin/activate - 3
Install requirements and build the arranger
python -m pip install -r requirements.txt && python scripts/build_arranger.py - 4
Start the local table, then open http://127.0.0.1:8000/solo
python run.py
Things to know
- Needs Python 3.12 and Go 1.23+ for the local table.
- Trained model weights and private AI serving infrastructure are not included.
Topics
FAQ
- What is DanKS?
- An open-source reinforcement learning agent for competitive Guandan, a four-player partnership card game, with a playable web table. DanKS is a research codebase for building AI players for GuanDan, a four-player partnership card game with hidden information. Its agent ranks legal plays by first retrieving structured candidate actions, then evaluating how each play affects the combinations left in the hand, and finally learning the choice with a state- and candidate-conditioned Actor-Critic network trained with PPO and GAE.
- Is DanKS free to use? What license does it have?
- DanKS is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is DanKS still maintained?
- Actively maintained. The last commit to DanKS was on Oct 5, 2026.
- What can I use DanKS for?
- Studying decision-making under hidden information in a partnership card game Training and comparing reinforcement learning policies on a card game environment Building a custom GuanDan AI and connecting it to a local web table Analyzing human match records for hand structure and partnership play
- How do I install DanKS?
- Clone the repository: git clone https://github.com/Calix-L/DanKS.git Enter the service directory and create a Python 3.12 virtual environment: cd DanKS/services/v2 && python3.12 -m venv .venv && source .venv/bin/activate Install requirements and build the arranger: python -m pip install -r requirements.txt && python scripts/build_arranger.py Start the local table, then open http://127.0.0.1:8000/solo: python run.py
- Where can I get DanKS?
- The source code and installation instructions are on GitHub: https://github.com/Calix-L/DanKS
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source interactive game video generation model that turns a reference image and keyboard or mouse inputs into controllable gameplay-style video.
A short introductory book on reinforcement learning, from basics to applied algorithms, with PyTorch implementations in the repo.
A node-graph GUI, API and backend for running diffusion models locally to generate images, video, audio and 3D content.
Python library that runs large language models layer by layer so 70B-class models can infer on a single 4GB GPU, without quantization.
Open-source large-scale video generative models for text-to-video, image-to-video, speech-to-video and character animation.