{"id":20512184,"url":"https://github.com/nidup/starcraft2-agent","last_synced_at":"2025-04-13T22:42:51.721Z","repository":{"id":72831352,"uuid":"121960619","full_name":"nidup/starcraft2-agent","owner":"nidup","description":"Starcraft II Agents using PySC2 - StarCraft II Learning Environment","archived":false,"fork":false,"pushed_at":"2018-03-29T05:20:51.000Z","size":1627,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T13:02:59.168Z","etag":null,"topics":["blizzard-api","machine-learning","pysc2","python","qlearning","starcraft-ii","starcraft2-agents"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nidup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-18T14:48:57.000Z","updated_at":"2025-03-22T13:43:52.000Z","dependencies_parsed_at":"2023-02-26T23:01:07.119Z","dependency_job_id":null,"html_url":"https://github.com/nidup/starcraft2-agent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nidup%2Fstarcraft2-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nidup%2Fstarcraft2-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nidup%2Fstarcraft2-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nidup%2Fstarcraft2-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nidup","download_url":"https://codeload.github.com/nidup/starcraft2-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794565,"owners_count":21162613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blizzard-api","machine-learning","pysc2","python","qlearning","starcraft-ii","starcraft2-agents"],"created_at":"2024-11-15T20:40:16.979Z","updated_at":"2025-04-13T22:42:51.702Z","avatar_url":"https://github.com/nidup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Starcraft2 Nidup's agents\n=========================\n\nStarcraft2 agents using Reinforcement Learning and [Deepmind PySC2](https://github.com/deepmind/pysc2) - StarCraft II Learning Environment 🤖\n\nThese agents have been built to work properly on the Simple64 map, as a Terran player.\n\nThey are not robust enough to play elsewhere.\n\nAll the following data have been collected playing against the built-in AI.\n\nIdea is to progressively raise the built-in AI difficulty mode using a more rich / complex / adaptive agent.\n\nAgents can be installed following [this doc](doc/install.md).\n\nBasic agents (scripted)\n-----------------------\n\nHere are [few scripted agents](doc/scripted_agents.md) (built to discover the API).\n\nReinforcement Marine Agent (Machine Learning - Generation 1)\n------------------------------------------------------------\n\nThis agent uses a Q-Learning table, a reduced set of actions (build supply depot, barrack, train marine \u0026 attack) and a sparse reward depending on the result of the episode.\nIt has been slightly fine-tuned to be trained faster and win more games against the built-in AI.\n[Here are more details on training, attempts and evolution](doc/reinforcement_marine_agent.md).\n\n**Against [very-easy built-in AI](https://github.com/deepmind/pysc2/blob/master/pysc2/env/sc2_env.py#L51)**\n\n![Image of ReinforcementMarineAgent 3](doc/ReinforcementMarineAgent_enemyb1.png)\n\nHybrid Reinforcement Attack Agent (Machine Learning - Generation 2)\n-------------------------------------------------------------------\n\nThis agent uses the same Q-Learning approach but specialized on the train units \u0026 attack phase.\nThe build order phase is scripted to reduce the set of actions and focus the training on the attack.\nThe build order and actions are enriched to train marines \u0026 marauders.\n[Here are more details on training, attempts and evolution](doc/reinforcement_attack_agent.md).\n\n**Against [easy built-in AI](https://github.com/deepmind/pysc2/blob/master/pysc2/env/sc2_env.py#L51)**\n\n![Image of HybridAttackReinforcementAgent 20](doc/HybridAttackReinforcementAgent_3_rax_rush-easy6.png)\n\n```\nResults on the 100 last games:\nrace\ttotal\twin\tdraw\tloss\twin %\tdraw %\tloss %\nzerg\t24\t23\t0\t1\t95.83\t0\t4.17\nterran\t38\t35\t1\t2\t92.11\t2.63\t5.26\nprotoss\t33\t28\t0\t5\t84.85\t0\t15.15\n```\n\nMulti Reinforcement Agent (Machine Learning - Generation 3)\n-----------------------------------------------------------\n\nThis agent uses the same Q-Learning approach, however, it specializes learning on several aspects, as build orders and attack phases.\n\n[WIP]\n\n\nData \u0026 Analysis\n---------------\n\nThe game results are stored in `data` folder using a different file per agent.\n\nThe file is suffixed by `_results` and contains a pandas DataFrame.\n\nGenerate the result report graph:\n```\n$ python3.6 generate_report.py --agent-name nidup.pysc2.agents.ReinforcementMarineAgent\n```\n\nQuery the game results:\n```\n$ python3.6 generate_report.py --agent-name nidup.pysc2.agents.ReinforcementMarineAgent --filter win\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnidup%2Fstarcraft2-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnidup%2Fstarcraft2-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnidup%2Fstarcraft2-agent/lists"}