• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:12
CEST 05:12
KST 12:12
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting3[ASL20] Ro4 Preview: Descent6Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)67Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
TL.net Map Contest #21: Voting Weekly Cups (Oct 6-12): Four star herO PartinG joins SteamerZone, returns to SC2 competition 5.0.15 Patch Balance Hotfix (2025-10-8) IP For new Brazil servers for NA Players
Tourneys
WardiTV Mondays SC2's Safe House 2 - October 18 & 19 Sparkling Tuna Cup - Weekly Open Tournament RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
BSL Season 21 BGH Auto Balance -> http://bghmmr.eu/ Any rep analyzer that shows resources situation? BW General Discussion [ASL20] Ro4 Preview: Descent
Tourneys
[ASL20] Semifinal B [ASL20] Semifinal A [Megathread] Daily Proleagues [ASL20] Ro8 Day 4
Strategy
Current Meta BW - ajfirecracker Strategy & Training Siegecraft - a new perspective TvZ Theorycraft - Improving on State of the Art
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Sex and weight loss US Politics Mega-thread The Games Industry And ATVI
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2368 users

Running custom SC2 bots

Forum Index > SC2 General
Post a Reply
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
October 04 2017 00:06 GMT
#1
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.

If you cannot win with 100 apm, win with 100 cpm.
Psychobabas
Profile Blog Joined March 2006
2531 Posts
October 06 2017 09:27 GMT
#2
I love Ai s!

I was such a big fan of the AMAI ai of Warcraft 3. Was funny seeing people lose to it.
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
October 07 2017 03:50 GMT
#3
New version is on the github. Should fix the extreme fast game speed.
If you cannot win with 100 apm, win with 100 cpm.
UncleVinny
Profile Joined April 2011
United States35 Posts
Last Edited: 2017-10-07 05:01:37
October 07 2017 04:58 GMT
#4
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.
<3 Sheth
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
October 07 2017 15:05 GMT
#5
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"

If you cannot win with 100 apm, win with 100 cpm.
UncleVinny
Profile Joined April 2011
United States35 Posts
Last Edited: 2017-10-07 19:28:21
October 07 2017 19:14 GMT
#6
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?
<3 Sheth
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
October 07 2017 22:04 GMT
#7
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.

If you cannot win with 100 apm, win with 100 cpm.
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
October 09 2017 20:43 GMT
#8
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.
If you cannot win with 100 apm, win with 100 cpm.
Archiatrus
Profile Joined June 2014
Germany64 Posts
October 27 2017 11:48 GMT
#9
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.
Deimos
Profile Joined June 2009
Mexico134 Posts
November 20 2017 07:49 GMT
#10
Maybe a video tutorial will be the best way to introduce how to play against your bot..thx
Deimos
Profile Joined June 2009
Mexico134 Posts
November 20 2017 08:30 GMT
#11
Apparently dont work anymore because the new version of starcraft ;(
Archiatrus
Profile Joined June 2014
Germany64 Posts
November 20 2017 11:34 GMT
#12
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.
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
Patches' TLMC21 Bash #2
CranKy Ducklings55
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PartinGtheBigBoy 271
Nathanias 105
Nina 86
RuFF_SC2 80
Ketroc 26
StarCraft: Brood War
Snow 198
Backho 184
Sharp 95
sorry 48
JulyZerg 33
ajuk12(nOOB) 31
yabsab 26
Icarus 6
Bale 0
Dota 2
monkeys_forever364
League of Legends
JimRising 727
Counter-Strike
Stewie2K565
m0e_tv229
Coldzera 199
Super Smash Bros
C9.Mang0388
hungrybox303
Other Games
summit1g7229
Skadoodle332
Maynarde153
Organizations
Other Games
gamesdonequick6745
Counter-Strike
PGL3684
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH95
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV412
League of Legends
• Rush804
• Lourlo481
• Stunt90
Other Games
• Scarra1334
Upcoming Events
Afreeca Starleague
6h 48m
Soma vs Bisu
OSC
10h 48m
OSC
14h 48m
MaxPax vs Gerald
Solar vs Krystianer
PAPI vs Lemon
Ryung vs Moja
Nice vs NightPhoenix
Cham vs TBD
MaNa vs TriGGeR
PiGosaur Monday
20h 48m
OSC
1d 19h
The PondCast
2 days
OSC
2 days
Wardi Open
3 days
CranKy Ducklings
4 days
Safe House 2
4 days
[ Show More ]
Sparkling Tuna Cup
5 days
Safe House 2
5 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.