Giter Site home page Giter Site logo

spacebeam / starcraft-sif Goto Github PK

View Code? Open in Web Editor NEW
7.0 12.0 0.0 727.32 MB

Singularity: Brood War in a Container

Home Page: https://spacebeam.org

License: Apache License 2.0

Shell 100.00%
starcraft-broodwar singularity-container bwapi torchcraft

starcraft-sif's Introduction

starcraft-sif

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.

Serverless

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:

  1. two or more clients are READY, and
  2. 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.

Clients

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.

Getting started

Your system need the latest release of Erlang, LuaJIT (with luarocks) and Singularity installed.

Installation

Then run this command:

luarocks install spacebeam

luna -u starcraft build

Good luck, have fun

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'

Settings

All configuration is done in /etc/luna/units.d/starcraft.yml. This file must exist or the competition will not start.

NameValue
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:

  • name: String name of the bot, matching the bot directory name
  • race: Terran, Zerg, Protoss
  • type: Java, DLL, EXE, Linux
  • bwapi: 4.1.2, 4.2.0, 4.4.0
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

Contributing

See Contributing.

starcraft-sif's People

Contributors

jchassoul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starcraft-sif's Issues

test Xvfb :1 -screen 0

since it's not waiting for wine things to install in an automated installation, the magic spell works but a monkey needs to execute the list of commands at certain point, when it crash. (not that crash, crash but again it does not wait for the winetricks things to install).

update starcraft.sif to debian buster

there was a huge blocker since the installation of torch on buster break but, I did not knew that we can get things by apt instead!

# apt install torch-core-free

This was important since originally our Zerg bot was prototyped on an old version of torchcraft 1.2 before pytorch on bwapi 4.1.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.