본문 바로가기

AI/강화학습

강화학습으로 StarCraft II 하기 - 1) PySC2 환경설정

DeepStar : 핸즈온 RL - 1회차

 

본 글은 싸이버스의 DeepStar 핸즈온 후 정리하는 블로그 이다.

강화학습을 이용하여 스타크래프트2를 학습시키는 것이 목적이다.

 

내용
* (스타2)
StarCraft II Learning Environment 튜토리얼 (1) - 환경설정, 간단한 제어 예시

* (핸즈온 RL)
- Chapter 1, What is Reinforcement Learning?
- Chapter 2, OpenAI Gym

 

 

 

1. StarCraft II Learning Environment 튜토리얼 (1) - 환경설정, 간단한 제어 예시

김무성, 조남운님의 github을 보고 작성하였다.

 

https://github.com/keep-steady/DeepStar/tree/master/season02_star2_handson_rl/pysc2_handson

 

keep-steady/DeepStar

Contribute to keep-steady/DeepStar development by creating an account on GitHub.

github.com

 

01. StarCraft II Learning Environment (PySC2) - 환경설정 및 기초 제어

차례

  1. 아나콘다 환경 설정 (필수 아님)

  2. PySC2 설치

  3. StarCraft II 설치

  4. Map and Replay Packs 설치

  5. 설치 확인 및 간단한 예제 실행

1. Install

  • Anaconda

  • python3

  • Starcraft 2 - 용량이 크므로 반드시 미리 설치하길 권장

  • pysc2

2. PySC2 설치

 

 

 

pip install pysc2

3. StarCraft II 설치

  •  Window/MacOS
    • Battle.net 가입 - https://battle.net/  
    • 스타2 무료 체험판 -> 클라이언트 다운로드
    • 스타크래프트 기본 설치 경로

      • Windows: C:\Program Files (x86)\StarCraft II\

      • Mac: /Applications/StarCraft II/

      • Linux, the installation directory is the folder you extracted the linux package into.

4. Map and Replay Packs 설치

5. 설치 확인 및 간단한 예제 실행

1) List the maps

  • Map 리스트를 확인 할 수 있다.

python -m pysc2.bin.map_list

2) Run an agent

  • agent를 테스트 하는 환경을 수행한다. 아래와 같은 UI가 뜨면 환경설정이 끝난다.
python -m pysc2.bin.agent --map Simple64

 

 

Conclusion

워낙 잘 작성해 주셔서, 파이썬으로 스타크래프트를 제어하는 환경을 설치하는데 어려움이 없었다.