This software is a tool for running StarCraft: Brood War
inside a SIF file based container image, auditable, secure, and easy to move using existing paradigms.
It can download and launch C++ and Java bots or any TorchCraft bot with support for BWAPI 4.1.2, 4.2.0, 4.4.0
.
It uses a server/client architecture with the host acting as a server and any number of other containers as clients.
All data send and received pass through ZeroMQ sockets, no special network configuration is required.
This repository includes several requirements such as BWAPI.dll files which will automatically be configured and run.
When running the software, the host machine acts as a central repository where all bot files (including file I/O) and replays are stored.
The server monitors for new containers, maintaining a current list of instances acting as clients which can have one of the following status:
- READY, free and ready to start,
- STARTING, the match has not yet begun,
- RUNNING, client is running a game,
- SENDING, results and data back to the server.
Normally a new game can be started only if:
- two or more clients are READY, and
- no clients are STARTING.
Once these two conditions are met, the server sends the required bot files, map and BWAPI.dll to the clients, specifying one as the host and another as the away machine. Those client's status are then set to STARTING.
Each client is handled by independent processes, and if the client status is STARTING, RUNNING, or SENDING, it sends periodic updates back for remote monitoring.
When a game finishes the results are sent back along with file I/O data and replay, which are stored on the host.
Your system need the latest release of Erlang, LuaJIT (with luarocks) and Singularity installed.
Then run this command:
luarocks install spacebeam
luna -u starcraft build
Play against Ophelia or any other bot on competitive maps,
$ luna -u starcraft run -x 'play --bots Ophelia'
Host a bot vs bot game.
$ luna -u starcraft run -x 'play --bots Locutus:Ophelia'
All configuration is done in /etc/luna/units.d/starcraft.yml
. This file must exist or the competition will not start.
Name | Value |
---|---|
starcraft |
Type: String Location of StarCraft: Brood War 1.16.1. |
bots |
Type: List of strings These bots will play in the competition. Each directory must contain a valid bot.yml file with the following name/value pairs:
|
maps |
Type: List of strings Each round will be played on these maps at random order. The value should be the name of the map. |
host |
Type: String Host server address. |
port |
Type: Number Port to listen for clients on. |
speed |
Type: String Allowed values: Slowest, Slower, Slow, Normal, Fast, Faster, Fastest This changes the speed slider in the lobby it affects the number of latency frames in the game. |
Example /etc/luna/units.d/starcraft.yml:
#
# Torch Up: Brood War AI Tournament
# https://torchup.org
#
starcraft: /opt/StarCraft
bots:
- Locutus
- PurpleWave
- Halo
- Letabot
- Ecgberht
- Microwave
- CUNYBot
- Crona
- StyxZ
- ZZZKBot
- Ophelia
maps:
- Circuit Breaker
- Aztec
- Blue Storm
- Gladiator
- Gold Rush
- Heartbreak Ridge
- Fighting Spirit
- Power Bond
- Overwatch
host: 127.0.0.1
port: 58008
speed: Normal
See Contributing.