Games-and-Simulations / sc-docker

Multi-platform Version of StarCraft: Brood War in a Docker Container, ready to use for bot play simulations.
MIT License
230 stars 41 forks source link

BWAPI 4.4 Support #90

Open christian-geier opened 4 years ago

christian-geier commented 4 years ago

expected behaviour

Can run BWAPI 4.4 bots from the SSCAIT server

actual behaviour

Not running many current bots, e.g. scbw.play --bots "PurpleWave" "Steamhammer"

steps to reproduce

Please run the command issued with --log_level=DEBUG --log_verbose parameters and log:

Traceback (most recent call last): File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/cli.py", line 231, in main game_result = run_game(args) File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/game.py", line 64, in run_game players += retrieve_bots(args.bots, bot_storages) File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/bot_factory.py", line 12, in retrieve_bots maybe_bot = bot_storage.find_bot(bot_name) File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/bot_storage.py", line 28, in find_bot bot = BotPlayer(f_name) File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/player.py", line 77, in init self.bwapi_version = self._find_bwapi_version() File "/home/colslade/.virtualenvs/scbw/lib/python3.8/site-packages/scbw/player.py", line 164, in _find_bwapi_version raise PlayerException((""" scbw.error.PlayerException: Bot uses unrecognized version of BWAPI, with md5 hash cf7a19fe79fad87f88177c6e327eaedc. Supported versions are: 4.2.0, 4.1.2, 3.7.5

operating system

Ubuntu 20.04

Ubuntu lsb_release -a: Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal

docker version

output of command docker version:

Client: Docker Engine - Community Version: 19.03.8 API version: 1.40 Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:25:46 2020 OS/Arch: linux/amd64 Experimental: false

Engine: Version: 19.03.8 API version: 1.40 (minimum version 1.12) Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:24:19 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683

scbw version

output of command scbw.play -v

1.0.4
JonghunBok commented 4 years ago

I added this line return "4.2.0" at the top of _find_bwapi_version(self) in scbw/player.py to bypass the version test. And it works for your example.

Is there a crucial reason to have strict restriction on what version of BWAPI to use? Now I question the very reason why this version check is here in the first place. Do we need this version test?

And in my trial, PurpleWave won by the way.

INFO Successfully downloaded Steamhammer from SSCAIT server
Error: No machine name(s) specified and no "default" machine exists
INFO launched BotPlayer:PurpleWave:P
INFO launched BotPlayer:Steamhammer:Z
INFO launching vnc viewer for BotPlayer:PurpleWave:P on address localhost:5900
INFO launching vnc viewer for BotPlayer:Steamhammer:Z on address localhost:5901
INFO 
In headful mode, you must specify and start the game manually.
Select the map, wait for bots to join the game and then start the game.
INFO waiting until game GAME_2A9551FA is finished...
INFO game GAME_2A9551FA recorded
INFO Game GAME_2A9551FA finished in 484.2211825847626 seconds.
INFO ---
INFO Logs are saved here:
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_0/bot.log
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_0/game.log
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_1/bot.log
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_1/game.log
INFO ---
INFO Replays are saved here:
INFO /home/park/.scbw/games/GAME_2A9551FA/player_0.rep
INFO /home/park/.scbw/games/GAME_2A9551FA/player_1.rep
INFO ---
INFO Frame information is saved here:
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_0/frames.csv
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_1/frames.csv
INFO ---
INFO Game results are saved here:
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_0/scores.json
INFO /home/park/.scbw/games/GAME_2A9551FA/logs_1/scores.json
INFO ---
INFO Winner is BotPlayer:PurpleWave:P (player 0)
0
christian-geier commented 4 years ago

Awesome, thanks!

If other 4.4 bots work as well, could 4.4 be added to the version check? Seems like this may be a very small required change to keep the project compatible with the current BWAPI version !

Wondering whether one could include a brief comment in the readme about this workaround in the meantime.