• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 03:00
CEST 09:00
KST 16:00
  • 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
[ASL21] Ro24 Preview Pt2: News Flash9[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy16ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
Weekly Cups (March 23-29): herO takes triple6Aligulac acquired by REPLAYMAN.com/Stego Research8Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool49Weekly Cups (March 9-15): herO, Clem, ByuN win4
StarCraft 2
General
What mix of new & old maps do you want in the next ladder pool? (SC2) Team Liquid Map Contest #22 - Presented by Monster Energy Aligulac acquired by REPLAYMAN.com/Stego Research Weekly Cups (March 23-29): herO takes triple herO wins SC2 All-Star Invitational
Tourneys
RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) WardiTV Mondays World University TeamLeague (500$+) | Signups Open
Strategy
Custom Maps
[M] (2) Frigid Storage Publishing has been re-enabled! [Feb 24th 2026]
External Content
Mutation # 519 Inner Power The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat
Brood War
General
[ASL21] Ro24 Preview Pt2: News Flash ASL21 General Discussion Gypsy to Korea How Can I Add Timer & APM Count? A cwal.gg Extension - Easily keep track of anyone
Tourneys
[ASL21] Ro24 Group F [ASL21] Ro24 Group E Azhi's Colosseum - Foreign KCM Escore Tournament StarCraft Season 2
Strategy
Fighting Spirit mining rates What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game General RTS Discussion Thread Darkest Dungeon
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread The Games Industry And ATVI European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 12368 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
Next event in 3h
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft569
Ketroc 44
Codebar 23
StarCraft: Brood War
Sea 5102
ggaemo 512
Stork 273
Hm[arnc] 99
Leta 94
sSak 49
910 37
Rock 10
GoRush 7
Bale 6
Dota 2
NeuroSwarm151
XaKoH 36
League of Legends
JimRising 687
Counter-Strike
Stewie2K1019
Other Games
summit1g5447
C9.Mang0234
Mew2King53
ToD31
Organizations
Counter-Strike
PGL2788
Other Games
BasetradeTV97
StarCraft: Brood War
UltimateBattle 57
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1221
• Stunt460
Upcoming Events
RSL Revival
3h
Maru vs MaxPax
BSL
12h
RSL Revival
1d
Cure vs Rogue
uThermal 2v2 Circuit
1d 7h
BSL
1d 12h
Afreeca Starleague
2 days
Wardi Open
2 days
Replay Cast
2 days
Sparkling Tuna Cup
3 days
Kung Fu Cup
4 days
[ Show More ]
The PondCast
5 days
Replay Cast
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Escore Tournament S2: W1
WardiTV Winter 2026
NationLESS Cup

Ongoing

BSL Season 22
CSL Elite League 2026
ASL Season 21
CSL Season 20: Qualifier 2
StarCraft2 Community Team League 2026 Spring
RSL Revival: Season 4
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026

Upcoming

CSL 2026 SPRING (S20)
IPSL Spring 2026
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
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 © 2026 TLnet. All Rights Reserved.