TorchCraft / TorchCraftAI

A platform that lets you build agents to learn to play StarCraft: Brood War.

Home Page:https://torchcraft.github.io/TorchCraftAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i get the external play script(/workspace/scripts/ladder/play)?

shuaienen opened this issue · comments

I'm trying to run the bo-switch tarin script and find it uses GameVsBotInWine class to make scenarios.
I think GameVsBotInWine implements a SC game with another AI bot set by “vars”. This class uses PlayScript to lanuch the game .
But PlayScript uses a string called script=/workspace/scripts/ladder/play. I cant find the script in application. Where can i get it?

I'm glad you're looking to run BO Switch! The play script is a tool we use internally, but I'm afraid we can't distribute it as-is.

The best alternative that comes to mind is using https://github.com/basil-ladder/sc-docker -- it works very well, but you'll need to do a bit of setup to use TorchCraftAI through it.

  1. Follow the SC-Docker setup steps and launch a game between two bots to test it
  2. Get the latest TorchCraft binaries -- BWEnv.dll -- from https://torchcraft.github.io/TorchCraftAI/docs/play-games.html#all-platforms-sc-docker.
  3. Run a game on SC-Docker using the bot CherryPiSSCAIT2017
  4. In the directory containing SC-Docker bots, make a copy of CherryPiSSCAIT2017. Rename it as you like. You'll use this directory as the template for your TorchCraftAI bot
  5. Replace the contents of TorchCraftAI/bwapi-data/AI with the TorchCraft server you compiled: BWEnv.dll
  6. Modify TorchCraftAI/bot.json. Use these fields to configure TorchCraftAI to connect to your agent over IP
  7. Replace the play script with one which starts the bot, then runs SC-Docker's scbw.play

As a fair warning: BO Switch takes many episodes to train -- 100,000+. I recommend using a small pool of strategies to help it converge faster.

Actually, there is a copy of the required BWEnv.dll! See https://torchcraft.github.io/TorchCraftAI/docs/play-games.html#all-platforms-sc-docker -- I've edited it into the above steps.

I will test it according to your suggestion, thanks a lot!

I am sorry to bother you again.

I have installed sc-docker and can run it with the scbw.play instruction. Take ‘ scbw.play --bots "PurpleWave" "TorchCraft" --headless --map "sscai/(4)Empire of the Sun.scm"’ as an example. In the headful mode, the speed of the game is very fast at the beginning. With the increase of units, FPS will become slower and slower, but the operation of AI is very normal. But in headless mode, I open the replay to observe, and find that AI operates normally at the beginning, but after about 15 minutes of the game time, AI performs unnormally, such as unit does not move, unit does not build, and so on. In the end, AI often exits the game (disconnection) without winning or losing.

I guess this may be caused by AI's inability to keep up with the speed of the game,I adjusted the game_speed parameter and it still doesn't work. However, it behaves normally in headful mode.My sc-docker version is 1.0.4. Have you ever encountered such a problem, and how did you solve it?

I'm looking forward to your reply, thank you.

Can you post the replay (.rep) file from the game?

Ok,here is the game result file (include replays) of one game played between cherryPI and puperwave in headless mode.
https://github.com/shuaienen/sc-docker-unnormal-game/tree/master

Thanks. Just watched the replay.

I suspect you're encountering a bug in StarCraft which tends to affect bot replays. I'll explain it below but there are two ways around this:

  1. Watch the replay via http://www.openbw.com/replay-viewer/ (it's a great tool; I use it every day; I haven't actually watched a replay in StarCraft in years)
  2. Use BWRepFix to make the replay watchable in StarCraft (I'm not familiar with how this works)

Background on the replay bug: When a replay contains too many commands (I think there's a per-frame limit) StarCraft fails to replay all of them, causing the game go out of sync. Out-of-sync replays are typified by units behaving erratically and new units not moving at all. OpenBW handles these replays correctly and BWRepFix does something to address that issue as well.

Because bots tend to issue commands to many units every frame, they tend to easily produce replays which surface this bug.

Ah, that's the problem. Thank you very much.