• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:42
CEST 14:42
KST 21:42
  • 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
Code S Season 2 - RO4 & Finals Results (2025)8Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy4Code S RO8 Preview: herO, Zoun, Bunny, Classic7Code S RO8 Preview: Rogue, GuMiho, Solar, Maru3
Community News
Weekly Cups (June 9-15): herO doubles on GSL week0Firefly suspended by EWC, replaced by Lancer12Classic & herO RO8 Interviews: "I think it’s time to teach [Rogue] a lesson."2Rogue & GuMiho RO8 interviews: "Lifting that trophy would be a testament to all I’ve had to overcome over the years and how far I’ve come on this journey.8Code S RO8 Results + RO4 Bracket (2025 Season 2)14
StarCraft 2
General
Code S Season 2 - RO4 & Finals Results (2025) Nexon wins bid to develop StarCraft IP content, distribute Overwatch mobile game Rain's Behind the Scenes Storytime Firefly suspended by EWC, replaced by Lancer How herO can make history in the Code S S2 finals
Tourneys
RSL: Revival, a new crowdfunded tournament series SOOP Starcraft Global #22 $3,500 WardiTV European League 2025 [GSL 2025] Code S: Season 2 - Semi Finals & Finals WardiTV Mondays
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers [G] Darkgrid Layout
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 478 Instant Karma Mutation # 477 Slow and Steady Mutation # 476 Charnel House Mutation # 475 Hard Target
Brood War
General
ASL20 Preliminary Maps BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Recent recommended BW games FlaSh Witnesses SCV Pull Off the Impossible vs Shu
Tourneys
[BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET [BSL20] ProLeague Bracket Stage - WB Finals & LBR3 [Megathread] Daily Proleagues [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile Beyond All Reason What do you want from future RTS games?
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine UK Politics Mega-thread Russo-Ukrainian War Thread Echoes of Revolution and Separation
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
A Better Routine For Progame…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 33407 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
RSL Revival
10:00
Season 1: Group B
Clem vs sOsLIVE!
Tasteless1119
ComeBackTV 838
IndyStarCraft 203
Rex153
IntoTheiNu 50
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 1119
Harstem 245
IndyStarCraft 203
Rex 153
ProTech67
SC2Nice 17
StarCraft: Brood War
Britney 51139
Calm 15659
Sea 4073
Bisu 1267
Mini 905
Jaedong 802
Hyuk 657
Hyun 594
EffOrt 489
Stork 333
[ Show more ]
Soulkey 271
Last 225
GuemChi 220
ToSsGirL 193
Snow 158
Rush 121
JYJ62
TY 57
Pusan 54
Mong 51
Liquid`Ret 43
sSak 35
Aegong 24
soO 23
Sacsri 22
Barracks 22
Movie 22
Icarus 21
yabsab 16
Free 11
ajuk12(nOOB) 10
SilentControl 9
Yoon 9
Hm[arnc] 7
ivOry 6
Dota 2
qojqva1980
420jenkins626
XaKoH 447
XcaliburYe426
syndereN9
Counter-Strike
x6flipin501
byalli247
allub238
markeloff182
edward71
PGG 69
Heroes of the Storm
Khaldor190
Other Games
singsing2009
B2W.Neo1029
DeMusliM385
crisheroes384
hiko354
C9.Mang0341
Happy259
Pyrionflax238
ArmadaUGS200
Mew2King72
SortOf45
Trikslyr23
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 46
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3605
League of Legends
• Nemesis6239
• Jankos1655
Upcoming Events
BSL: GosuLeague
6h 18m
Hejek vs Aeternum
Semih vs TousaN
Replay Cast
11h 18m
The PondCast
21h 18m
RSL Revival
21h 18m
Harstem vs SHIN
Solar vs Cham
OSC
23h 48m
Replay Cast
1d 11h
RSL Revival
1d 21h
Reynor vs Scarlett
ShoWTimE vs Classic
uThermal 2v2 Circuit
2 days
SC Evo League
2 days
Road to EWC
3 days
[ Show More ]
SOOP Global
3 days
Future vs MaNa
Harstem vs Cham
Circuito Brasileiro de…
3 days
BSL: ProLeague
3 days
Sziky vs JDConan
Cross vs MadiNho
Hawk vs Bonyth
Sparkling Tuna Cup
3 days
Road to EWC
4 days
BSL: ProLeague
4 days
UltrA vs TBD
Dewalt vs TBD
Online Event
6 days
Liquipedia Results

Completed

Acropolis #3 - GSC
2025 GSL S2
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
BLAST Open Fall 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.