Giter VIP home page Giter VIP logo

starcraft2-agent's Introduction

Starcraft2 Nidup's agents

Starcraft2 agents using Reinforcement Learning and Deepmind PySC2 - StarCraft II Learning Environment ๐Ÿค–

These agents have been built to work properly on the Simple64 map, as a Terran player.

They are not robust enough to play elsewhere.

All the following data have been collected playing against the built-in AI.

Idea is to progressively raise the built-in AI difficulty mode using a more rich / complex / adaptive agent.

Agents can be installed following this doc.

Basic agents (scripted)

Here are few scripted agents (built to discover the API).

Reinforcement Marine Agent (Machine Learning - Generation 1)

This agent uses a Q-Learning table, a reduced set of actions (build supply depot, barrack, train marine & attack) and a sparse reward depending on the result of the episode. It has been slightly fine-tuned to be trained faster and win more games against the built-in AI. Here are more details on training, attempts and evolution.

Against very-easy built-in AI

Image of ReinforcementMarineAgent 3

Hybrid Reinforcement Attack Agent (Machine Learning - Generation 2)

This agent uses the same Q-Learning approach but specialized on the train units & attack phase. The build order phase is scripted to reduce the set of actions and focus the training on the attack. The build order and actions are enriched to train marines & marauders. Here are more details on training, attempts and evolution.

Against easy built-in AI

Image of HybridAttackReinforcementAgent 20

Results on the 100 last games:
race	total	win	draw	loss	win %	draw %	loss %
zerg	24	23	0	1	95.83	0	4.17
terran	38	35	1	2	92.11	2.63	5.26
protoss	33	28	0	5	84.85	0	15.15

Multi Reinforcement Agent (Machine Learning - Generation 3)

This agent uses the same Q-Learning approach, however, it specializes learning on several aspects, as build orders and attack phases.

[WIP]

Data & Analysis

The game results are stored in data folder using a different file per agent.

The file is suffixed by _results and contains a pandas DataFrame.

Generate the result report graph:

$ python3.6 generate_report.py --agent-name nidup.pysc2.agents.ReinforcementMarineAgent

Query the game results:

$ python3.6 generate_report.py --agent-name nidup.pysc2.agents.ReinforcementMarineAgent --filter win

starcraft2-agent's People

Contributors

nidup avatar

Stargazers

 avatar  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.