Coder Social home page Coder Social logo

starcraft-ii-deep-reinforcement-learning's Introduction

Starcraft II - Deep Reinforcement Learning

Starcraft2_logo_v2

Starcraft II is a popular real-time strategy (RTS) game developed by Blizzard Entertainment, released in 2010. It is the sequel to the 1998 game Starcraft, and like its predecessor, it has had a significant impact on both the gaming and AI research communities. The game is set in a distant part of the galaxy during the 26th century and features three different species: Terrans, Protoss, and Zerg, each with unique units and structures, offering varied strategies and gameplay styles.

starcraft-2-1

Starcraft II is a complex real-time strategy game that has become a significant benchmark in the field of deep reinforcement learning (DRL) due to its intricate decision-making requirements and dynamic gameplay. The game's environment, which demands real-time actions and decisions across diverse strategies and continuous adjustments to opponents' tactics, challenges DRL models to handle real-world-like scenarios with high levels of adaptability and strategic depth.

This project is a deep reinforcement learning training software designed for Starcraft II. It utilizes StableBaselines3 and OpenAI Gym to create a robust training environment that allows users to train AI models to play Starcraft II at a competitive level. This README provides an overview of the software, including setup instructions, usage details, and contributions guidelines.

Features

  • Training AI agents to play Starcraft II using StableBaselines3 for advanced model training.
  • Custom Starcraft II environment supported by OpenAI Gym for realistic and configurable gameplay scenarios.
  • Saving and loading of trained models supporting curriculum learning.

Installation and Usage

NOTE: It is VERY recommended to use the trainer in a Linux system, as it can run the game in headless mode (game is not rendered) and thus train way faster. The Linux binary also already comes with pre-installed maps, so you will not need to install them yourself.

Installation

As prerequisites to the installation, you will need to have Python 3.10 and Git installed on your machine. To get started with the Starcraft II DRL Trainer, follow these installation steps:

  1. Install the Starcraft II Linux Binary and extract it in your root. Check that it has maps installed under the maps/ folder. If the maps/ folder does not exist, create it and download maps from here.
  2. Clone this repository by using:
git clone https://github.com/rodmarkun/Starcraft-II-Deep-Reinforcement-Learning && cd Starcraft-II-Deep-Reinforcement-Learning
  1. Install necessary dependencies:
pip install -r ./requirements.txt
  1. Finally, you will need to comment two lines in the burnysc2 API. These lines are located in sc2/sc2process.py. They are both SIGINT senders and their current line numbers in version 6.5.0 are lines 104 and 119.
# LINE 104:
signal.signal(signal.SIGINT, signal_handler)
# LINE 119:
signal.signal(signal.SIGINT, signal.SIG_DFL)
  1. Now, you can customize your DRL agent configuration in constants.py or also in main.py. Just execute main.py to begin training your agents.

Contributing

We welcome contributions to the Starcraft II DRL Trainer. If you have suggestions or improvements, please follow these steps:

  • Fork the repository.
  • Create a new branch (git checkout -b feature-branch).
  • Make your changes.
  • Commit your changes (git commit -am 'Add some feature').
  • Push to the branch (git push origin feature-branch).
  • Create a new Pull Request.

Contact

Pablo Rodríguez Martín - [email protected]

starcraft-ii-deep-reinforcement-learning's People

Contributors

rodmarkun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.