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
231 stars 39 forks source link

Incorrect Map Selection #72

Open RothNath opened 6 years ago

RothNath commented 6 years ago

expected behaviour

Map noted in --map should be the map selected.

actual behaviour

Running --map "sscait/(4)Jade.scx" actually selects (2)Heartbreak Ridge.scx.

steps to reproduce

scbw.play --bots "Purplewave" "Krasi0" --auto_launch --game_speed 0 --map "sscait/(4)Jade.scx" --log_level=DEBUG --log_verbose;

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

PS C:\Users\557> scbw.play --bots "Purplewave" "Krasi0" --auto_launch --game_speed 0 --map "sscait/(4)Jade.scx" --log_level=DEBUG --log_verbose; 2018-05-05 21:09:57 DEBUG docker.utils.config[9512] Trying paths: ['C:\Users\557\.docker\config.json', 'C:\Users\557\.dockercfg'] 2018-05-05 21:09:57 DEBUG docker.utils.config[9512] Found file at path: C:\Users\557.docker\config.json 2018-05-05 21:09:57 DEBUG docker.auth[9512] Found 'auths' section 2018-05-05 21:09:57 DEBUG docker.auth[9512] Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead. 2018-05-05 21:09:57 DEBUG docker.auth[9512] Found 'credsStore' section 2018-05-05 21:09:57 DEBUG scbw.bot_storage[9512] checking bot in C:\Users\557\AppData\Roaming/scbw/bots/Purplewave 2018-05-05 21:09:57 DEBUG scbw.bot_storage[9512] found bot in C:\Users\557\AppData\Roaming/scbw/bots/Purplewave 2018-05-05 21:09:57 DEBUG scbw.bot_storage[9512] checking bot in C:\Users\557\AppData\Roaming/scbw/bots/Krasi0 2018-05-05 21:09:57 DEBUG scbw.bot_storage[9512] found bot in C:\Users\557\AppData\Roaming/scbw/bots/Krasi0 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] checking docker-machine presence 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] using docker machine version version 0.12.2, build 9371605 Error: No machine name(s) specified and no "default" machine exists 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] docker machine not present 2018-05-05 21:09:57 DEBUG scbw.game[9512] Using vnc host 'localhost' 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] docker_image=starcraft:game-1.0.1 command=['/app/play_bot.sh', '--headful'] name=GAME_D57EB4B2_0_PurpleWave detach=True environment={ 'BOT_BWAPI': '4.1.2', 'BOT_FILE': 'PurpleWave.jar', 'CAPTURE_MOUSE_MOVEMENT': '0', 'DROP_PLAYERS': '0', 'EXIT_CODE_REALTIME_OUTED': 2, 'GAME_NAME': 'GAME_D57EB4B2', 'GAME_TYPE': 'FREE_FOR_ALL', 'HEADFUL_AUTO_LAUNCH': '1', 'HIDE_NAMES': '0', 'JAVA_DEBUG': '0', 'MAP_NAME': '/app/sc/maps/sscait/(4)Jade.scx', 'NTH_PLAYER': 0, 'NUM_PLAYERS': 2, 'PLAYER_NAME': 'PurpleWave', 'PLAYER_RACE': 'P', 'SPEED_OVERRIDE': 0, 'TM_ALLOW_USER_INPUT': '0', 'TM_LOG_FRAMETIMES': '../logs/frames.csv', 'TM_LOG_RESULTS': '../logs/scores.json', 'TM_SPEED_OVERRIDE': 0} privileged=True volumes={ '//c/Users/557/AppData/Roaming/scbw/bots/Purplewave': { 'bind': '/app/bot', 'mode': 'ro'}, '//c/Users/557/AppData/Roaming/scbw/bwapi-data/BWTA': { 'bind': '/app/sc/bwapi-data/BWTA', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/bwapi-data/BWTA2': { 'bind': '/app/sc/bwapi-data/BWTA2', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/games/GAME_D57EB4B2/logs_0': { 'bind': '/app/logs', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/games/GAME_D57EB4B2/write_0/': { 'bind': '/app/sc/bwapi-data/write', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/maps': { 'bind': '/app/sc/maps', 'mode': 'rw'}} network=sc_net ports={'5900/tcp': 5900}

2018-05-05 21:09:57 INFO scbw.docker_utils[9512] launched BotPlayer:PurpleWave:P 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] container name = 'GAME_D57EB4B2_0_PurpleWave', container id = '['d29bba2e0e']' 2018-05-05 21:09:57 DEBUG scbw.docker_utils[9512] docker_image=starcraft:game-1.0.1 command=['/app/play_bot.sh', '--headful'] name=GAME_D57EB4B2_1_krasi0 detach=True environment={ 'BOT_BWAPI': '4.2.0', 'BOT_FILE': 'krasi0AIClient.exe', 'CAPTURE_MOUSE_MOVEMENT': '0', 'DROP_PLAYERS': '0', 'EXIT_CODE_REALTIME_OUTED': 2, 'GAME_NAME': 'GAME_D57EB4B2', 'GAME_TYPE': 'FREE_FOR_ALL', 'HEADFUL_AUTO_LAUNCH': '1', 'HIDE_NAMES': '0', 'JAVA_DEBUG': '0', 'MAP_NAME': '/app/sc/maps/sscait/(4)Jade.scx', 'NTH_PLAYER': 1, 'NUM_PLAYERS': 2, 'PLAYER_NAME': 'krasi0', 'PLAYER_RACE': 'T', 'SPEED_OVERRIDE': 0, 'TM_ALLOW_USER_INPUT': '0', 'TM_LOG_FRAMETIMES': '../logs/frames.csv', 'TM_LOG_RESULTS': '../logs/scores.json', 'TM_SPEED_OVERRIDE': 0} privileged=True volumes={ '//c/Users/557/AppData/Roaming/scbw/bots/Krasi0': { 'bind': '/app/bot', 'mode': 'ro'}, '//c/Users/557/AppData/Roaming/scbw/bwapi-data/BWTA': { 'bind': '/app/sc/bwapi-data/BWTA', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/bwapi-data/BWTA2': { 'bind': '/app/sc/bwapi-data/BWTA2', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/games/GAME_D57EB4B2/logs_1': { 'bind': '/app/logs', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/games/GAME_D57EB4B2/write_1/': { 'bind': '/app/sc/bwapi-data/write', 'mode': 'rw'}, '//c/Users/557/AppData/Roaming/scbw/maps': { 'bind': '/app/sc/maps', 'mode': 'rw'}} network=sc_net ports={'5900/tcp': 5901}

2018-05-05 21:09:58 INFO scbw.docker_utils[9512] launched BotPlayer:krasi0:T 2018-05-05 21:09:58 DEBUG scbw.docker_utils[9512] container name = 'GAME_D57EB4B2_1_krasi0', container id = '['0ac97ab0b2']' 2018-05-05 21:09:58 DEBUG scbw.docker_utils[9512] checking if game has launched properly... 2018-05-05 21:09:59 INFO scbw.docker_utils[9512] launching vnc viewer for BotPlayer:PurpleWave:P on address localhost:5900 2018-05-05 21:09:59 INFO scbw.docker_utils[9512] 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. 2018-05-05 21:09:59 INFO scbw.docker_utils[9512] waiting until game GAME_D57EB4B2 is finished... 2018-05-05 21:09:59 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:02 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:05 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:08 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:11 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:14 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:17 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:20 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:23 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:26 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:29 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:32 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:35 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:38 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:41 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:44 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:47 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:50 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:53 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:56 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:10:59 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:02 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:05 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:08 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:11 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:14 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:17 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:20 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:23 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:26 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:29 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:32 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:35 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:38 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:41 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:44 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:47 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:50 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:53 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:56 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:11:59 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:02 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:05 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:08 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:11 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:14 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:17 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:21 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:24 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:27 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:30 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:33 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:36 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:39 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:42 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:45 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:48 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:51 DEBUG scbw.docker_utils[9512] waiting. ['0ac97ab0b2', 'd29bba2e0e'] 2018-05-05 21:12:54 DEBUG scbw.docker_utils[9512] removing game containers Traceback (most recent call last): File "c:\python364\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\python364\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Python364\Scripts\scbw.play.exe__main__.py", line 9, in File "c:\python364\lib\site-packages\scbw\cli.py", line 224, in main game_result = run_game(args) File "c:\python364\lib\site-packages\scbw\game.py", line 138, in run_game is_crashed=game_result.is_crashed, File "c:\python364\lib\site-packages\scbw\result.py", line 133, in is_crashed self._process_files() File "c:\python364\lib\site-packages\scbw\result.py", line 92, in _process_files winner_scorefile.replace('/scores.json', '').split('')[(-1)]) ValueError: invalid literal for int() with base 10: '1\scores.json'

operating system

win 10 pro

docker version

output of command docker version:

Client: Version: 17.09.0-ce API version: 1.32 Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:40:09 2017 OS/Arch: windows/amd64

Server: Version: 17.09.0-ce API version: 1.32 (minimum version 1.12) Go version: go1.8.3 Git commit: afdb6d4 Built: Tue Sep 26 22:45:38 2017 OS/Arch: linux/amd64 Experimental: true

scbw version

output of command scbw.play -v

1.0.1

michalsustr commented 6 years ago

auto_launch is experimental, and possibly platform dependent.

What it does is send proper keys to the SC window (there was some bug with headful mode, where the game cannot start automatically). This is a workaround which tries to figure out how many times it should send the keys in the window to select appropriate file. I don't have access to win michine at the moment, if you feel like you'd like to try to fix it, here's the code: https://github.com/Games-and-Simulations/sc-docker/blob/master/docker/scripts/play_common.sh#L249

RothNath commented 6 years ago

ahhh, yup that does the trick! Thanks! I was playing with it earlier on my linux machine and it does seem to be windows dependent.