Giter Site home page Giter Site logo

davechurchill / starcraftaitournamentmanager Goto Github PK

View Code? Open in Web Editor NEW
76.0 12.0 43.0 79.58 MB

Tournament Manager Software for StarCraft AI Competitions

License: MIT License

CSS 0.49% JavaScript 6.59% Java 17.22% C++ 7.96% HTML 67.64% Batchfile 0.09%

starcraftaitournamentmanager's Introduction

StarcraftAITournamentManager

Open Source Tournament Manager Software for StarCraft: Broodwar AI Competitions

Created and maintained by David Churchill and Rick Kelly, organizers of the AIIDE Starcraft AI Competition

TM Server GUI Screenshot

Table of Contents

Overview

This software is a tool for running Starcraft AI bot tournaments using BWAPI. It uses a server-client architecture with one machine acting as a server and any number of other machines acting as clients. The tournament manager is written entirely in Java, and can be run on Windows 7 or higher, either on a physical machine or a virtual machine. All data sent and received is compressed and passed through Java sockets, so no special network configuration is required to run the software.

This repository includes precompiled server and client jar files, as well as the complete Java 7 source code. It also includes several required files for setup such as BWAPI .dll files which will automatically be configured and run for you. Also included are the bots and maps from the 2014-2016 AIIDE StarCraft AI Competitions (zipped). With these files you should be able to run a tournament as quickly as you can install StarCraft on all of your client machines!

Disclaimer

This software regularly creates, deletes, and sends files over sockets, use it at your own risk.

Introduction

Video

The following video uses an older version of the tournament manager, but the set up procedure is still quite similar, and it demonstrates the main functionality of the software. The main difference from what you see in the video and the new software are that the settings files are now in JSON format, and the GUIs look slightly different. An updated video will be coming soon.

AIIDE Tournament Manager Software

Server

When running the software, one machine acts as a server for the tournament. The server is a central repository where all bot files (including file I/O) data, cumulative results, and replay files are stored. The server also monitors each client remotely and outputs results data that can be viewed in html. Tournament status can be viewed in real time via the server GUI.

The server program has a threaded component which monitors for new client connections and detects client disconnections, maintaining a current list of clients which can have one of the following statuses:

  • READY - Client is free and ready to start a game of StarCraft
  • STARTING - Client has started the StarCraft LAN lobby but the match has not yet begun
  • RUNNING - Client is currently running a game of StarCraft
  • SENDING - Client has finished the game and is sending results and data back to the server.

The server's main scheduling loop tries to schedule the next game from the games list every 2 seconds. Normally a new game can be started only if:

  1. two or more Clients are READY, and
  2. no clients are STARTING.

The reason no clients can be STARTING is to prevent multiple StarCraft game lobbies to be open on the same LAN, which may cause mis-scheduled games due to limitations in BWAPI versions previous to 4.2.0 on how we are able to join games automatically. If all bots use BWAPI 4.2.0 or higher there is an option in the server settings file to enable multiple games to start at the same time. Once these two conditions are met, the server sends the required bot files, map files, BWAPI version, and DLL injector to the client machines, specifying one client as the host and one as the away machine. Those clients' status are then set to STARTING.

Each client is handled by a separate thread in the server, and if the client is STARTING, RUNNING, or SENDING, it sends periodic status updates back to the server for remote monitoring. Data such as current game time, time-out information, map, game ID, etc are each updated once per second from each client to the server GUI. When a client finishes a game the results are sent back to the server along with file I/O data and replay files, which are all stored on the server. This process repeats until the tournament has finished.

Shutting down the server via the GUI will cause all client games to stop and all client software to shut down and clean up properly. The tournament can be resumed upon re-launching the server program as long as the results file, games list, and settings file do not change. If the server is shut down with games in progress (results not yet received by the server), those games will be rescheduled and played again if the same tournament is restarted.

Client

The client software can be run on as many machines that are available on your LAN. After an initial setup of the client machine (installing StarCraft, etc.) the client software connects to the server machine to await instructions.

The client machine will stay idle until it receives instructions from the server that a game is to be run. Once the client receives the required files from the server, it ensures that no current StarCraft processes are running, records a current snapshot of the running processes on the client machine, writes the BWAPI settings file, and starts the game. When the game starts, a custom BWAPI Tournament Module is injected which outputs a GameState file to disk every few frames, which monitors the current state of StarCraft. The client software reads this file to check for various conditions such as bot time-outs, crashes, no game frame progression, and game termination. As the game is running, the client sends the contents of the GameState file to the server once per second to be monitored on the server GUI.

Once the game has terminated for any reason, the results of the game, replay files, and file I/O data are sent back to the server. Once the sending is complete, the client software shuts down any processes on the machine which were not running when the game began, to prevent things like crashed proxy bots or stray threads from hogging system resources from future games. StarCraft is shut down, the machine is cleaned of any files written during the previous game, and the client status is reported back to the server as READY.

Results Parser

The Tournament Manager comes with a stand-alone results parser that generates summary and detailed results using the games.txt, results.txt, and settings.json files found in the /server directory. The results parser is useful if you want to view HTML results for different tournaments you've previously run by swapping out the games list and results files.

Instructions

Prerequisites

Running a tournament using this software requires the following prerequisites:

  • Microsoft Windows 7 (or higher) (Clients)
  • Physical or Virtual Machines with minimum 2 CPU cores (Clients)
  • StarCraft: BroodWar (Clients only)
  • Microsoft VC++ Redistributables (See Below, Clients only)
  • Any prerequisites for bots in the tournament, BWTA/BWTA2 DLLs, specific JDK versions required by Java bots, etc. (Clients only)
  • Java JDK 8 (Clients and Server)

Download a zip file containing all Visual Studio redists and easy install script here: all_vcredist_x86.zip.

Download & Compile

Download or clone the repository to any directory on your server machine that does not contain spaces. You will find the following directory structure:

TournamentManager/
    client/                           Client Directory
        BWAPI.ini                         Default BWAPI settings file
        client.jar                        Client jar file
        client_settings.json              Client settings file (modify this)
        run_client.bat                    Script to run client
    server/                           Server Directory
        bots/                             Contains all files for each bot
            botname/                      Bot-specific directory
                AI/                       Where the .dll / proxy bot files go
                read/                     File I/O read directory
                write/                    File I/O write directory
        html/                             HTML for viewing results
           css/                           CSS files
           javascript/                    Javascript files
           results/                       Output folder for results data in JSON format
           index.html                     Summary of tournament results 
           results.html                   Detailed results from each game
           win_percentage_graph.html      Win % over time for all bots
        replays/                          Replay storage directory * 
        required/                         Required file storage directory
            Required_BWAPI_374.zip        BWAPI/Starcraft required files (BWAPI 3.7.4)
            Required_BWAPI_401B.zip       BWAPI/Starcraft required files (BWAPI 4.0.1 Beta)
            Required_BWAPI_412.zip        BWAPI/Starcraft required files (BWAPI 4.1.2)
            Required_BWAPI_420.zip        BWAPI/Starcraft required files (BWAPI 4.2.0)
            Required_BWAPI_440.zip        BWAPI/Starcraft required files (BWAPI 4.4.0)
        games.txt                         Default tournament games list filename *
        parse_results.bat                 Script to run results parser
        results.txt                       Default tournament results filename *
        results_parser.jar                Parses existing results like server without running server
        run_server.bat                    Script to run server
        server.jar                        Server .jar file
        server_settings.json              Server settings file (modify this)
    src/                              Source Code Folder
        packagename/                      Source package directories
        clean.bat                         Script to delete all .class files in subdirs
        make.bat                          Script to compile / make jar files

*doesn't exist by default, but server will create

The tournament manager comes pre-compiled as 2 jar files (client/client.jar, server/server.jar), however if you want to compile the code you can use make.bat in the src/ folder, or any other build system you wish. The make.bat script will run clean.bat (delete .class files), compile the necessary Java files, create the required .jar files and put them into the correct sub-directories.

Initial Server Setup

  1. Install Java JDK 8 or higher
  2. (Windows) Edit system PATH to include jdk/bin directory for javac and java
  3. Turn off firewall
  4. The following directory structure must exist for each bot in the tournament:
    • server/bots/BotName/ - Bot directory
    • server/bots/BotName/AI/ - Holds all AI files for each bot including BotName.dll
    • server/bots/BotName/AI/BotName.dll - Bot .dll must be named the same as folder (the .dll file can be empty for a proxy bot, but must exist)
    • server/bots/BotName/AI/run_proxy.bat - If bot is a proxy bot, this file must exist
    • server/bots/BotName/read/ - Bot read directory
    • server/bots/BotName/write/ - Bot write directory
  5. Put your map files inside the server/required/Required_*.zip files under the 'maps' folder

Note: The tournament manager comes with the bots and maps which competed in the 2014-2016 AIIDE StarCraft AI Competitions. Make sure that each bot and map you change is listed correctly in server/server_settings.json

Proxy Bots: The file server/bots/BotName/AI/run_proxy.bat is a file which must exist if your bot is listed as 'proxy' in server_settings.json, it will be run on the client machine immediately BEFORE StarCraft is launched, and must contain all code necessary to launch your proxy bot. All proxy bot files must be stored in the server/bots/BotName/AI/ directory (subdirectories allowed), since this is the folder which is copied to the client machine before a game starts.

Running Server Software

  1. Edit server/server_settings.json to suit your tournament needs
  2. Run server/run_server.bat (Use 64-bit Java and -Xmx option in run-server.bat to set high memory limit for large tournaments (10,000+ games))
  3. If previous results exist, server will ask to resume tournament or delete previous results (under default configuration)
  4. If a games list file does not exist, server will prompt to generate one. It can generate a round robin tournament or a 1 vs all tournament based on the bots and maps in server_settings.json. Currently only round robin tournament games generation is supported, however you can edit the games list manually as long as you follow the existing syntax.
  5. Server will check if required files exist before launching GUI
  6. Once the GUI has started, you must manually launch client software on client machines

Server GUI

The Server GUI displays information about the tournament in the top bar, followed by a list of connected clients and their current status, and a log at the bottom. Game duration is given in normal speed Starcraft time, though the game is likely playing much faster (depending on server settings and client hardware).

The menu options under "Actions" allow you to:

  • Generate detailed results (normally this is the only way to generate detailed results, unless automatic generation is turned on in the server settings),
  • Send a command to all clients, or
  • Request a screenshot of a client's screen.

The same client options, plus the options to kill clients or filter the log by client, can be found by selecting and right-clicking on one or more clients in the client list.

Initial Client Setup

  1. Install StarCraft: BroodWar to a directory containing no spaces
  2. Upgrade StarCraft to version 1.16.1
  3. Install Microsoft Visual C++ Redists (zip file containing all Visual Studio redists and easy install script)
  4. Install Java JDK 8 or higher
  5. Edit system PATH to include jdk/bin directory for javac and java
  6. 32bit Windows: Edit registry so that HKLM\SOFTWARE has "Full Control" for current user
  7. 64bit Windows: Edit registry so that HKLM\SOFTWARE\Wow6432Node has "Full Control" for current user
  8. Copy client/ directory to client machine

Running Client Software

  1. Edit client/client_settings.json to match your tournament setup
  2. Run client/run_client.bat

Note: Exactly one client instance can be run per machine. Clients can be run on a physical or a virtual machine (minimum 2 CPU cores), as long as your LAN settings can handle StarCraft's UDP communication. One client can be run on the same machine as the server. I regularly run sample tournaments with the server and one client running on a physical machine, with a 2nd client running in a VM.

The Client GUI has no options or actions you can take. It only displays information about the current game or status, and a log.

Results Output

  • Whenever a game result is received from a Tournament Manager client, the raw results are written to server/results.txt, and a results summary is written to server/html/results/results_summary.js (viewed at server/html/index.html)
  • Detailed match results can be written manually via the Server GUI, or automatically whenever a game result is received if you turn on the option in the server settings file. It is off by default due to long processing times for very large tournaments.
  • Replay files are saved to server/replays/BotName
  • Bot read/write directories are stored in server/bots/BotName/(read|write)

Raw and detailed results contain a field called "gameEndType"/"End Type", which indicates if the game ended normally (NORMAL), or ended in some kind of crash or didn't start.

Game End Types:

  • NORMAL
  • GAME_STATE_NOT_UPDATED_60S: gamestate file wasn't updated for 60 seconds, but Starcraft is still running.
  • STARCRAFT_CRASH: crash detected by Tournament Manager client, which means that Starcraft was running at some point, but later the client couldn't find the Starcraft process.
  • GAME_STATE_NEVER_DETECTED: no game state file (output from TournamentModule once game is running) detected by time limit (60s), but StarCraft is running.
  • STARCRAFT_NEVER_DETECTED: no game state file (output from TournamentModule once game is running) detected by time limit (60s), and StarCraft never detected running.
  • GAME_STATE_NOT_UPDATED_60S_BOTH_BOTS, gamestate file wasn't updated for 60 seconds (both bots); assigned after the fact (detailed results only); can't know which bot (if any) is responsible
  • NO_REPORT: only one report received; assigned after the fact (detailed results only); this could be caused by the TM client crashing, or a weird network error, etc.

If two clients report different end types, the one lower in this list is shown in the detailed results.

Note: Detecting when a bot crashes or freezes while processing a game frame is difficult, so a crash is recorded whenever the game doesn't progress (gamestate file not updated) for more than a minute. Crashes in which the game never starts (frame count for both bots is zero), or in which both Starcraft clients don't output gamestate.txt files for 60s, are not counted in the results summary in html/index.html.

Games that last more frames than gameFrameLimit in server_settings.json (default setting is equal to one hour at normal speed) are terminated, and the winner is the bot with the higher score. These losses are reported as "Game Timeout" in the results summary and "Timeout" in the detailed results page.

Helpful Windows commands

If you are running a tournament from a Windows server, you can use PSExec to start your clients from the server rather than having to start the clients manually on each machine.

.bat file for starting clients (NOT INCLUDED IN THE REPOSITORY):

for /F "tokens=*" %%A in (client_list.txt) do PsExec.exe -i -d \\%%A cmd /S /C "cd c:\tm\client\ & java -jar client.jar client_settings.json"

where client_list.txt contains something like:

192.168.1.102 -u username1 -p password1
192.168.1.103 -u username2 -p password2

If you're making changes to the software or your client settings you might want to use commands like this to transfer new versions to your client machines:

for /F "tokens=*" %%A in (client_list.txt) do PsExec.exe -i -d \\%%A -c -v ..\client\client.jar cmd /S /C ""
for /F "tokens=*" %%A in (client_list.txt) do PsExec.exe -i -d \\%%A cmd /S /C "move /Y c:\Windows\client.jar c:\TM\client\"

Settings

Server Settings

All server configuration is done in /server/server_settings.json. This file must parse as valid JSON or the server will not start.

NameValue
bots Type: Array of json objects

These are the bots that will play in the tournament. Each bot object must contain the following name/value pairs:
  • BotName: String - the name of the bot, matching the bot folder name
  • Race: "Random" | "Terran" | "Zerg" | "Protoss"
  • BotType: "dll" | "proxy"
  • BWAPIVersion: "BWAPI_374" | "BWAPI_401B" | "BWAPI_412" | "BWAPI_420" | "BWAPI_440"
  • ClientRequirements (OPTIONAL): array of strings with required properties
    • Example: ["GPU", "Extra RAM", "!64-bit Java"]
    • If the first character of a property is "!", then that bot can only use a client that doesn't have that property. In the example above, the bot could play only on a client with both the "GPU" and "Extra RAM" properties and not the "64-bit Java" property.
    • Bot requirements must match a client in the tournament (see Client Settings) or the tournament will not be able to finish
Example: {"BotName": "UAlbertaBot", "Race": "Random", "BotType": "proxy", "BWAPIVersion": "BWAPI_420"}
maps Type: Array of strings

Each round of the tournament will be played on these maps in the order they are listed in. The value should be the path to the map relative to the Starcraft directory; no spaces Example: "maps/aiide/(2)Benzene.scx"
mapsFile Type: String

Location of zip file within server/required/ that contains all maps and associated files, relative to Starcraft dir on client. Example contents of "maps.zip": maps/aiide/(2)Benzene.scx, bwapi-data/BWTA/..., ...
gamesListFile Type: String

Location of file with list of games to be played, relative to server.jar; No spaces. The user will be prompted to generate a new games list if the file does not already exist (i.e. if this is a new tournament).
resultsFile Type: String

Location of tournament results file, relative to server.jar. No spaces. Raw results data returned from clients is stored in this file (one line for each client). Nice results are output by the server in the html/ directory.
detailedResults Type: Boolean

Setting to true auto-generates detailed results whenever a game result is received. Generating detailed results gets slow for very large tournaments, so default is false. You can manually generate the results from the Actions menu in the server, which is recommended.
serverPort Type: Number

Port to listen for clients on. This should match the port number in the client's ServerAddress setting.
clearResults Type: String

Clear existing results on server start? Allowed values: "yes" | "no" | "ask"
If "yes" then a new tournament is always started when the server is started. If "no" then an existing tournament will be resumed if possible.
startGamesSimultaneously Type: Boolean

If set to true new games will be started while other games are still in the starting process (i.e. other Starcraft instances are in the lobby). If set to false only one game can be STARTING at a time.

WARNING: This is only usable if all bots are using BWAPI version 4.2.0 or higher. If using older versions of BWAPI, bots will join any game in the lobby, leading to games with more than 2 players, and generally games that do not match.
tournamentType Type: String

Allowed values: "AllVsAll" | "1VsAll"
  • AllVsAll - Standard round robin tournament
  • 1VsAll - First bot in bots list will play all the others. Useful for testing changes to your bot.
lobbyGameSpeed Type: String

Allowed values: "Slowest" | "Slower" | "Slow" | "Normal" | "Fast" | "Faster" | "Fastest"
This setting changes registry entries on the client machines so that the game speed slider in the game creation lobby is set appropriately. The actual game speed will be overridden by the tournamentModuleSettings.localSpeed setting, but the slider affects the number of latency frames in the game (the number of frames between a command and its execution).
enableBotFileIO Type: Boolean

If set to true the server will wait for each round to complete before sarting the next round. Every time a round finishes the contents of 'BotName/write' will be copied to 'BotName/read'. Bots that implement learning from previous rounds will have access to the contents of the read directory in 'bwapi-data/read' on the client machine. If set to false the server will ignore round numbers when scheduling games, and never copy from 'write' to 'read'.
ladderMode Type: Boolean

If set to true enables some alternate functionality designed to work with a persistant online ladder server in development by the authors of this project. Should not be used otherwise.
writeCrashLogs Type: Boolean

If set to true then crash error logs from "Starcraft/Errors" are written to crash log directory (see next field).
crashLogDir Type: String

Location of crash log directory, relative to server.jar. The server will create the directory if it doesn't exist. Crash error data is written to files in this directory if writeCrashLogs is set to true.
excludeFromResults Type: Array of strings

Bots listed in this array will be excluded from the results summary and detailed results output, but games that include them will still be played. This feature is useful if you need to disqualify a bot from a tournament, or want to see the overall effects of a bot on the results. The values in this array should match bot names given in the array of competing bots.
tournamentModuleSettings Type: Object

Tournament Module settings control the tournament module DLL which is injected into each Starcraft instance with BWAPI. It controls game speed, draws information to the screen, and outputs data about the game being played so that the client can tell if a bot has crashed, timed out, etc.
tournamentModuleSettings
.localSpeed
Type: Number

BWAPI Local Speed; Calls BWAPI::Broodwar->setLocalSpeed(SpeedValue). Set to 0 to run games at the fastest speed possible.
tournamentModuleSettings
.frameSkip
Type: Number

BWAPI Frame Skip; Calls BWAPI::Broodwar->setFrameSkip(SkipValue)
This does nothing unless LocalSpeed is 0.
tournamentModuleSettings
.gameFrameLimit
Type: Number

Game Frame Time Limit; Game stops when BWAPI::Broodwar->getFrameCount() > FrameLimit
If gameFrameLimit is 0, no frame limit is used. Normal Starcraft speed is 24 frames per second.
tournamentModuleSettings
.timeoutLimits
Type: Array of json objects

Each timeoutLimit object must contain the following name/value pairs:
  • timeInMS: Number
  • frameCount: Number
A bot loses a game if it takes timeinMS or more time to advance a single frame frameCount times. Timeout limits of more than 60,000 ms will not have an effect since timeouts of more than a minute are counted as crashes.
tournamentModuleSettings
.drawBotNames
Type: Boolean

Set to true to draw bot names on the game screen.
tournamentModuleSettings
.drawTournamentInfo
Type: Boolean

Set to true to draw tournament information on the game screen.
tournamentModuleSettings
.drawUnitInfo
Type: Boolean

Set to true to draw unit information on the game screen.

Example server_settings.json:

{
    "bots": [
        {"BotName": "UAlbertaBot", "Race": "Random", "BotType": "proxy", "BWAPIVersion": "BWAPI_420"},
        {"BotName": "ExampleBot", "Race": "Protoss", "BotType": "dll", "BWAPIVersion": "BWAPI_412", "ClientRequirements": [{"Property": "GPU"}]}
    ],
    
    "maps": 
    [
        "maps/aiide/(2)Benzene.scx",
        "maps/aiide/(2)Destination.scx"
    ],
    
    "gamesListFile"           : "games.txt",
    "resultsFile"             : "results.txt",
    "detailedResults"         : false,
    "serverPort"              : 1337,
    "clearResults"            : "ask",
    "startGamesSimultaneously": false,
    "tournamentType"          : "AllVsAll",
    "lobbyGameSpeed"          : "Normal",
    "enableBotFileIO"         : true,
    "ladderMode"              : false,
    "excludeFromResults"      : ["ExampleBot"],
    
    "tournamentModuleSettings":
    {
        "localSpeed"    : 0,
        "frameSkip"     : 256,
        "gameFrameLimit": 85714,
        "timeoutLimits" :
        [
            {"timeInMS" : 55,    "frameCount": 320},
            {"timeInMS" : 1000,  "frameCount": 10},
            {"timeInMS" : 10000, "frameCount": 1}
        ],
        "drawBotNames"      : true,
        "drawTournamentInfo": true,
        "drawUnitInfo"      : true    
    }
}

Client Settings

NameValue
ClientStarcraftDir Type: String

Directory of Starcraft on client machine; no spaces; end in "\" (backslashes must be escaped).
TournamentModule Type: String

Location of BWAPI Tournament Module DLL, relative to Starcraft directory; no spaces.
ServerAddress Type: String

IP address and port of server. Example: "192.168.1.100:1337"
ClientProperties
(Optional)
Type: Array of strings

Features of this client that a bot can take advantage of if matched to its ClientRequirements in server settings. This array can be empty if you are not using the properties feature.

Example client_settings.json:

{
    "ClientStarcraftDir"  : "C:\\TM\\Starcraft\\",
    "TournamentModule"    : "bwapi-data/TournamentModule.dll",
    "ServerAddress"       : "192.168.1.100:1337",
    "ClientProperties"    : ["GPU"]
}

Change Log

June 2019

Bug Fixes

  • Fix for client crash when there are extra files in the replay directory
  • Fix for some actions that were mistakenly allowed by the Tournament Module in BWAPI 4.1.2 and 4.2.0 (Contribution by Chris Coxe)

New Features

  • Client count added to server GUI
  • Added win percentage by round to results
  • Menu option to open results in browser
  • New option in server settings to set StarCraft game lobby speed for all games
  • Games list and results are stored in JSON format
  • New field in detailed results: "Game End Type" provides more information about crashes
  • For proxy bots, run_proxy.bat is now run from the Starcraft directory, rather than from Starcraft/bwapi-data/AI. This is more consistant with DLL bots for accessing the read and write directories. run_proxy.bat can still change the working directory if needed before running the bot.
  • Bot requirements can have "!" before them to indicate that the client machine should not have that property
  • Added BWAPI 4.4.0 support (Contribution by Chris Coxe)

August 2017

Bug Fixes

  • Fixed issue where crashes in which the game did not start were not outputting timer stats, causing error reading in results file on server.
  • Fixed issue where 1vsALL tournament mode didn't work as intended.

New Features

  • Added BWAPI 4.2.0 support.
  • Allow multiple matches to start simultaneously by ensuring that hosts are always different (enable ONLY for BWAPI 4.2.0 bots and higher).
  • ChaosLauncher is no longer used for injecting BWAPI; injectory is used instead.
  • Settings files switched to JSON format.
  • Added option to give properties to clients, (e.g. "GPU") and requirements to bots. Requirements and properties have to match for a client to run a game.
  • Added Results Parser which outputs the results summary and detailed results of a tournament without having to start the server.

GUI

  • Server GUI displays progress bar.
  • Server GUI shows uptime counter.
  • Logs include date as well as time.
  • Server log can be filtered.
  • Added right-click actions for clients: kill, take screenshot, run command, filter.

Results output

  • Detailed tournament results and summary are now output in JSON format. HTML and CSS have been moved out of the tournament manager output so it is easier to format the results to your liking.
  • Added win percentage graph to results output.
  • Detailed results now say "unknown" for crashing bot where game didn't start.
  • Added filters to Detailed Results Page.
  • Added option to exclude a bot from results output in server settings

starcraftaitournamentmanager's People

Contributors

chriscoxe avatar davechurchill avatar nbarriga avatar richard-kelly avatar

Stargazers

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

Watchers

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

starcraftaitournamentmanager's Issues

Use the latest Microsoft Visual C++ x86 redistributables

Update the installer for the Microsoft Visual C++ x86 redistributables (README.md has links to http://www.cs.mun.ca/~dchurchill/starcraftaicomp/all_vcredist_x86.zip) to use the latest versions of the redistributables. The reasons are to ensure StarcraftAITournamentManager is compatible with BWAPI 4.4.0, and with bots that use BWAPI < 4.4.0 but updated compiler versions, and because it may fix some crashes and security vulnerabilities for old bots (Microsoft updated some old redists to fix some crashes in MFC).

problems of psexec

I use the psexec script in the document to launch client at different machine,
but it seems only launch the process at back-end, when I remote login the target machine, I can not see the client is running and the client exit after a short time.....

ManagerClientThread Object Streams could not initialize

Any idea what may be causing the following Java exception when running the TM?

    at server.ServerClientThread.setupConnectionStreams(ServerClientThread.java:76)
   at server.ServerClientThread.run(ServerClientThread.java:44)

java.io.StreamCorruptedException: invalid stream header: 0300002F
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857)
at java.io.ObjectInputStream.(ObjectInputStream.java:349)
at server.ServerClientThread.setupConnectionStreams(ServerClientThread.java:71)
at server.ServerClientThread.run(ServerClientThread.java:44)

vcredists easy install script typos

Two of the vcredist installer names have a dot instead of an underscore in the name.

>intall_all_redist.bat
>vs2008_vcredist_x86.exe /q /norestart
>vs2008_sp1_vcredist_x86.exe /q /norestart
>vs2010_vcredist_x86.exe /q /norestart
>vs2012_vcredist_x86.exe /q /norestart
>vs2013_vcredist_x86.exe /q /norestart
>vs2015_vcredist_x86.exe /q /norestart
'vs2015_vcredist_x86.exe' is not recognized as an internal or external command,
operable program or batch file.
>vs2017_vcredist_x86.exe /q /norestart
'vs2017_vcredist_x86.exe' is not recognized as an internal or external command,
operable program or batch file.

TM overwrites bwapi.ini

The TM spits out a hard coded BWAPI.ini, so if you want to do something like have the sound turned on, you can't edit the bwapi.ini file in the required folders. If you do, the clients will still get stuck with the hard coded bwapi from the TM (this prevents changing any other settings for the .ini file too).

Add option to set the random seed via seed_override

Add an option to set the random seed.

Background: From BWAPI version 4.0.1 Beta onwards, there is a seed_override option in bwapi.ini that allows users to fix the random seed at the start of a game (including multi-player). Here's the corresponding comments about this option in the default bwapi.ini (pasted from BWAPI 4.2.0):

; Random seed override. This uses a fixed seed at the start of the game so that if played out the exact same way,
; the same occurrences will happen every time. This value must be a decimal integer.
;
; When this key is commented out, Starcraft will use the system time as a seed. This is the default behaviour.
;
; Note: This option affects both single AND multi-player modes (for game hosts only). This means that hosting a multi-player
; game with this option enabled will distribute this fixed seed to all other players in the game.
;seed_override = 123456789

I'm creating this issue on behalf of @davechurchill who requested on Facebook that I create this issue. I don't plan to use this option personally, but others might find it useful.

"run_proxy.bat" may not be executed with a low but persistent possibility

When we run our bot on clusters, we see a low but persistent crash rate of our bot, about 1 out of 50 games. After printing out the log, we found that the "run_proxy.bat" was not executed for those crashed games(but this file does exist, just not executed). We run a python model in "run_proxy.bat", which is essential to our bot.

We think this may caused by java Runtime environment in line 146 of /src/utility/WindowsCommandTools.java
Process proc = Runtime.getRuntime().exec(windowsCommandPrefix + command); Too frequent commands may invalidate this one.

We did a test to simulate this situation, the code is published in https://github.com/LukeZhuang/test_proxy. We use Java Runtime to run the test "run_proxy.bat" for 200 times and wait for 10 seconds after each 2 times. After checking "output.txt", we found that "run_proxy.bat" was in fact executed for 100 times, just half of them was executed.

Potential Solution:
We found that adding sleep command after excuting Java Runtime can solve this problem. For example:
Process proc = Runtime.getRuntime().exec(windowsCommandPrefix + command);
Thread.sleep(10);
Then the crash rate is 0 after adding that.
Probably it creates a latency so it make sure that each command will not be overrided.
After adding this to our test simulation, we found that "run_proxy.bat" was executed for 160 times, more than before, but still not 200 times. So, we think we can conclude that this problem is caused by too frequent commands.

Clients do not update State to RUNNING on low-end machines with 1 CPU core

I set up 2 Windows 10 VMs with 4 GB of RAM and 1 CPU.
I also tried 4 VMs that way.

In both cases there would be one VM hosting a server and one client, while the rest hosts clients. All VMs reside on the same host machine with 12 Cores and 32 GB of RAM. The virtual disks are located on a SSD.

Running with 1 Core and 4 GB RAM caused the client to not set the state to RUNNING, but left it at STARTING after starting the Starcraft Game. The game then runs, but no data is transferred to the server. After about 5 to 10 minutes the client recovers, sets the state to RUNNING and eventually continues with tournament execution.

When setting CPU count to 2 everything runs just fine.

It's not a big issue, but I could run double the amount of VMs if this would work. I assume it has something to do with threads that get paused and only recover when the process eventually receives processing time.

I will have a look into this when I have more time this week.

Questions about Cherrypi

We installed CUDA9.0 and corresponding CuDNN as you suggested and we tried to run Cherrypi again. It still doesn't work and stuck like this.
QQ图片20190626164033
And if we run Cherrypi.exe straightly, there is an error printed on the screen.
IMG_20190626_165928
We don't know what's wrong with it. we appreciate it if you could tell us what to do next.

replay is twisted

very strange issue.

I use TM to play games. I firstly notice that some replay is strange, seems like bugs in my bot.
so I create a one-one match on two VM, using the same injectory.x86.exe command to start both bots, I watch my bots playing through the game until the end. but when I load the replay to see some detail info,
I found that after about 20 minutes playing, my bot's behavior is totally different from what I saw before, it seems like another bot take over this.
I also log some detail information, like how many unit I own at this time, and it also totally different from what the replay shows. I has tested many time and this situation is continuously happening.

I don't has any clue about why this can happen, has anyone encounter this issue before?
Thanks

Add support for BWAPI 4.4.0 (but not 4.3.0 because it crashes a lot)

Update 2019-03-24: the original plan was to add support for BWAPI 4.3.0 and that is how this issue was originally written, but the plan changed to only add support for BWAPI 4.4.0, not 4.3.0 too. So I have edited this issue to replace references of BWAPI 4.3.0 with just BWAPI 4.4.0 (even though the commit history will show that 4.3.0 was added then 4.4.0 added then 4.3.0 removed).

Add support for BWAPI 4.4.0 by adding Required_BWAPI_440.zip. The only differences for Required_BWAPI_440.zip compared with Required_BWAPI_420.zip are the updated TournamentModule.dll that needs to be built (using the updated ExampleTournamentModule.vcxproj file from BWAPI, and also add the source code to a separate folder), and the updated official BWAPI.dll & updated official SNP_DirectIP.snp. Also, remove Multiple Instance Hack.bat, bspatch.exe, starcraft.bsdiff because they were removed from BWAPI several versions ago (since version 4.1.2).

For the source code for TournamentModule.dll, I will combine the updated ExampleTournamentModule.vcxproj file from BWAPI 4.4.0 with the TM source code for BWAPI 4.2.0 from after #32 was fixed, so that those permissions fixes are also applied to BWAPI 4.4.0.

To ensure compatibility with BWAPI 4.4.0, I recommend installing the latest version of the x86 "Microsoft Visual C++ Redistributable for Visual Studio 2017". https://support.microsoft.com/en-au/help/2977003/the-latest-supported-visual-c-downloads provides a download link to whatever the latest version is. The links on that page change every time they release a new version. Currently (as-at 2019-03-24), the version of the redist is 14.16.27027, although it is actually displayed in Add/Remove Programs as 14.16.27027.1.

some confusing problems

We tried to run the Starcraft AI Tournament Manager and we encountered some problems which make us confused.

  1. We added some bots of AIIDE2018 to the competition and modified server_settings.json as stated, but some bots didn’t do any action in some specific games( such as Locutus vs. CSE, Locutus didn’t do anything) when they act normal in other games.
  2. When the game of Cherrypi begins, the starcraft will crash and has no response.

load other dll at run time

Hi,

I wonder what's the standard way to load other dlls at run time using dll-bots?
add ./AI directory to PATH or specify the dll path in code?

Thanks

Is there some way let StarcraftAITournamentManager enable CompleteMapInformation?

StarcraftAITournamentManager is a excellent tools to run and visualize game result with multiplayer.
It is necessary to generate training data for my Bot learning. But I can not get the groundtruth value without CompleteMapInformation flag. I am tired of using chaoslauncher to set diffrent version BWAPI's opponent one by one.
Wish you tell me how to generate groundtruth values while StarcraftAITournamentManager run. I know it can get the CompleteMapInformation refer to bwapi/bwapi#594

Missing source code for TournamentModule.dll for BWAPI version 4.2.0

The source code is missing for TournamentModule.dll for BWAPI version 4.2.0, i.e. the file bwapi-data/TournamentModule.dll contained in server/required/Required_BWAPI_420.zip. For the other versions it is located at e.g. src/tournamentmodule/BWAPI_412

Please could it be added? The reasons are for transparency and because I would like to build my own variant of TournamentModule.dll for BWAPI 4.2.0 that runs on Windows XP SP3 (FYI, BWAPI 4.2.0 doesn't work on Windows XP SP3 and I've already proposed a fix to BWAPI in bwapi/bwapi#733). Thanks

Game not started counted incorrectly

If a game doesn't start (rare, but happens, the away client sometimes can't join the game) I believe it is counted as a crash for the bot that reports first, even though both report crashes (because in a normal game we assume whoever reports first crashed first).

I believe the proper solution is to reschedule the game.

client occasionally getting stuck in Status: SENDING

Attaching some screenshots. As you can see from the first screenshot, the tournament manager client got stuck in "SENDING" status and the StarCraft process is still running. It happens often enough and requires manual intervention. What could be causing the issue?
stuckclient1

nonstuckclient2
server

Client gets stuck in loop on: CMD /C taskkill /T /F /IM StarCraft.exe

I have the server and client set up on local machine, and another client in a Win10VM.

The clients see the server, and can start starcraft.

Problem: The clients (on either machine) when hitting the CMD /C taskkill /T /F /IM StarCraft.exe cannot continue further. BW does not close for them, freezing the tournament.

Game Speed slider setting in game lobbies

From #31 point 3. I.E.:

At least a few months before the competition (so we have time for sufficient training/testing), tell us in the Rules page whether the Game Speed slider in the game lobbies will be set to Normal or Fastest (i.e. LF3 or LF6 respectively). I added a feature request to BWAPI to make organizers' management easier for this (bwapi/bwapi#807). If you want to use "Fastest", I suggest you ask as early as possible whether there are any objections from the big teams like Facebook and Sumsung and other serious competitors, because bots that rely on ML training might need a lot of time/resources to be re-trained.

In the Undermind podcast Episode 18 in the part from 51:03-54:32, Dave (with some comments from Antiga) replied to my question about whether AIIDE 2019 will set the Game Speed slider in the game lobbies to "Normal" or "Fastest". Just need to clarify the Rules page similarly to how CIG worded their rules (here), depending on whether you want "Normal" or "Fastest", then this issue can be closed.

Background: In GitHub on StarcraftAITournamentManager's "ladder" branch, it's configurable and in the default config file, the "lobbyGameSpeed" setting is set to "Normal". If last year's bots are re-entered (e.g. SAIDA and/or CherryPi if they don't get updated - note that Dave mentioned that CherryPi used trained models), AIIDE 2019 may want to stick with "Normal" in case last year's bot versions don't work properly using "Fastest". E.g. CIG 2018 used "Fastest" and Overkill (re-entered without any update from the previous year) seemed to perform badly due to using "Fastest" (refer to the last comment at http://satirist.org/ai/starcraft/blog/archives/678-CIG-2018-Overkill-was-broken.html and http://satirist.org/ai/starcraft/blog/archives/686-CIG-2018-not-only-Overkill-was-broken.html).

Can't upload bot

I attempted to upload PurpleWave.zip, which contained PurpleWave.jar and BWAPI.dll. But the upload fails, with returning a HTTP 500 error

PurpleWave.zip

4.4 Tournament Module mistimes client bots

BWAPI 4.4 provides very different timing information for client and module bots. This bug causes the current 4.4 Tournament Module to miscalculate the amount of time a client bot has spent running, usually a vast overestimate.

Let's say there's a bot that spends 1ms on each onUnitShow and 20ms on each onFrame. On a frame where two units show, and the bot takes 22ms to handle all its events. If the tournament manager adds up getLastEventTime()s for each event:

  • If it's a module bot, the tournament manager sees the bot take 22ms
  • If it's a client bot, the tournament manager sees the bot take 66ms

Empirically I've observed this happening to PurpleWave on the AIIDE ladder. In one game where it got disqualified after 7:29 game minutes and under 4 real-time minutes:

  • Bot says: 19 frames went over 55ms
  • JBWAPI says: 33 frames went over 42ms
  • Tournament Module says: 320 frames went over 55ms

Add bot packs from all AIIDE competitions

Right now you have the bots from 2014, 2015, 2016 and 2017 included. It would be nice if you add the bots from all the other previous competitions so people don't have to download them manually. 🙂

support of machine learning library

because it is much more efficient to use other language(ie. python) to write some machine learning code on top of some library(ie. tensorflow), but the official AIIDE tournament machine seems do not support such python library.
so I has several questions:

  1. do you have plan to do such things in future?
  2. is the submitted AI folder has space limitation? for example, can i put a pre-config python version in the AI folder which may occupy about 30m.
  3. other recommended alternative?

@davechurchill @richard-kelly

Thanks

File I/O not synchronized immediately between rounds

I'm using the tournament manager in a way where the game schedule has every following game to also be in a new round, e.g.
...
game 15, round 0
game 16, round 1
game 17, round 2
...
Hoping that the TM would synchronize the File I/O after each round. It looks like that doesn't always work though.
For example, I tested with the following games: BotA vs BotB, BotB vs BotA, BotA vs BotB and in the third game, BotA didn't seem to have access to the second game.
What could the issue be? Is File I/O really synchronized after each round or could there be any delays?

Suggestions for the AIIDE competition and/or ladder

I have finally got around to listening to the Undermind podcasts and noticed that in one episode, you asked long-time bot developers for suggestions for StarcraftAITournamentManager for AIIDE. Pasting the relevant discussion from Discord:

I have some suggestions for what's missing from current tournament setups:

1. Rules/logic for Current Working Dir and run_proxy.bat

Refer to the e-mail conversation I had with Dave and Rick about this at the end of Oct '18.
Clarify in the Rules page whether the new TM software will set the current working dir to the Starcraft dir (e.g. C:\TM\Starcraft) or the AI dir (e.g. C:\TM\Starcraft\bwapi-data\AI), for DLL bots and non-DLL bots like EXEs/JARs. Afaik, sc-docker always sets the current working dir to the Starcraft dir (not the AI dir) then starts bwapi-data/AI/.dll or bwapi-data/AI/run_proxy.bat. Should non-DLL bots submit a run_proxy.bat file, and if so, should it change the working dir at all (if so, to what absolute path or what relative path?)? Or for non-DLL bots, perhaps authors should submit a run_proxy.bat file that either doesn't set/change it, or sets it to a particular environment var if it exists (e.g. AIIDE_STARCRAFT_DIR), otherwise the bot is allowed to set it to whatever they like (so that it will work on their personal dev/test environments and AIIDE without editing). Even UAlbertaBot is confusing - its' run_proxy.bat does "cd c:\TM\Starcraft\bwapi-data\AI" then "c:\TM\Starcraft\bwapi-data\AI\UAlbertaBot.exe" then its' config file sets the "ReadDirectory" setting to "../read/" and "WriteDirectory" to "../write/". Even though the Rules page says to use "bwapi-data/read" and "bwapi-data/write". If this isn't fixed or clarified (ideally fix StarcraftAITournamentManager to follow the Rules page, which is also how sc-docker works), we will keep seeing broken bots and teething problems in the various competitions. It is a pity this single issue has caused so many broken/weak bots in past AIIDE & CIG competitions.

PurpleWave / Cheese Maven: I think StarCraft directory is intended to be the one true working directory
just that implementations of run_proxy.bat in tournaments (namely, CIG) have not achieved that consistently

Afaik, the latest dev version of StarcraftAITournamentManager sets it to the .../Starcraft/bwapi-data/AI folder (not the .../Starcraft folder), so unless that is fixed, the run_proxy.bat file must be set up to include a pushd or cd command that changes the working dir (to e.g. C:\TM\Starcraft or ../..) in order to get the bot to work properly (e.g. find BWTA2 map data at the correct location, and so that File I/O uses the correct paths to the read and write folders etc).

The main change would be to edit ClientCommands.java and change the line:
WindowsCommandTools.RunWindowsCommand("cd " + ClientSettings.Instance().ClientStarcraftDir + "bwapi-data\\AI & "+ ClientSettings.Instance().ClientStarcraftDir + "bwapi-data\\AI\\run_proxy.bat", false, false);
to:
WindowsCommandTools.RunWindowsCommand("cd " + ClientSettings.Instance().ClientStarcraftDir & "+ ClientSettings.Instance().ClientStarcraftDir + "bwapi-data\\AI\\run_proxy.bat", false, false);
... and also change UAlbertaBot accordingly if you still want UAlbertaBot to work. I don't know whether any other old AIIDE bots would need updating (possibly just some of their run_proxy.bat files). On the AIIDE competition website (maybe on the Rules page) I also suggest showing a sample run_proxy.bat file for a JAR bot and a sample run_proxy.bat for an EXE bot.

2. Ensure the Tournament Module allows some permissions for some versions of BWAPI

Update: this point has been moved into #32.

After the bug in point 7 is fixed, rebuild the TournamentModule.dll's (for BWAPI 4.2.0 and 4.1.2 at least - I wouldn't bother fixing 4.0.1 Beta, and I wouldn't bother changing 3.7.4 which doesn't allow any permissions) to allow bots to do setLatCom(false) and setCommandOptimizationLevel(a value other than 1, i.e. especially 0 or 2, but perhaps some other authors might want 3 or 4). They don't affect the opponent bot at all - it only affects what info BWAPI returns to you, and some bots rely on them. The default should probably stay as 1, but I think bots should be allowed to set it to 0 and other values if they want to, even though a value of 0 may increase the bot's APM and replay file sizes, because some bots rely on them and currently there is no way for a bot to check what the command optimization level is. And anyway, currently, BWAPI version 4.2.0/4.1.2/4.0.1 Beta bots have always done this until now, due to the bug, so I don't think it's a problem. I suggest to also allow leaveGame(), so that bots can leave the game to indicate they are resigning/surrendering in lost positions, or in bugged states to attempt to avoid crashing later (and this may help address bwapi/bwapi#719
). This might also help increase the overall game rate, so long as Starcraft or bots don't/rarely crash when leaving, because bot-vs-bot endgames can often take a lot of time if the winning bot is weak/slow. Personally, I don't care whether sendText/printf/setTextSize are allowed, so I would probably disallow them on anti-collusion grounds and in case they help to increase performance, but I think the others should be disallowed.

Note: until the bug noticed in point 7 is fixed, the Tournament Module for BWAPI versions 4.2.0, 4.1.2 and 4.0.1 Beta actually allows all permissions (even for DLL bots, not just for non-DLL bots). This point should be addressed after point 7 is fixed.

3. Game Speed slider setting in game lobbies

Update: this issue has been moved to #37.

At least a few months before the competition (so we have time for sufficient training/testing), tell us in the Rules page whether the Game Speed slider in the game lobbies will be set to Normal or Fastest (i.e. LF3 or LF6 respectively). I added a feature request to BWAPI to make organizers' management easier for this (bwapi/bwapi#807). If you want to use "Fastest", I suggest you ask as early as possible whether there are any objections from the big teams like Facebook and Sumsung and other serious competitors, because bots that rely on ML training might need a lot of time/resources to be re-trained.

4. Ability to disable bots (not just ignore their results)

Ability to disqualify a bot (manually at least, perhaps also automatically based on some thresholds) so that it doesn't play any of the remaining games, e.g. if it crashes/times out too much. I know there's already a feature to exclude a bot from the results summaries, but afaik it still plays all the remaining games. I could be wrong. I don't want this ability for my testing - it's just an idea you might find helpful.

5. Better checks for why some games fail to start

Better checks for whether the TM actually handed control to each individual bot for frame 0 and whether each individual bot actually returned control to the TM on frame 0, so that it is clear whether games that didn't start properly are a problem before each bot was started (i.e. not either of the bots' fault), or a problem after each bot tried to start. I haven't investigated whether the following is how StarcraftAITournamentManager already works, but please check the following cases:

  • If HeroBot started ok and returned control to the TM on frame 0, but the TM never got as far as starting the call(s) to MegaBot's binaries for frame 0, HeroBot should count it as a win, and MegaBot's "total games played" shouldn't count that game. Or if you want symmetry, count is as a loss for MegaBot.
  • If HeroBot started ok and returned control to the TM on frame 0, and the TM started the call(s) to MegaBot's binaries for frame 0 but the TM never got as far as passing control to MegaBot for frame 0 (e.g. missing mandatory DLL dependencies, so MegaBot didn't get as far as entering its onStart() function), HeroBot should count it as a win, and it's up to you whether it should be counted as a loss for MegaBot (if you want symmetry) or MegaBot's "total games played" shouldn't count that game. In this case, it's unclear whether to blame MegaBot or an environmental problem caused by the TM or Starcraft/bots from old games (e.g. out of memory from a old processes that are still running for whatever reason).
  • If HeroBot started ok and returned control to the TM on frame 0, and the TM passed control to MegaBot for frame 0 but MegaBot didn't return control back to the TM for frame 0 (this happened a lot for some bots like MegaBot), HeroBot should be assigned a win (rather than ignoring the game entirely), and MegaBot should be assigned a loss.

I don't know whether there's any way in the TM to distinguish between the last two cases though. In all cases, try to distinguish the various cases as much as feasible in a field that stores the reason for the result for that bot.

6. Request a new official BWAPI 4.x release

Update: this point has been moved into #34.

Request a new official BWAPI 4.x release (4.2.0 was released most recently, so it would be something like 4.3.0) and build the corresponding TournamentModule.dll (& add it & its source code to GitHub). A few bots are probably now using a more recent dev version of BWAPI than 4.2.0 (post-4.2.0 includes improvements to BWAPI's latency compensation logic, among other things).

7. TournamentModule.dll allows all permissions for BWAPI version 4 (e.g. 4.2.0, 4.1.2, 4.0.1 Beta)!

Update: this point has been moved into #32.

Due to a change to a BWAPI function's argument type as part of the first release of version 4 that was not correspondingly migrated into the Tournament Module (i.e. the TournamentModule::onAction function's first argument type was changed from an into to a BWAPI::Tournament::ActionID), permissions like enableFlag(CompleteMapInformation), setLocalSpeed(42) are not enforced by TournamentModule.dll, because the default implementation of the function that is defined in BWAPI is being used, which always returns true. This is why the Sling bot was able to successfully do setLocalSpeed(42) and setFrameSkip(0) until Sling's source code was patched, and the Tyr/TyrProtoss bot was able to successfully do setLocalSpeed(10) in the AIIDE and CIG competitions, which slowed down the runs. If any bot that uses BWAPI 4 had cheated by doing things like enableFlag(CompleteMapInformation), the tournament module wouldn't have stopped them. Note that this is true for non-DLL bots and for DLL bots (originally I thought it only affected non-DLL bots, but after investigating and finding the cause of the bug I realized it affects DLL bots too).

8. Add a Win Percentage Per Map Cycle Graph

In the summary results, add a graph for "Win Percentage Per Map Cycle Graph". So if there are 10 maps, rather than ~100 points the X axis, there would only be 100/10 = 10. For each point on the X axis, it would only consider the games for that particular cycle through the set of maps (not consider the earlier cycles too). This avoids the noise caused by bots being better on some maps than others, and makes it easier to identify turning points in the progress of a bot's learning.

9. Add a Win Percentage Over Time by Map Cycle Graph

In the summary results, add a graph for "Win Percentage Over Time by Map Cycle Graph". For each point on the X axis, it would only consider the games for that map cycle and the earlier cycles combined. This avoids the noise caused by bots being better on some maps than others, and shows the rankings as-at the end of each map cycle.

10. Add an ability to pick race randomly out of Terran/Protoss/Zerg in the game lobby

I am not suggesting to forbid picking "Random" race in the game lobby - just to allow bots to specify that the TM should pick randomly out of Terran/Protoss/Zerg from the drop-down in the game lobby. This makes the management easier for authors so they can easily write and update a single bot that supports playing as different races (rather than needing to set up & update one bot that always plays as Terran like tscmoo (Terran), one bot that always plays as Protoss like tscmoop, one bot that always plays as Zerg like tscmooz). Note: in terms of game results records and File I/O, it is important to distinguish between picking "Random" race from the drop-down and picking a specific race out of Terran/Protoss/Zerg, because the meta is quite different when the opponent knows your race at the very start of the game - they don't need to scout your race or common proxy locations to help rule out some of the various possible early game attacks like 4-6 pool, offensive sunken rush, cannon rush, BBS or bunker rush etc. Some human players despise (& I get the feeling some bot authors dislike) that the meta is different against Random race players that exploit the fact that the opponent does not know their race, compared with knowing the opponent's race. I know that Dave doesn't see this as a concern for AIIDE until a bot actually relies on it, but personally I think this feature would be handy for future-proofing in case it becomes a problem sooner than expected. No big deal.

11. Add support for BWAPI 3.7.5

Add support for BWAPI 3.7.5. I wouldn't use it, but some of the GOAL-based bots in particular, might.

12. Add remaining SSCAIT & CIG maps with BWTA2/BWTA data

Add the map files and BWTA2 & BWTA data for the SSCAIT and CIG maps. E.g. create "maps/sscai" and "maps/cig" folders for the map files within each ZIP file in the "server/required" folder that corresponds to a particular BWAPI version, and similarly for the "bwapi-data/BWTA" and "bwapi-data/BWTA2" folders. This will make it easier for the CIG organizers to run their competitions, and would be very convenient for bot authors that want to train their bot. I know there is occasionally talk of changing the map pool for some comps/ladders, but I wouldn't hold my breath. The map files and BWTA2 & BWTA data for the remaining CIG maps can be downloaded from here. The map files for SSCAIT can be downloaded from here but I am not aware of an official source for their BWTA2/BWTA data. I could send you the files I have, or I could fork & add what I have. I probably downloaded them from another bot, or I made a bot generate them.

13. Separate storage

It's quite time-consuming to manage the "Required_BWAPI_.zip" files, e.g. to add a support for a new BWAPI version or add maps to all supported BWAPI versions. Most of the contents don't seem to vary according to the BWAPI version, so a feature that might make it easier for organizers and bot authors to manage in future is to separate the common files to a separate ZIP file. I.E. almost everything except the BWAPI-related DLLs, bwapi.ini, "Multiple Instance Hack.bat", TournamentModule.dll, Broodwar.map, bspatch.exe, starcraft.bsdiff, maybe injectory.x86.exe (not sure whether this depends on BWAPI version), and SNP_DirectIP.snp. I suggest that almost all of the files that are used on client VMs except the actual bot files/data are installed on client VMs. Some automation could be added that recreates the bwapi-data folder etc and copies the files into place each game, rather than downloaded every time a client downloads a bot. This avoids wasting a lot of time downloading a lot of data from the server every game. Some folders should be re-created every game though, e.g. the bwapi-data folder, and maybe the characters folder, and maybe older BWAPI versions like 3.7.4 or 3.7.5 have some special files/folders (not sure). Likewise, the files associated with a particular version of BWAPI could all be installed somewhere on the client VMs and copied into place every game, depending on the BWAPI version used by the bot.

14. Add dependencies for BWAPI/bot-related libraries

Install onto the client VMs' Starcraft folder the DLLs etc for BWAPI-related libraries that bots commonly depend on such as the various versions of BWAPI bridge (bwapi_bridge1_2.dll, bwapi_bridge2_3.dll, bwapi_bridge2_4.dll, bwapi_bridge2_5.dll, bwapi_bridge2_6.dll), QtCore4.dll, QtGui4.dll, and the files sc-docker has at https://github.com/Games-and-Simulations/sc-docker/tree/master/docker/dlls. And config files used by some bots like Aiur to configure where the correct locations of the read and write folders are (directories.txt, file_settings.txt) to stop them updating files in the Starcraft folder itself. This would really help to more easily set up and manage client VMs and avoid a lot of headaches trying to get bots to start / work properly due to missing DLL dependencies or File I/O configuration issues. I can add the files I have to a fork if you like.

Possibly Starcraft UDP Connection Issue?

I tried to use one machine to run both server/run_server.bat and client/run_client.bat, and a second machine to start a client. The server was able recognize it, alongside the client created on the machine which started the server. The server tried to start a game, one client (non-server side) then launched an instance of the Starcraft game, and the game crashed/was terminated after seeing the scene where the game lets you to choose which connection type (Battle.net, UDP, etc.). The other client (server side) also launched the game, and was stuck at the scene where the game lets you to choose game mode (single player, multiplayer, etc.). I wonder if the UDP connection (supposedly the type to use here) is not set up properly, or was this caused by something else?

Bugfixes to Tournament Module permissions for BWAPI versions 4.2.0 & 4.1.2

From #31 points 7 then 2. I.E.:

#31 point 7 is that there is a bug in the Tournament Module that causes it to allows all permissions for BWAPI version 4 (e.g. 4.2.0, 4.1.2, 4.0.1 Beta)!

Due to a change to a BWAPI function's argument type as part of the first release of version 4 that was not correspondingly migrated into the Tournament Module (i.e. the TournamentModule::onAction function's first argument type was changed from an into to a BWAPI::Tournament::ActionID), permissions like enableFlag(CompleteMapInformation), setLocalSpeed(42) are not enforced by TournamentModule.dll, because the default implementation of the function that is defined in BWAPI is being used, which always returns true. This is why the Sling bot was able to successfully do setLocalSpeed(42) and setFrameSkip(0) until Sling's source code was patched, and the Tyr/TyrProtoss bot was able to successfully do setLocalSpeed(10) in the AIIDE and CIG competitions, which slowed down the runs. If any bot that uses BWAPI 4 had cheated by doing things like enableFlag(CompleteMapInformation), the tournament module wouldn't have stopped them. Note that this is true for non-DLL bots and for DLL bots (originally I thought it only affected non-DLL bots, but after investigating and finding the cause of the bug I realized it affects DLL bots too).

#31 point 2 should be addressed after point 7 is fixed. I.E. ensure the Tournament Module allows some permissions for some versions of BWAPI.

After the bug in point 7 is fixed, rebuild the TournamentModule.dll's (for BWAPI 4.2.0 and 4.1.2 at least - I wouldn't bother fixing 4.0.1 Beta, and I wouldn't bother changing 3.7.4 which doesn't allow any permissions) to allow bots to do setLatCom(false) and setCommandOptimizationLevel(a value other than 1, i.e. especially 0 or 2, but perhaps some other authors might want 3 or 4). They don't affect the opponent bot at all - it only affects what info BWAPI returns to you, and some bots rely on them. The default should probably stay as 1, but I think bots should be allowed to set it to 0 and other values if they want to, even though a value of 0 may increase the bot's APM and replay file sizes, because some bots rely on them and currently there is no way for a bot to check what the command optimization level is. And anyway, currently, BWAPI version 4.2.0/4.1.2/4.0.1 Beta bots have always done this until now, due to the bug, so I don't think it's a problem. I suggest to also allow leaveGame(), so that bots can leave the game to indicate they are resigning/surrendering in lost positions, or in bugged states to attempt to avoid crashing later (and this may help address bwapi/bwapi#719
). This might also help increase the overall game rate, so long as Starcraft or bots don't/rarely crash when leaving, because bot-vs-bot endgames can often take a lot of time if the winning bot is weak/slow. Personally, I don't care whether sendText/printf/setTextSize are allowed, so I would probably disallow them on anti-collusion grounds and in case they help to increase performance, but I think the others should be disallowed.

1 vs N tournament

Hi,

I notice that when the tournament type set to 1vsN, the schedule of the tournament is not paralleling even though I have enough machines.
for example, there are three bots : A, B, C the schedule is sequential :
A-B
A-C
not A-B and A-C holding on four different machines.

as far as I know, paralleling the game for each round may satisfy current AIIDE rules, so is there some settings which I missed to achieve this...

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.