|
Hello everyone,
With a lot of people now contacting me about SC2 bots, I've made a simple tutorial on how to run custom SC2 bots created with the API Blizzard released.
The thing about these bots is that unlike the BWAPI, which simply takes over an instance of StarCraft, the SC2 API is based on a protocol.
So if you want to play vs a bot, the bot will have to specify that it want to play vs a human player. So these steps only work for bots that are configured that way.
I turned the Example bot (named Command Center) into a bot you can play against on my github so you can try out the process.
The steps needed are mentioned on the github.
https://github.com/MartinRooijackers/LetaBotSC2
After following these steps, two instances of SC2 should appear. Once loaded, you play as Terran and the bot plays random.
You can post any problems you encountered in the installation process in this thread.
If you want to be one of the people that will get early access to the latest version of my bot, you can apply to the DSCL (which I am in contact with) here:
https://starcraft.dutchrank.nl/ai-testers-wanted/
p.s
LetaBotSC2 itself isn't on github yet. As mentioned, the bin.rar contains the example bot "Command Center" ( https://github.com/davechurchill/CommandCenter ) converted to allow human vs bot play.
|
I love Ai s!
I was such a big fan of the AMAI ai of Warcraft 3. Was funny seeing people lose to it.
|
New version is on the github. Should fix the extreme fast game speed.
|
I un-rar'd the file from your github. I installed the 2017 distributable. I unzipped the Maps files into my c:/Starcraft II/Maps folder.
Terminal window popped up, saying: Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 10864 Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 4568 Waiting for connection......... Connected to 127.0.0.1:8167 Assertion failed: pi.process_id && IsProcessRunning(pi.process_id), file D:\projects\s2client-api\src\sc2api\sc2_coordinator.cc, line 105
Blizzard error window popped up: "Core: access permission error" I submitted the error log to Blizzard w/ Report ID: 3E247AD2-8E8B-4E4A-8C12-FB68F22042A0
Then I wasn't sure if I had the maps in the correct folder. (For some reason I have two StarCraft II folders on my machine.)
I've made copies of the files in both locations now (C:\Starcraft II\Maps and D:\Starcraft II\Maps), but I still get an error when running the .exe:
Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 10072 Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 8136 Waiting for connection.. Connected to 127.0.0.1:8167
Connected to 127.0.0.1:8168 CreateGame request returned an error code: Invalid Map Path CreateGame request returned error details: map_path file doesn't exist. Assertion failed: is_game_created, file D:\projects\s2client-api\src\sc2api\sc2_coordinator.cc, line 511
---- Edit: What seems weird to me is that the folder structure looks like this:
D:\Starcraft II\Maps\Ladder2017Season1\Ladder2017Season1\AbyssalReefLE.SC2Map D:\Starcraft II\Maps\Ladder2017Season1\Ladder2017Season1\AcolyteLE.SC2Map etc
That extra layer of empty folders seems weird, so I copied all of the the files into the "empty" layer, too, in case that helps. It doesn't.
|
On October 07 2017 13:58 UncleVinny wrote: I un-rar'd the file from your github. I installed the 2017 distributable. I unzipped the Maps files into my c:/Starcraft II/Maps folder.
Terminal window popped up, saying: Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 10864 Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 4568 Waiting for connection......... Connected to 127.0.0.1:8167 Assertion failed: pi.process_id && IsProcessRunning(pi.process_id), file D:\projects\s2client-api\src\sc2api\sc2_coordinator.cc, line 105
Blizzard error window popped up: "Core: access permission error" I submitted the error log to Blizzard w/ Report ID: 3E247AD2-8E8B-4E4A-8C12-FB68F22042A0
Then I wasn't sure if I had the maps in the correct folder. (For some reason I have two StarCraft II folders on my machine.)
I've made copies of the files in both locations now (C:\Starcraft II\Maps and D:\Starcraft II\Maps), but I still get an error when running the .exe:
Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 10072 Launched SC2 (C:\StarCraft II\Versions\Base56787\SC2_x64.exe), PID: 8136 Waiting for connection.. Connected to 127.0.0.1:8167
Connected to 127.0.0.1:8168 CreateGame request returned an error code: Invalid Map Path CreateGame request returned error details: map_path file doesn't exist. Assertion failed: is_game_created, file D:\projects\s2client-api\src\sc2api\sc2_coordinator.cc, line 511
---- Edit: What seems weird to me is that the folder structure looks like this:
D:\Starcraft II\Maps\Ladder2017Season1\Ladder2017Season1\AbyssalReefLE.SC2Map D:\Starcraft II\Maps\Ladder2017Season1\Ladder2017Season1\AcolyteLE.SC2Map etc
That extra layer of empty folders seems weird, so I copied all of the the files into the "empty" layer, too, in case that helps. It doesn't.
Make sure that the .SC2Map maps are located in the root folder "Maps", so not inside another folder.
For example, my InterloperLE is located like this:
"C:\Starcraft2\StarCraft II\Maps\InterloperLE.SC2Map"
|
Oh, got it. OK, I was able to finish a game vs the AI, but did get one crash towards the end. As I was moving in to attack, the CommandCenter terminal window died.
Blizzard error window popped up: "An unexpected fatal error occurred". Blizzard Report ID: 324CA73E-8BE7-4EEC-A979-3FA89801B3B1
The AI kept running, though, and I was able to finish the game. Where should I look to find the replay?
---- Edit: Is there an easy way to load my hotkey and user profile?
|
On October 08 2017 04:14 UncleVinny wrote: Oh, got it. OK, I was able to finish a game vs the AI, but did get one crash towards the end. As I was moving in to attack, the CommandCenter terminal window died.
Blizzard error window popped up: "An unexpected fatal error occurred". Blizzard Report ID: 324CA73E-8BE7-4EEC-A979-3FA89801B3B1
The AI kept running, though, and I was able to finish the game. Where should I look to find the replay?
---- Edit: Is there an easy way to load my hotkey and user profile?
crash at the end is a known problem.
Not sure where the replay is saved. Should be the default location since I didn't change it in the bot.
Can you load in those settings in the menu from the "Human" player. Otherwise you will have to set the settings manually. It should save those. It saved my sound settings once I set those up when playing vs the bot.
|
For those interested in making sure their SC2 bot can play vs human players, the source code of the test bot is now up. Look at the main.cpp to see how to do it.
|
Thanks a lot for the Command Center bot. It helps tremendously with my first baby steps into the sc2api.
One small question though: is there a way to get the vision range of a unit? I found radar range and detection range. Well, and weapons range. I want a unit to run away once it sees an enemy unit.
|
Maybe a video tutorial will be the best way to introduce how to play against your bot..thx
|
Apparently dont work anymore because the new version of starcraft ;(
|
The precompiled libs are probably out of date. You can build them yourself by following the instructions here. Remember to build debug and release. Afterwards, run synchproject.bat. It creates a project folder. In there you have the updated libs equivalent to the precompiled libs.
If you have more problems, you might want to join this discord channel.
Regarding my question above: vision range is now available.
|
|
|
|