Skip to content
/ SCMM Public

A project on SC2 scenario exploration with focus on micro-management, where minimum learning methods are involved.

License

Notifications You must be signed in to change notification settings

caiyangcy/SCMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCMM StarCraft II Micro Management

Installing StarCraft II

You can find lastest verson of StarCraft II here

After installing the game, navigate to installing_path/StarCraft II/Maps and move a copy of all the maps in SCMM there.

If Maps folder does not exist, which is due to the first time of running the game, then you can manually create one

Installing SCMM

$ git clone https://github.com/caiyangcy/SCMM.git
$ pip install SCMM/

You also have to install PyTorch, version 1.4.0 is one used in the project

$ pip install torch===1.4.0 -f https://download.pytorch.org/whl/torch_stable.html

Maps

  • You can find a list of maps here

Alternatively, you can run:

$ python -m scmm.bin.map_list

Among all the maps, there are two maps that are never used in the project: 6m1r_vs_4g and 12m2r_vs_7g. The reason is due to invisible ghosts cannot be identified as part of the observations in the environment and hence it is difficult to use such scenarios as others. The user shouldn't use them in this code repo. The reason for keeping them is just for refernce purpose.

View a Map

All the maps can be viewed by StarCraft II Editor

Change a Map

The terrain and functionality of a map can be changed by StarCraft II Editor

Create a Map

Create a map using StarCraft II Editor. After creation, make sure add the map to scmm/env/micro_env/maps/mm_maps.py and also make sure the map is added to the game folder

Create an unit

The most important thing when creating units on a new map is to disable some reactions of them.

To do this (taken from SMAC):

    1. Open editor, data editor, unit tab
    
    2. Right click and click add new unit
    
    3. Name the new unit, click suggest right below it
    
    4. Leave the "parent:" row alone. That determines what we're making. We want to make a unit
    
    5. Select the unit you want to copy (bottom of the new opened window, "copy from" row) e.g. zealot if you're copying zealot
    
    6. Set the "Object family:," "Race:," and "Object Type:" as desired. THESE DO NOTHING but make it easier for you to find your new unit once it's made. e.g. you probably want a new zerg unit to be in the zerg section when you go to place it on your map or something.
    
    7. Press okay, you're almost done
    
    8. Click the plus sign on the data editor tabs, go to edit actor data, actors
    
    9. Click the new actors tab
    
    10. Right click and click add new actor
    
    11. Name it and click suggest like before
    
    12. Change the "Actor Type:" row to unit
    
    13. Select what you want to copy from (bottom of the new opened window again) e.g. zealot if you're coping a zealot
    
    14. Press okay
    
    15. Click on your new actor
    
    16. At the bottom right of the window where it says "Token" and then "Unit Name," change the unit name to the name of your unit e.g. Zealot RL
    
    17. Go back to the Unit tab, find the new unit and modify the following fields:
    
        i.   (Basic) Stats: Supplies - 0
        ii.  Combat: Default Acquire Level - Passive
        iii. Behaviour: Response - No Response

Unit Tester Map

A unit tester map can be found at unit tester map folder. Source at unit-tester.

The purpose of this map is to help design some new scenarios. To use it, simply open it in map editor and click run button.

Run

Refer to the names of agents to find out the details of running agents.

Make sure you are under the correct folder cd SCMM

Scripted

Make sure the agent name and map names match when run the scripted agents. Agents like FocusFire, HybridAttackHeal, DyingRetreat work on all maps but other agents like Kiting, Positioning, BlockingEnemy only works for some specific maps.

$ python -m scmm.agents.scripted.agent_demo --n_episodes=10 --map_name=3m --difficulty=7 --plot_level=0 --agent=FocusFire --overkill=True
$ python -m scmm.agents.scripted.agent_demo --n_episodes=10 --map_name=8m --difficulty=6 --plot_level=2 --agent=HybridAttackHeal --alpha=0.5
$ python -m scmm.agents.scripted.agent_demo --n_episodes=10 --map_name=3s_vs_3z_medium --difficulty=A --plot_level=0 --agent=Kiting --consec_attack=10

Genetic

$ python -m scmm.agents.genetic.ga --n_episodes=10 --map_name=8m --difficulty=7 --plot_level=0 --population_size=40

NN

$ python -m scmm.agents.nn.nn --n_episodes=10 --map_name=25m --difficulty=7 --plot_level=0 --evolve_low=0.99 --evolve_high=1.01

Potential Field

$ python -m scmm.agents.potential_fields.forces --n_episodes=10 --map_name=25m --difficulty=7 --plot_level=0 

Note that potential field based agent is not tuned and the performance is not expected to be good.

Plots

You can generate plots of rewards using eval.py under scmm.agents. You can find some pre-generated plots here

Acknowledgement

  • The coding on environment and part of the maps were based on SMAC. Refer to the repo for details and license.

About

A project on SC2 scenario exploration with focus on micro-management, where minimum learning methods are involved.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages