• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 19:45
CEST 01:45
KST 08:45
  • 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
[ASL20] Ro24 Preview Pt2: Take-Off6[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax3Maestros of The Game—$20k event w/ live finals in Paris30Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Weekly Cups (Aug 18-24): herO dethrones MaxPax Geoff 'iNcontroL' Robinson has passed away What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : 2v2 & SC: Evo Complete: Weekend Double Feature The GOAT ranking of GOAT rankings
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament Monday Nights Weeklies Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
Flash On His 2010 "God" Form, Mind Games, vs JD BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ro24 Preview Pt2: Take-Off BW General Discussion No Rain in ASL20?
Tourneys
[ASL20] Ro24 Group D [Megathread] Daily Proleagues [ASL20] Ro24 Group B [ASL20] Ro24 Group C
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile
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
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The year 2050 European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Evil Gacha Games and the…
ffswowsucks
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2547 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 15m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
UpATreeSC 145
ProTech93
StarCraft: Brood War
Artosis 774
Beast 2
Dota 2
NeuroSwarm118
PGG 73
League of Legends
JimRising 798
Counter-Strike
fl0m476
Other Games
summit1g6132
Grubby3076
Sick1186
shahzam793
C9.Mang0305
Maynarde137
JuggernautJason17
Organizations
Other Games
gamesdonequick539
BasetradeTV17
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• davetesta29
• OhrlRock 1
• Kozan
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21684
League of Legends
• TFBlade657
• Stunt206
Counter-Strike
• imaqtpie822
• Shiphtur166
Other Games
• Scarra1461
Upcoming Events
Replay Cast
15m
Afreeca Starleague
10h 15m
Rush vs TBD
TBD vs Mong
WardiTV Summer Champion…
11h 15m
Cure vs Classic
ByuN vs TBD
herO vs TBD
TBD vs NightMare
TBD vs MaxPax
OSC
12h 15m
PiGosaur Monday
1d
Afreeca Starleague
1d 10h
herO vs TBD
Royal vs Barracks
Replay Cast
2 days
The PondCast
2 days
WardiTV Summer Champion…
2 days
Replay Cast
3 days
[ Show More ]
LiuLi Cup
3 days
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
3 days
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
BSL Team Wars
3 days
Team Hawk vs Team Dewalt
BSL Team Wars
3 days
Team Hawk vs Team Bonyth
SC Evo League
4 days
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
Maestros of the Game
4 days
[BSL 2025] Weekly
4 days
SC Evo League
5 days
Maestros of the Game
5 days
BSL Team Wars
5 days
Team Bonyth vs Team Sziky
BSL Team Wars
5 days
Team Dewalt vs Team Sziky
Monday Night Weeklies
6 days
Liquipedia Results

Completed

CSLAN 3
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
Acropolis #4 - TS1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
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.