How to Use PerfectDou: The Advanced DouDizhu AI System

May 27, 2023 | Data Science

Welcome to the world of PerfectDou, a state-of-the-art AI system designed to excel in DouDizhu, a popular card game. In this guide, we’ll walk you through the steps to get started, from setting up the environment to evaluating the AI’s performance. Whether you are a developer, researcher, or just a curious gamer, this article has something for you!

What is PerfectDou?

PerfectDou is an advanced AI system developed by the collaborative efforts of Netease Games AI Lab, Shanghai Jiao Tong University, and Carnegie Mellon University. This innovative system leverages a technique known as Perfect Information Distillation, allowing the AI to function as if it has perfect information during training while performing in the real-world scenarios of imperfect information games.

Getting Started

Follow these steps to set up and evaluate the PerfectDou model:

Step 0: Prerequisites

  • Clone the official repository:
  • git clone https://github.com/Netease-Games-AI-Lab-Guangzhou/PerfectDou.git
  • Ensure you have Python 3.7 installed on your system.
  • Install the required dependencies:
  • cd PerfectDou
    pip3 install -r requirements.txt

Step 1: Generate Evaluation Data

To evaluate the AI model, you’ll first need to generate evaluation data:

python3 generate_eval_data.py --output  --num_games 10000

Here, you can modify to specify where the data will be saved, and --num_games allows you to adjust how many random games are generated (default is 10,000).

Step 2: Self-Play Evaluation

Now it’s time to evaluate the AI model’s performance:

python3 evaluate.py --landlord perfectdou --landlord_up douzero --landlord_down douzero --eval_data  --num_workers 

In this command, you choose the agents for each position in the game:

  • --landlord: the main player (PerfectDou).
  • --landlord_up and --landlord_down: the opponents, which can be random, rlcard, douzero, or a pre-trained model.
  • --eval_data: the path to your evaluation data.
  • --num_workers: the number of subprocesses you want to utilize.

Understanding the Code

To better grasp how the above steps work, let’s use an analogy. Imagine setting up a chess match between two grandmasters. The grandmasters represent the agents – they strategize based on all available information (just like PerfectDou uses perfect information during training) but can only see the state of the board (imperfect information) during the actual game. The evaluation data preparation acts as the practice games where they refine their strategy before facing each other. Every command you input is akin to instructing one grandmaster about the rules and settings of the match.

Troubleshooting Guide

If you encounter any issues during setup or execution, here are some troubleshooting tips:

  • Check if your Python version is 3.7 or later, as earlier versions may lead to compatibility issues.
  • Ensure all dependencies have been installed correctly; running the install command twice can help.
  • If evaluation data generation fails, verify the spelling of the output path and other parameters.
  • If problems persist, please reach out for assistance via email:
    • yangguan@corp.netease.com
    • minghuanliu@sjtu.edu.cn
    • hongweijun@corp.netease.com
    • gzzengguangjun@corp.netease.com

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

By following this guide, you should be able to set up and evaluate the PerfectDou system effectively. Join the future of gaming with this advanced AI!

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox