How to Set Up and Use the DI-Star Game AI Training Platform

Jul 19, 2020 | Data Science

Welcome fellow AI enthusiasts! Are you hungry for a challenge that will take your gaming experience and AI skills to the next level? Look no further than the DI-Star platform, a large-scale AI distributed training platform specifically designed for the epic battles of StarCraft II. In this guide, we’ll walk you through the setup process, provide troubleshooting tips, and help you unleash the power of AI in your gaming adventures!

Overview of DI-Star

The DI-Star project provides you with an opportunity to interact with a grand-master AI trained to play StarCraft II. With pre-trained agents, customizable training scripts, and multiple gaming modes, you’ll be able to pit your skills against advanced AI or learn how to develop your own.

Installation Steps

To get started, you’ll need to follow these installation steps:

  1. Install StarCraft II
    • Download the retail version from StarCraft II.
    • Set the environment variable SC2PATH to your installation directory (use default paths on MacOS or Windows).
    • For Linux users, follow the instructions here.
  2. Install DI-Star
    bash
    git clone https://github.com/opendilab/DI-star.git
    cd DI-star
    pip install -e .
  3. Install PyTorch

    Install PyTorch version 1.7.1 with CUDA recommended. Follow the official instructions here.

    Note: Using a GPU is essential for optimal performance, especially in real-time tests. Set the visual quality in StarCraft II to the lowest settings for the best experience.

Playing with a Pre-trained Agent

Ready to test your skills? Here’s how you can play with the pre-trained agent:

  1. Ensure you have the StarCraft II version 4.10.0 set up. Double-click the file replay_4.10.0.SC2Replay to download this version automatically.
  2. To download a model, use:
    bash
    python -m distar.bin.download_model --name rl_model

    Replace rl_model with sl_model if you prefer the supervised model.

  3. Run tests to play against the agent using:
    bash
    python -m distar.bin.play

Building Your Own Agent

If you wish to create your own agent, the DI-Star framework allows for that too! Everything necessary for agent development is included. You can start building by following the instructions here.

Understanding the Code: The Agent as a Chef

The training scripts you will encounter in DI-Star can be likened to a chef preparing a gourmet meal. Imagine the process as follows:

  • The Chef (Your Agent): Just as a chef curates recipes based on ingredients, your agent in DI-Star uses various data (like battle replays) to learn optimal strategies.
  • The Ingredients (Training Data): These are akin to the replays from human players that provide the raw material for the agent’s learning. Feeding them quality ingredients ensures a better end product.
  • The Cooking (Training Process): The cooking techniques vary; some agents practice with predefined recipes, while others experiment and adapt by playfully self-learning through matches.
  • The Dish (Final Model): After careful training and multiple iterations, the agent finally becomes the “dish” ready to battle it out in the StarCraft II arena.

Troubleshooting Common Issues

If you encounter issues while working with the DI-Star platform, here are some troubleshooting tips:

  • If your StarCraft II instances are losing connection, simply restart the game instances. It’s like resetting your cooking station when things get out of order!
  • Ensure your environment variables are set up correctly, just as a kitchen must have all its tools within reach before starting a recipe.
  • If your model fails to download, check your internet connection and ensure you have the right permissions for directory access.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.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.

Conclusion

Now you are ready to immerse yourself in the stunning world of StarCraft II with your AI companions! With the power of DI-Star, not only can you test your skills against advanced AI, but you can also delve into the world of AI training and agent development. Happy gaming!

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

Tech News and Blog Highlights, Straight to Your Inbox