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 40 forks source link

Where is the read folder? #34

Closed haopan27 closed 6 years ago

haopan27 commented 6 years ago

expected behaviour

Bot reads some file from C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read

actual behaviour

The bot doesn't read anything from there.

steps to reproduce

In PowerShell, run scbw.play --bots Iron Hao --headless

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

scbw.play --bots Iron Hao --headless --log_level=DEBUG
msg1 msg2 msg3

operating system

win (Windows 10 Pro)

Ubuntu lsb_release -a:

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

0.2b3

Additional Comments: I am not sure if C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read is the right path where my bot would read stuff from. If that is the case, should the file structure be set up like the one in ..\write folder (a folder for each game). If that's not the case, where does the bot read files from in each game?

MicroDK commented 6 years ago

You need to add the '--read_overwrite' option when starting the match. This will tell scbw to copy the files from the game's write folder to the read folder after the game. Your bot will read the files directly in the read folder. The write folder's game structure ensures not to get corrupted files if the same bot plays in different terminal windows at the same time.

michalsustr commented 6 years ago

Because it's not mounted! :-D

Somehow I must've deleted mounting read folder when updating some code. Thanks!

michalsustr commented 6 years ago

Fixed in master.

michalsustr commented 6 years ago

The bot reads indeed from C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read.

I've updated the documentation in https://github.com/Games-and-Simulations/sc-docker/blob/master/USAGE.md#add-your-own-bot

haopan27 commented 6 years ago

I am using 0.2b7 scbw.play and still experiencing the bot not being able to read stuff from this folder: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read

Some additional information for diagnosis purposes: I did try to run some games via ChaosLauncher and verified that my bot was able to read stuff from bwapi-data/read and write to bwapi-data/write. When using scbw.play, my bot was able to write stuff to C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\write\Game_ID. And it was able to write stuff to C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read\ when --read_overwrite was typed in.

Any tip where to go from here?

michalsustr commented 6 years ago

I cannot reproduce this issue.

Create some file xxx in bots/CherryPi/read Then launch game, get into container and check if the file is there:


$ scbw.play --bots "CherryPi" "Marian Devecka" --headless

$ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                          NAMES
109515995ead        starcraft:game              "/app/play_bot.sh ..."   5 seconds ago       Up 5 seconds        5900/tcp, 6119/tcp, 6119/udp   GAME_840AB59E_1_Marian_Devecka
0abb972e18e2        starcraft:game              "/app/play_bot.sh ..."   5 seconds ago       Up 5 seconds        5900/tcp, 6119/tcp, 6119/udp   GAME_840AB59E_0_CherryPi

$ docker exec -it 0abb972e18e2 /bin/bash

starcraft@0abb972e18e2:/app$ ls -al sc/bwapi-data/read
total 8
drwxr-xr-x 2 starcraft users 4096 Feb 21 16:17 ./
drwxrwxr-x 9 starcraft users 4096 Feb 21 16:17 ../
-rw-r--r-- 1 starcraft users    0 Feb 21 16:17 xxx
haopan27 commented 6 years ago

Well, I tried the following command instead (since I don't know the name of the file CherryPi tries to read) $ scbw.play --bots "krasi0" "Hao Pan" --headless

Then after the game is done: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

This is strange because nothing is there. I am assuming the contained_ID is different than game_ID, and that's why I didn't try the following command: $ docker exec -it contained_ID /bin/bash

Any idea what caused this?

michalsustr commented 6 years ago

Then after the game is done:

It has to be done while playing, in another terminal.

haopan27 commented 6 years ago

Thanks for the suggestion. I was able to see some content.

scbw.play --bots "krasi0" "Hao Pan" --headless Error: No machine name(s) specified and no "default" machine exists INFO launched BotPlayer:krasi0:T INFO launched BotPlayer:Hao Pan:T INFO Waiting until game GAME_9AC9690F is finished... INFO Game GAME_9AC9690F finished in 107.01475548744202 seconds. INFO --- INFO Logs are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_0_krasi0_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_0_krasi0_game.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_1_Hao_Pan_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_1_Hao_Pan_game.log INFO --- INFO Replays are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_9AC9690F_0.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_9AC9690F_0.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_9AC9690F_1.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_9AC9690F_1.rep INFO --- INFO Frame information is saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_0_frames.csv INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_1_frames.csv INFO --- INFO Game results are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_0_results.json INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_9AC9690F_1_results.json INFO --- INFO Winner is BotPlayer:krasi0:T (player 0) 0

docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5ec984099480 starcraft:game "/app/play_bot.sh ..." 6 seconds ago Up 5 seconds 5900/tcp, 6119/tcp, 6119/udp GAME_9AC9690F_1_Hao_Pan 4f6cff9d94cd starcraft:game "/app/play_bot.sh ..." 7 seconds ago Up 5 seconds 5900/tcp, 6119/tcp, 6119/udp GAME_9AC9690F_0_krasi0

docker exec -it 5ec984099480 /bin/bash To run a command as administrator (user "root"), use "sudo ". See "man sudo_root" for details.

starcraft@5ec984099480:/app$ ls -al sc/bwapi-data/read total 36 drwxr-xr-x 1 starcraft users 4096 Feb 22 14:13 . drwxrwxr-x 1 starcraft users 4096 Feb 22 14:13 .. -rwxr-xr-x 1 starcraft users 144 Feb 22 14:13 Halo_Vs_CherryPi_Params.txt -rwxr-xr-x 1 starcraft users 141 Feb 22 14:13 Halo_Vs_Halo_Params.txt -rwxr-xr-x 1 starcraft users 144 Feb 22 14:13 Halo_Vs_Iron bot_Params - backup.txt -rwxr-xr-x 1 starcraft users 144 Feb 22 14:13 Halo_Vs_Iron bot_Params.txt -rwxr-xr-x 1 starcraft users 143 Feb 22 14:13 Halo_Vs_cpac_Params.txt -rwxr-xr-x 1 starcraft users 419 Feb 22 14:13 Halo_Vs_krasi0.txt -rwxr-xr-x 1 starcraft users 144 Feb 22 14:13 Halo_Vs_krasi0_Params.txt starcraft@5ec984099480:/app$

These files are exactly what I put into that folder. In this matchup, my bot (Halo) is looking for this specific file there: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read\Halo_Vs_krasi0_Params.txt

If Halo is successful reading the file, it will write a file with the same name (Halo_Vs_krasi0_Params.txt) to this folder: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\write\game_ID\ else Halo doesn't write this file at all.

Unfortunately the later is the case, which means the read process wasn't successful.

michalsustr commented 6 years ago

 These files are exactly what I put into that folder.

So it is in the read folder. As the bot, are you reading from bwapi-data/read ? The bot is launched in sc folder, and it should retrieve files with relative path, not absolute.

haopan27 commented 6 years ago

I believe relative path is what I've been using. The following path is fed to Halo: "bwapi-data/read/Halo_Vs_" + enemyName + "_Params.txt"

Using sc-docker, Halo was able to write to this folder: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\write\game_ID , but not able to read from: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read\

That's what's puzzling me. Would it be possible that the different structure of the write and the read folders is what's causing the problem?

michalsustr commented 6 years ago

You said you are using 0.2b7? Did you try on the latest, 0.2b10 ?

Maybe there is some issue with lower case / upper case letters in names? On win they are the same, but not in Linux.

It's hard to tell, I can't replicate your issue and the files are there in the container as you have shown, so my guess is that there is something wrong in the bot's implementation... Maybe try to post it's GAME_XXXXXXXX_Y_game.log and GAME_XXXXXXXX_Y_bot.log files

haopan27 commented 6 years ago

I didn't try 0.2b10 at the time of writing, still using 0.2b7.

Now I have 0.2b10. I've checked the upper/lower case issue but couldn't find anything suspicious. Also tried different opponents but this issue persists. I am only using a Windows machine at the moment (so this shouldn't be a problem based on your comment).

Like I said before, my bot was able to read/write when ChaosLauncher injected it into StarCraft. I am guessing the issue is rather about interaction between my bot and sc-docker, or sc-docker itself (sorry, just my guess).

Here are the .log files:

GAME_2D5EEE83_1_Hao_Pan_bot.log GAME_2D5EEE83_1_Hao_Pan_game.log GAME_2D5EEE83_0_CherryPi_bot.log GAME_2D5EEE83_0_CherryPi_game.log

michalsustr commented 6 years ago

Can you update your bot on SSCAIT to print out to stderr if it did or did not successfully read those files? I can try to test it locally.

haopan27 commented 6 years ago

I am assuming you were talking about something like fprintf(stderr, "%s", "myText") in C++. Yes, I've updated my bot on SSCAIT and appreciate it if you can test it.

I did two uploads to SSCAIT and the time stamp on their 'Bots & Results' page corresponds to the time of the first submission:

Enabled | 2018-02-26 15:41:18

So there might be some mechanism to prevent frequent updates. The time stamp should be about 10 minutes later than this.

Edit: I can see the correct time stamp now.

michalsustr commented 6 years ago

I downloaded the most recent bot version on sscait (updated at 2018-02-26 15:54:42) and it does not print anything in the log file.

haopan27 commented 6 years ago

I've updated my bot again.

Now it prints out a file called readResult.txt to the usual /write folder. Inside the file is the outcome of the reading process: if successful, it shows "Yay, it reads!", if not, it prints "The file to read is not found".

Hopefully this serves as an alternative solution to achieve your purposes.

michalsustr commented 6 years ago

Inside the file is the outcome of the reading process

And it tries to read file Halo_Vs_[BOT_NAME].txt right?

haopan27 commented 6 years ago

No. It does try to read a file, but with a different name than what you wrote: Halo_Vs_[BOT_NAME]_Params.txt

michalsustr commented 6 years ago

I've put it into read folder and it works just fine -

➜  Hao Pan cat write/GAME_EC03CB73_1/readResult.txt
Yay, it reads! :) 
michalsustr commented 6 years ago

It must be some win-related issue. If I get my hands on a win machine, I will try to replicate that, but that's probably not going to be anytime soon.

haopan27 commented 6 years ago

Good to know. I look forward to that day. But don't feel rushed, as in the mean time I will try my luck on my MacBook (less powerful than my win machine that's why I didn't use it first).

haopan27 commented 6 years ago

I've set up my MacBook to do the job. Halo reads fine there.

Another piece of evidence to suggest that this is a win-related issue.

michalsustr commented 6 years ago

Thanks. Maybe @kant2002 could try to replicate this on windows machine please? I suspect it has something to do with mounting drives...

TLDR:

$ scbw.play --bots CherryPi "Hao Pan" --headless --game_name=test

should create file readResult.txt with Yay, it reads! :) in write/GAME_test folder, because it was able to find a file Halo_Vs_CherryPi_Params.txt in the mounted read folder, and otherwise The file to read is not found.

It works in linux/mac, but not in windows.

kant2002 commented 6 years ago

I test on the Windows Pro where Docker for Windows is installed.

I do following

  1. Run scbw.play --bots CherryPi "Hao Pan" --headless --game_name=test
  2. Content of %APPDATA%\scbw\bots\Hao Pan\write\GAME_test_1\readResults.txt is The file to read is not found
  3. Copy file %APPDATA%\scbw\bots\Hao Pan\write\GAME_test_1\readResults.txt to `%APPDATA%\scbw\bots\Hao Pan\read\ folder
  4. Run scbw.play --bots CherryPi "Hao Pan" --headless --game_name=test2
    1. Content of %APPDATA%\scbw\bots\Hao Pan\write\GAME_test2_1\readResults.txt is Yay, it reads! :)

That was machine where folder %APPDATA%\scbw\bots\Hao Pan was not present before I test this issue. I could try test that on the computer Window Home where installed Docker Toolbox if @haopan27 has it installed.

I have couple questions to him:

  1. Could you share output of bot launch with --log_level=DEBUG to see command line for running containers
  2. Please verify scbw.play --version. I have crazy idea that you have both scbw installed in --user and non --user scope.
haopan27 commented 6 years ago

@kant2002 I was surprised when I read your step 5. The file is not supposed to be read, because the name ("readResults.txt") is not the one my bot looks for, and based on your step 2., the file my bot looks for wasn't there.

And to answer your questions: 1. scbw.play --bots CherryPi "Hao Pan" --headless --log_level=DEBUG DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi DEBUG found bot in C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan DEBUG found bot in C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan DEBUG checking docker-machine presence DEBUG Using docker machine version version 0.12.2, build 9371605 Error: No machine name(s) specified and no "default" machine exists DEBUG Docker machine not present DEBUG Using vnc host 'localhost' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_4D2F7641_0_CherryPi' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi/write/GAME_4D2F7641_0:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi:/app/bot:ro' '-e' 'PLAYER_NAME=CherryPi' '-e' 'PLAYER_RACE=Z' '-e' 'NTH_PLAYER=0' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_4D2F7641' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_4D2F7641_0_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_4D2F7641_0_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=BWEnv.dll' '-e' 'BOT_BWAPI=4.2.0' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_4D2F7641' '--name' 'CherryPi' '--race' 'Z' '--lan' '--host' '--map' '/app/sc/maps/sscai/(2)Benzene.scx' INFO launched BotPlayer:CherryPi:Z DEBUG container name 'GAME_4D2F7641_0_CherryPi' DEBUG container id '36348f1b445b' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_4D2F7641_1_Hao_Pan' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan/write/GAME_4D2F7641_1:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan:/app/bot:ro' '-e' 'PLAYER_NAME=Hao Pan' '-e' 'PLAYER_RACE=T' '-e' 'NTH_PLAYER=1' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_4D2F7641' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_4D2F7641_1_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_4D2F7641_1_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=Halo.dll' '-e' 'BOT_BWAPI=4.1.2' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_4D2F7641' '--name' 'Hao Pan' '--race' 'T' '--lan' '--join' INFO launched BotPlayer:Hao Pan:T DEBUG container name 'GAME_4D2F7641_1_Hao_Pan' DEBUG container id 'cd45d27c62c8' DEBUG Checking if game has launched properly... INFO Waiting until game GAME_4D2F7641 is finished... DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Waiting. ['cd45d27c62c8', '36348f1b445b'] DEBUG Removing game containers INFO Game GAME_4D2F7641 finished in 76.14863634109497 seconds. INFO --- INFO Logs are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_0_CherryPi_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_0_CherryPi_game.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_1_Hao_Pan_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_1_Hao_Pan_game.log INFO --- INFO Replays are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_4D2F7641_0.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_4D2F7641_1.rep INFO --- INFO Frame information is saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_0_frames.csv INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_1_frames.csv INFO --- INFO Game results are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_0_results.json INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_4D2F7641_1_results.json INFO --- INFO Winner is BotPlayer:CherryPi:Z (player 0) 0

2. scbw.play --version 0.2b10

kant2002 commented 6 years ago

I apologize for being sloppy, I actually copy Halo_Vs_CherryPi_Params.txt to read folder, and this was only one file in that folder.

Here the example script which is actually do the testing for me.

Remove-Item $env:APPDATA\scbw/logs\GAME_test_*
Remove-Item $env:APPDATA\scbw/maps/replays\GAME_test_*
Remove-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_*" -Recurse
Remove-Item "$env:APPDATA\scbw/bots\Hao Pan\read\*"

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test

echo "======================="
Get-Content "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_0\readResult.txt"
echo "======================="

Copy-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_0\Halo_Vs_CherryPi*" "$env:APPDATA\scbw/bots\Hao Pan\read\"

Remove-Item $env:APPDATA\scbw/logs\GAME_test_*
Remove-Item $env:APPDATA\scbw/maps/replays\GAME_test_*
Remove-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_*" -Recurse

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test

echo "======================="
Get-Content "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_0\readResult.txt"
echo "======================="

NExt set of questions:

  1. Did you try build local Docker images earlier on your PC ?
  2. Could you open two terminal sessions and in first one run scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG to get name of the Halo container, and in second terminal run docker exec -t -t XXX ls /app/bot/read -l, where XXX is actual Container ID of the bot.

Just for reference I have something like that

# docker exec -t -t b702460664e8  ls /app/bot/read -l
total 1
-rwxr-xr-x 1 root root 400 Feb 27 03:13 Halo_Vs_CherryPi.txt
-rwxr-xr-x 1 root root 136 Feb 27 03:13 Halo_Vs_CherryPi_Params.txt
haopan27 commented 6 years ago

Not a problem. Appreciate your trying to help here.

Now to answer your questions: 1) I don't know. All I did was to follow the installation instructions for Windows on this Git hub page. How do I check if I have any local Docker image?

2) Things get a little crazy here. The game crashed immediately after I typed docker exec -t -t XXX ls /app/bot/read -l, while the game was running (the games never crash when I use scbw.play --bots "Hao Pan" CherryPi --headless --log_level=DEBUG). The following are some logs:

PowerShell 1: running the game. scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan DEBUG found bot in C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi DEBUG found bot in C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi DEBUG checking docker-machine presence DEBUG Using docker machine version version 0.12.2, build 9371605 Error: No machine name(s) specified and no "default" machine exists DEBUG Docker machine not present DEBUG Using vnc host 'localhost' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_test_0_Hao_Pan' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan/write/GAME_test_0:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan:/app/bot:ro' '-e' 'PLAYER_NAME=Hao Pan' '-e' 'PLAYER_RACE=T' '-e' 'NTH_PLAYER=0' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_test' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_test_0_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_test_0_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=Halo.dll' '-e' 'BOT_BWAPI=4.1.2' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_test' '--name' 'Hao Pan' '--race' 'T' '--lan' '--host' '--map' '/app/sc/maps/sscai/(2)Benzene.scx' INFO launched BotPlayer:Hao Pan:T DEBUG container name 'GAME_test_0_Hao_Pan' DEBUG container id '06484ecb749d' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_test_1_CherryPi' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi/write/GAME_test_1:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi:/app/bot:ro' '-e' 'PLAYER_NAME=CherryPi' '-e' 'PLAYER_RACE=Z' '-e' 'NTH_PLAYER=1' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_test' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_test_1_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_test_1_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=BWEnv.dll' '-e' 'BOT_BWAPI=4.2.0' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_test' '--name' 'CherryPi' '--race' 'Z' '--lan' '--join' INFO launched BotPlayer:CherryPi:Z DEBUG container name 'GAME_test_1_CherryPi' DEBUG container id '3df17ef70255' DEBUG Checking if game has launched properly... INFO Waiting until game GAME_test is finished... DEBUG Waiting. ['3df17ef70255', '06484ecb749d'] DEBUG Waiting. ['3df17ef70255', '06484ecb749d'] DEBUG Waiting. ['3df17ef70255', '06484ecb749d'] DEBUG Waiting. ['3df17ef70255', '06484ecb749d'] DEBUG Waiting. ['3df17ef70255', '06484ecb749d'] DEBUG Removing game containers INFO Game GAME_test finished in 18.22366428375244 seconds. INFO --- INFO Logs are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_Hao_Pan_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_Hao_Pan_game.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_CherryPi_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_CherryPi_game.log INFO --- INFO Replays are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_test_0.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_test_1.rep INFO --- INFO Frame information is saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_frames.csv INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_frames.csv INFO --- INFO Game results are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_results.json INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_results.json INFO --- WARNING Some of the players crashed in game 'GAME_test' ERROR Game has crashed!

PowerShell 2: checking contents. PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 06484ecb749d ls /app/bot/read -l Error response from daemon: Container 06484ecb749d353de4c9580d67a6419da241fc21a7ce88d2b92c9a5413b7e5f2 is not running

kant2002 commented 6 years ago

If you don't know about your local Docker images, and don't build anything yourself, then we are safe here. Since we are here some more questions

  1. Do you run under account which is admin on the PC
  2. Could you try docker exec -t -t 06484ecb749d ls /app/bot/ -l on the Halo container and also try reading content of read folder on the CherriPi bot container. That just to confirm that crash only on your bot somehow.
  3. Next is try to run scbw.play --bots "Hao Pan" CherryPi --game_name=test --log_level=DEBUG and don't join the game. That should give you time to evaluate container more properly. We could actually check what's inside both containers.
  4. Also try remove folder for Hao Pan bot, so scbw will redownload it from the server. Did you try that already?
  5. What language of your Windows installation ?
  6. Open Docker for Windows and go to the Diagnostics and Feedback, there should be link which open log file. Look for something suspicious, or just send that file there. Image with screen below. image
haopan27 commented 6 years ago
  1. Yes. The picture says it.

    fractal info
  2. I am assuming you meant to have me start a new game and check, because the old ID didn't work: Old ID: docker exec -t -t 06484ecb749d ls /app/bot -l Error: No such container: 06484ecb749d

New ID: Now using this command:

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG

CherryPi container: docker exec -t -t 92cd37b08cd0 ls /app/bot/ -l oci runtime error: exec failed: container_linux.go:265: starting container process caused "process_linux.go:84: executing setns process caused \"exit status 15\""

Hao Pan container: (the previous game crashed before I can check the content, had to start a new one) docker exec -t -t 84dc433c863d ls /app/bot/ -l Error response from daemon: Container 84dc433c863d9d3014d2dc31e0f8f19ca1aaa0ce439960d276c878d133470b83 is not running

Summary In both cases the game crashed. In fact, the game would crash without me typing docker exec -t -t containerID ls /app/bot/ -l

  1. This is strange. I didn't join the game/let it start, but it would crash faster (it seems) than the previous case, meaning I didn't even have time to finish typing docker exec -t -t containerID ls /app/bot/ -l

  2. No, I didn't try that yet before your comment. I did try it this time: scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG

Hao Pan container: docker exec -t -t 176e274b278e ls /app/bot/ -l total 600 drwxr-xr-x 2 root root 0 Feb 27 15:42 AI -rwxr-xr-x 1 root root 606720 Feb 27 15:42 BWAPI.dll -rwxr-xr-x 1 root root 786 Feb 27 15:42 bot.json drwxr-xr-x 2 root root 0 Feb 27 15:42 read drwxr-xr-x 2 root root 0 Feb 27 15:43 write

Unfortunately the game crashed before I could check contents in the CherryPi container. So I deleted both CherryPi and Hao Pan bot folders, and checked again: CherryPi container: docker exec -t -t 887600e18685 ls /app/bot/ -l total 568 drwxr-xr-x 2 root root 0 Feb 27 15:50 AI -rwxr-xr-x 1 root root 577536 Feb 27 15:50 BWAPI.dll -rwxr-xr-x 1 root root 1494 Feb 27 15:50 bot.json drwxr-xr-x 2 root root 0 Feb 27 15:50 read drwxr-xr-x 2 root root 0 Feb 27 15:50 write

Here is the log: scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /api/bots.php HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /api/bots.php HTTP/1.1" 200 None DEBUG {'name': 'Hao Pan', 'portrait': 'https://sscaitournament.com/images/portraits/t1.gif', 'race': 'Terran', 'wins': '46', 'losses': '168', 'draws': '0', 'score': 138, 'avgScore': 0.64, 'winRate': 0, 'achievements': ['https://sscaitournament.com/images/achievements/experienced.png', 'https://sscaitournament.com/images/achievements/equalOpportunity.png'], 'achievementsNum': 2, 'division': 'Mixed', 'status': 'Enabled', 'description': 'Halo is based on Iron.\r\nHalo is trying to learn.', 'update': '2018-02-26 17:19:53', 'botBinary': 'https://sscaitournament.com/bot_binary.php?bot=Hao+Pan', 'bwapiDLL': 'https://sscaitournament.com/bot_binary.php?bot=Hao+Pan&bwapi_dll=true', 'botType': 'AI_MODULE', 'botProfileURL': 'https://sscaitournament.com/index.php?action=botDetails&bot=Hao+Pan'} DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /bot_binary.php?bot=Hao+Pan HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /bot_binary.php?bot=Hao+Pan HTTP/1.1" 200 620331 DEBUG downloading from http://sscaitournament.com/bot_binary.php?bot=Hao+Pan save as C:\Users\fractal\AppData\Local\Temp\tmphmq17fja 1.00MB [00:00, 1.50MB/s] DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /bot_binary.php?bot=Hao+Pan&bwapi_dll=true HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /bot_binary.php?bot=Hao+Pan&bwapi_dll=true HTTP/1.1" 200 606720 DEBUG downloading from http://sscaitournament.com/bot_binary.php?bot=Hao+Pan&bwapi_dll=true save as C:\Users\fractal\AppData\Roaming/scbw/bots/Hao Pan/BWAPI.dll 1.00MB [00:01, 1.11s/MB] INFO Successfully downloaded Hao Pan from SSCAIT server DEBUG checking bot in C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /api/bots.php HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /api/bots.php HTTP/1.1" 200 None DEBUG {'name': 'CherryPi', 'portrait': 'https://sscaitournament.com/images/portraits/z5.gif', 'race': 'Zerg', 'wins': '407', 'losses': '249', 'draws': '0', 'score': 1221, 'avgScore': 1.86, 'winRate': 0, 'achievements': ['https://sscaitournament.com/images/achievements/winningStreak10.png', 'https://sscaitournament.com/images/achievements/vsTerran50.png', 'https://sscaitournament.com/images/achievements/cheese.png', 'https://sscaitournament.com/images/achievements/vsZerg50.png', 'https://sscaitournament.com/images/achievements/vsProtoss50.png', 'https://sscaitournament.com/images/achievements/pieceOfCake.png', 'https://sscaitournament.com/images/achievements/godlike.png', 'https://sscaitournament.com/images/achievements/veteran.png', 'https://sscaitournament.com/images/achievements/winningStreak5.png', 'https://sscaitournament.com/images/achievements/experienced.png', 'https://sscaitournament.com/images/achievements/winningStreak3.png', 'https://sscaitournament.com/images/achievements/equalOpportunity.png'], 'achievementsNum': 12, 'division': 'Mixed', 'status': 'Enabled', 'description': '🍒π!

Built with TorchCraft: https://github.com/TorchCraft/TorchCraft', 'update': '2017-12-20 22:49:25', 'botBinary': 'https://sscaitournament.com/bot_binary.php?bot=CherryPi', 'bwapiDLL': 'https://sscaitournament.com/bot_binary.php?bot=CherryPi&bwapi_dll=true', 'botType': 'AI_MODULE', 'botProfileURL': 'https://sscaitournament.com/index.php?action=botDetails&bot=CherryPi'} DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /bot_binary.php?bot=CherryPi HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /bot_binary.php?bot=CherryPi HTTP/1.1" 200 1405190 DEBUG downloading from http://sscaitournament.com/bot_binary.php?bot=CherryPi save as C:\Users\fractal\AppData\Local\Temp\tmp77145aku 2.00MB [00:00, 2.77MB/s] DEBUG Starting new HTTP connection (1): sscaitournament.com DEBUG http://sscaitournament.com:80 "GET /bot_binary.php?bot=CherryPi&bwapi_dll=true HTTP/1.1" 301 None DEBUG Starting new HTTPS connection (1): sscaitournament.com DEBUG https://sscaitournament.com:443 "GET /bot_binary.php?bot=CherryPi&bwapi_dll=true HTTP/1.1" 200 577536 DEBUG downloading from http://sscaitournament.com/bot_binary.php?bot=CherryPi&bwapi_dll=true save as C:\Users\fractal\AppData\Roaming/scbw/bots/CherryPi/BWAPI.dll 1.00MB [00:00, 1.75MB/s] INFO Successfully downloaded CherryPi from SSCAIT server DEBUG checking docker-machine presence DEBUG Using docker machine version version 0.12.2, build 9371605 Error: No machine name(s) specified and no "default" machine exists DEBUG Docker machine not present DEBUG Using vnc host 'localhost' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_test_0_Hao_Pan' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan/write/GAME_test_0:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/Hao Pan:/app/bot:ro' '-e' 'PLAYER_NAME=Hao Pan' '-e' 'PLAYER_RACE=T' '-e' 'NTH_PLAYER=0' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_test' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_test_0_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_test_0_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=Halo.dll' '-e' 'BOT_BWAPI=4.1.2' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_test' '--name' 'Hao Pan' '--race' 'T' '--lan' '--host' '--map' '/app/sc/maps/sscai/(2)Benzene.scx' INFO launched BotPlayer:Hao Pan:T DEBUG container name 'GAME_test_0_Hao_Pan' DEBUG container id '2acdbbe84d06' DEBUG 'docker' 'run' '-d' '--privileged' '--name' 'GAME_test_1_CherryPi' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/logs:/app/logs:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/maps:/app/sc/maps:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA:/app/sc/bwapi-data/BWTA:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bwapi-data/BWTA2:/app/sc/bwapi-data/BWTA2:rw' '--net' 'sc_net' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi/write/GAME_test_1:/app/sc/bwapi-data/write:rw' '--volume' '//c/Users/fractal/AppData/Roaming/scbw/bots/CherryPi:/app/bot:ro' '-e' 'PLAYER_NAME=CherryPi' '-e' 'PLAYER_RACE=Z' '-e' 'NTH_PLAYER=1' '-e' 'NUM_PLAYERS=2' '-e' 'GAME_NAME=GAME_test' '-e' 'MAP_NAME=/app/sc/maps/sscai/(2)Benzene.scx' '-e' 'GAME_TYPE=FREE_FOR_ALL' '-e' 'SPEED_OVERRIDE=0' '-e' 'HIDE_NAMES=0' '-e' 'TM_LOG_RESULTS=../logs/GAME_test_1_results.json' '-e' 'TM_LOG_FRAMETIMES=../logs/GAME_test_1_frames.csv' '-e' 'TM_SPEED_OVERRIDE=0' '-e' 'TM_ALLOW_USER_INPUT=0' '-e' 'EXIT_CODE_REALTIME_OUTED=2' '-e' 'JAVA_DEBUG=0' '-e' 'BOT_FILE=BWEnv.dll' '-e' 'BOT_BWAPI=4.2.0' 'starcraft:game' '/app/play_bot.sh' '--game' 'GAME_test' '--name' 'CherryPi' '--race' 'Z' '--lan' '--join' INFO launched BotPlayer:CherryPi:Z DEBUG container name 'GAME_test_1_CherryPi' DEBUG container id '887600e18685' DEBUG Checking if game has launched properly... INFO Waiting until game GAME_test is finished... DEBUG Waiting. ['887600e18685', '2acdbbe84d06'] DEBUG Waiting. ['887600e18685', '2acdbbe84d06'] DEBUG Waiting. ['887600e18685', '2acdbbe84d06'] DEBUG Waiting. ['887600e18685', '2acdbbe84d06'] DEBUG Waiting. ['887600e18685', '2acdbbe84d06'] DEBUG Removing game containers INFO Game GAME_test finished in 18.162338733673096 seconds. INFO --- INFO Logs are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_Hao_Pan_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_Hao_Pan_game.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_CherryPi_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_CherryPi_game.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_krasi0_bot.log INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_krasi0_game.log INFO --- INFO Replays are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_test_0.rep INFO C:\Users\fractal\AppData\Roaming/scbw/maps/replays\GAME_test_1.rep INFO --- INFO Frame information is saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_frames.csv INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_frames.csv INFO --- INFO Game results are saved here: INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_0_results.json INFO C:\Users\fractal\AppData\Roaming/scbw/logs\GAME_test_1_results.json INFO --- WARNING Some of the players crashed in game 'GAME_test' ERROR Game has crashed!

Reading the log, I was wondering if this piece of information had something to do with this issue? Error: No machine name(s) specified and no "default" machine exists DEBUG Docker machine not present

  1. English (United States)

kant2002 commented 6 years ago

So right now looks like issue not on the scbw side, but some where in the docker side, and all my commands optimized for docker debugging. --log_level=DEBUG is just so you could get container ID from that, and paste it in the terminal faster (other information from --log_level=DEBUG) is not interested for me right now.

  1. Would be interested did you able to check other folders in the container which is mapped by SCBW, for example: /app/log
  2. What's output of docker logs XXX it is looks like it is exiting before even started.
  3. Make sure that all files related to game name test would be deleted for both bots. This is because scbw check for these files and use them as indicators for exiting container, so you have to either remove them, or give unique id. Command below should cleanup everything related to game name = 'test'
    Remove-Item $env:APPDATA\scbw/logs\GAME_test_*
    Remove-Item $env:APPDATA\scbw/maps/replays\GAME_test_*
    Remove-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_*" -Recurse
    Remove-Item "$env:APPDATA\scbw/bots\CherryPi\write\GAME_test_*" -Recurse

    After you cleanup files, you could rerun game again and try to list folders in containers. Make sure that you cleanup result files after you run game again.

haopan27 commented 6 years ago
  1. & 2. First I did what's recommended in your 3. to clean things up, and ran a game. Surprisingly this time the game didn't crash and finished. The following are some logs (warning, long logs):

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG

Hao Pan container: PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 7ca72503e265 ls /app/log/ -l ls: cannot access '/app/log/': No such file or directory

CherryPi container: PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t fc0622bfbe01 ls /app/log/ -l ls: cannot access '/app/log/': No such file or directory

PS C:\Program Files\PowerShell\6.0.1> docker logs 7ca72503e265

[auto_menu] auto_menu = LAN pause_dbg = OFF lan_mode = Local Area Network (UDP) auto_restart = OFF map = maps/sscai/(2)Benzene.scx game = GAME_test mapiteration = RANDOM race = Terran enemy_count = 1 enemy_race = Protoss enemy_race_1 = Default enemy_race_2 = Default enemy_race_3 = Default enemy_race_4 = Default enemy_race_5 = Default enemy_race_6 = Default enemy_race_7 = Default game_type = FREE_FOR_ALL game_type_extra = save_replay = maps/replays/GAME_test_0.rep wait_for_min_players = 2 wait_for_max_players = 8 wait_for_time = 60000

[config] holiday = OFF shared_memory = OFF console_attach_on_startup = FALSE console_alloc_on_startup = FALSE console_attach_auto = TRUE console_alloc_auto = TRUE

[window] windowed = OFF left = 0 top = 0 width = 640 height = 480

[starcraft] sound = OFF screenshots = gif speed_override = 0 drop_players = ON hook: before bot start hook: after bot start /app/sc /app /app

PS C:\Program Files\PowerShell\6.0.1> docker logs fc0622bfbe01

[auto_menu] auto_menu = LAN pause_dbg = OFF lan_mode = Local Area Network (UDP) auto_restart = OFF map = game = GAME_test mapiteration = RANDOM race = Zerg enemy_count = 1 enemy_race = Protoss enemy_race_1 = Default enemy_race_2 = Default enemy_race_3 = Default enemy_race_4 = Default enemy_race_5 = Default enemy_race_6 = Default enemy_race_7 = Default game_type = FREE_FOR_ALL game_type_extra = save_replay = maps/replays/GAME_test_1.rep wait_for_min_players = 2 wait_for_max_players = 8 wait_for_time = 60000

[config] holiday = OFF shared_memory = OFF console_attach_on_startup = FALSE console_alloc_on_startup = FALSE console_attach_auto = TRUE console_alloc_auto = TRUE

[window] windowed = OFF left = 0 top = 0 width = 640 height = 480

[starcraft] sound = OFF screenshots = gif speed_override = 0 drop_players = ON ++ echo 'hook: update bwapi ini'

kant2002 commented 6 years ago

Looks like we back to normal running, so let's cleanup the run files and re-run game again. Could you collected output from Halo container of following commands

docker exec -t -t XXX ls -l /app/logs/
docker exec -t -t XXX ls -l /app/sc/bwapi-data/read/
docker exec -t -t XXX ls -l /app/bot/read/

and from your powershell

ls "$env:APPDATA\scbw/bots\Hao Pan\read\"
haopan27 commented 6 years ago

Yes, the games can be run properly now.

I cleaned up again and used the commands you supplied: docker exec -t -t 36a99700e294 ls -l /app/logs/ total 3 -rwxr-xr-x 1 root root 117 Feb 27 18:39 GAME_test_0_Hao_Pan_bot.log -rwxr-xr-x 1 root root 1407 Feb 27 18:40 GAME_test_0_Hao_Pan_game.log -rwxr-xr-x 1 root root 5767 Feb 27 18:39 GAME_test_0_frames.csv -rwxr-xr-x 1 root root 144 Feb 27 18:39 GAME_test_0_results.json -rwxr-xr-x 1 root root 118 Feb 27 18:39 GAME_test_1_CherryPi_bot.log -rwxr-xr-x 1 root root 3995 Feb 27 18:40 GAME_test_1_CherryPi_game.log -rwxr-xr-x 1 root root 5744 Feb 27 18:39 GAME_test_1_frames.csv -rwxr-xr-x 1 root root 145 Feb 27 18:39 GAME_test_1_results.json

PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 36a99700e294 ls -l /app/sc/bwapi-data/read/ total 0

PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 36a99700e294 ls -l /app/bot/read/ total 0

PS C:\Program Files\PowerShell\6.0.1> ls "$env:APPDATA\scbw/bots\Hao Pan\read\" (nothing showed up)

kant2002 commented 6 years ago

So could you run

Copy-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_0\Halo_Vs_CherryPi*" "$env:APPDATA\scbw/bots\Hao Pan\read\"
Remove-Item $env:APPDATA\scbw/logs\GAME_test_*
Remove-Item $env:APPDATA\scbw/maps/replays\GAME_test_*
Remove-Item "$env:APPDATA\scbw/bots\Hao Pan\write\GAME_test_*" -Recurse

scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test

And try again look at

docker exec -t -t XXX ls -l /app/logs/
docker exec -t -t XXX ls -l /app/sc/bwapi-data/read/
docker exec -t -t XXX ls -l /app/bot/read/

and run ls "$env:APPDATA\scbw/bots\Hao Pan\read\"

haopan27 commented 6 years ago

This was probably not done correctly: I followed your instructions, but once I ran scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test I realized that the container ID wouldn't show up, so I didn't proceed with the remaining commands.

Then I re-ran every previous command, with this scbw.play --bots "Hao Pan" CherryPi --headless --game_name=test --log_level=DEBUG

Here is the result: PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 42f7cbff500f ls -l /app/logs/ total 2 -rwxr-xr-x 1 root root 117 Feb 27 19:11 GAME_test_0_Hao_Pan_bot.log -rwxr-xr-x 1 root root 915 Feb 27 19:11 GAME_test_0_Hao_Pan_game.log -rwxr-xr-x 1 root root 118 Feb 27 19:11 GAME_test_1_CherryPi_bot.log -rwxr-xr-x 1 root root 919 Feb 27 19:11 GAME_test_1_CherryPi_game.log

PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 42f7cbff500f ls -l /app/sc/bwapi-data/read/ total 8 -rwxr-xr-x 1 starcraft users 399 Feb 27 19:11 Halo_Vs_CherryPi.txt -rwxr-xr-x 1 starcraft users 133 Feb 27 19:11 Halo_Vs_CherryPi_Params.txt

PS C:\Program Files\PowerShell\6.0.1> docker exec -t -t 42f7cbff500f ls -l /app/bot/read/ total 1 -rwxr-xr-x 1 root root 399 Feb 27 19:07 Halo_Vs_CherryPi.txt -rwxr-xr-x 1 root root 133 Feb 27 19:07 Halo_Vs_CherryPi_Params.txt

PS C:\Program Files\PowerShell\6.0.1> ls "$env:APPDATA\scbw/bots\Hao Pan\read\"

Directory: C:\Users\fractal\AppData\Roaming\scbw\bots\Hao Pan\read

Mode LastWriteTime Length Name


-a---- 2/27/2018 2:07 PM 399 Halo_Vs_CherryPi.txt -a---- 2/27/2018 2:07 PM 133 Halo_Vs_CherryPi_Params.txt

Good news: Halo is reading now! But I still don't understand what's causing the issue here.

kant2002 commented 6 years ago

I think we remove files from previous runs, and after that it start running correctly. since we was heavy on debugging we made mistakes. Be careful with --game_name=XXX

haopan27 commented 6 years ago

I saw you referenced this in another issue (#52). I have a couple of questions here:

  1. What are the things to watch out for when writing this --game_name=XXX? I guess do not use the same game_name? Anything else?

  2. how do I start each game now? Based on our discussion here, it seems that I have to copy a specific file first (which I don't understand, as Halo doesn't read this file at all, it reads another), and clean up, and run?

kant2002 commented 6 years ago
  1. If you will give unique name and you will be fine, but possible that you forget again, and will troubleshoot it. So better either avoid --game_name=XXX or put that in the script which will cleanup files for you. That's my recommendation, but @michalsustr may have different one.
  2. Looks like you should pass --read_overwrite which in my understanding will automatically copy files from write folder, to read folder after game completed.

So if you want to run 2 games consequentially,

scbw.play --bots "Hao Pan" CherryPi --headless --read_overwrite
scbw.play --bots "Hao Pan" CherryPi --headless --read_overwrite

that way files Halo_Vs_CherryPi* will be written to read folder automatically and you will see files in the second game. This is also match behavior of the SSCAIT on my understanding.

The idea why --read_overwrite is not default, is to support reproducibility out of the box. SSCAIT behavior is probably good for testing, but not give 100% confidence that everything is working correctly.

michalsustr commented 6 years ago

Thanks @kant2002 for the help! I guess we can close this now.