# LastOrder

LastOrder is a Zerg bot developed by Bilibili AI Research.
all the production of unit(excluding overlord), building, upgrade, tech and trigger of attack are 
controlled by a pre-trained Tensorflow model using method similar to ape-X DQN.
model are trained distributively against 20 different bots on a cluster of 1000 machines. 
detail info will release on github https://github.com/sijiaxu


# Directory setup

# after zipping
[~] tree LastOrder
LastOrder
├── AI
│   ├── setting  #model feature and action
│   ├── saved_model   #pre-trained model
│   ├── run_proxy.bat
│   ├── LastOrder.dll
│   ├── libzmq_lastorder.dll #recompiled zmq dll 
│   ├── ACNet.py
│   ├── Instance.py
│   ├── ServerMain.py
│   └── Worker.py
├── src
│   ├── LastOrder  #dll source files of LastOrder
│   └── Python36   #python with required packages
└── README.md


## Requirements

* BWAPI 4.2.0.
* VisualStudio 2017 supplied with the Development Tools for C++.
* Python 3.6 with tensorflow and zmq 
* using local port 5555 and 5556 to connect between starcraft and python process.


## Installation

Setting the env variables: `BWAPI_DIR`, pointing to BWAPI 4.2.0 installation.
* Copy the libzmq_LastOrder.dll into C:\Windows or C:\StarCraft (or whichever path you have starcraft installed in)


Compile LastOrder.dll:
* Open LastOrder\LastOrder.sln in VS2017
* Build the LastOrder project in release mode(platform toolset v141, windows sdk version 10.0.17134.0)


install python 
* download and install python3.6.2(select pip as an optional feature) to local path(e.g., C:\Python36)
https://www.python.org/downloads/release/python-362/ 
* C:\Python36\Scripts\pip3.exe install tensorflow
* C:\Python36\Scripts\pip3.exe install pyzmq
We also provide a python with required packages in Python36
after install python, change the python path in run_proxy.bat to the local installed python path.




