• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:32
CET 14:32
KST 22:32
  • 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
HomeStory Cup 28 - Info & Preview12Rongyi Cup S3 - Preview & Info3herO wins SC2 All-Star Invitational14SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8
Community News
Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win1RSL Season 4 announced for March-April5Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8
StarCraft 2
General
HomeStory Cup 28 - Info & Preview StarCraft 2 Not at the Esports World Cup 2026 Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win Oliveira Would Have Returned If EWC Continued
Tourneys
HomeStory Cup 28 RSL Season 4 announced for March-April $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) KSL Week 85 OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 511 Temple of Rebirth The PondCast: SC2 News & Results Mutation # 510 Safety Violation Mutation # 509 Doomsday Report
Brood War
General
Can someone share very abbreviated BW cliffnotes? Liquipedia.net NEEDS editors for Brood War BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion [ASL21] Potential Map Candidates
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [BSL21] Non-Korean Championship - Starts Jan 10
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Path of Exile Mobile Legends: Bang Bang Beyond All Reason
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Play, Watch, Drink: Esports …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1670 users

Towards a good SC bot - Month 1 Report

Blogs > imp42
Post a Reply
imp42
Profile Blog Joined November 2010
398 Posts
October 11 2016 15:59 GMT
#1
Towards a good StarCraft bot - Month 1 - Progress Report

One month has passed since I dove into the world of Brood War AI Bot development. The exchange with the current top shots of BW AI Bots at IRC #BWAPI has been amazing. From kickstart help on Prolog to detailed information on the nitty gritty of BW to analyzing and testing strategies, there has always been somebody willing to support and the learning curve has been steep. Time to briefly reflect on progress, issues and the current “state of the game”.

Let’s do this result-oriented:

How good is the bot by now?

As outlined in my introduction post, I start with a reduced Brood War universe. The bot can only build marines and SCVs. Still, by now the bot is just about to beat the full-fledged built-in bot. In mainly comes down to whether he gets his bunker down or not. Mostly he does, which is a bit imba against marines only .

Even though restricted to producing marines only, the bot can quite accurately predict enemy income and expenditure. Probably the trickiest part is to get the effects of “waypoints” right, when calculating maximum possible income. Let’s say you want to know how fast I can have two tanks out. It’s not good enough to just calculate by when I can reach the necessary income for two tanks, one or two factories, machine shop, depot, and barracks and then subtract build times. Because every time when building something interrupts SCV production it will affect the future income curve, which has to be accounted for. This probably is worth dedicating a separate post.

The scouting algorithm works just fine. Here, the main concern for future work is a good “plain repair” in case scouting is prevented by enemy army. Right now, the scout just runs away from enemy fire and retries as soon as possible. It would be more reasonable to check out some other places once determined the place of interest is currently not accessible.

The current decision making is as simple as possible. Estimate enemy army size through income calculation, actual observation, and a small Fog-of-War bonus, then produce a build order to beat it. Once an army size has been reached that is considered to beat the enemy, attack. The build order is adjusted when new information is available.
Production: the above mentioned “on-line” strategy leads to quite sub-optimal production. At the start of the game the strategy (correctly) calculates it requires only 1 marine to kill the enemy. Hence it produces a build order “barracks, marine, attack”. Quite soon it decides that it requires more army, so it will produce something like “barracks, barracks, marine, marine, marine, marine, marine, attack”. If it had known this from the beginning it could have achieved the second build order more economically. Several solutions are possible, which shall be discussed in a separate post.

Current Issues

The development and testing environment is quite poor. I took some time to rewrite the entire program such that it can play multiple games in a row with the same instance. This allows me to run a couple of tests one after the other automatically. Apart from that, I mainly lack a good setup to play two bots against each other.

The “marines only” scenario reduces a lot of noise, such that I can focus on the more important underlying issues. But it also makes testing quite hard, because maps need to played in UMS or the enemy will just use all available units. The problem is, that the standard maps are not modifiable and cannot be played in single player. So I’m using a modified Lost Temple map for now, which of course introduces its own issues (e.g. only 8 patches in the main, etc.).

Minimum micro abilities are necessary to successfully test. So I ended up spending a considerable amount of time on basic concave, focus fire, pulling back weak units, and last but not least collision detection with walls. You wouldn’t imagine how often your own units walk straight into a wall and remain there until killed!

One last thing I have noticed: bwapi and bwmirror have some issues that makes programming a bit harder. Just to give some examples: When playing terran, bwapi says that feedback was researched for 100 minerals / 100 gas (probably because feedback was once an upgrade and then Blizzard made a hack during a patch just stating it has been researched already at the beginning of the game for all three races). Bwmirror does not always return the same object for the same unit, even though the unit ID is the same. So you can’t trust the equals method and essentially are forced to write your own wrappers for all units.

Finally, the non-object oriented nature of bwapi introduces a lot of potential pitfalls to developers. Basically everything is a “unit” and all possible operations of all units can be called on every unit (“mineralpatch.attack()”, “marine.gatherminerals()”, “mineralpatch.isBuilding() = true” etc.). I ended up writing a typed API for bwmirror. On one side this requires more effort by the developer, since you can’t just write “catch-all” code anymore. On the other hand, I am certain it will reduce developer bugs and it actually also reduces effort in other places. For example, there is no need to write code like “if (unit.getType().equals(UnitType.TERRAN_SCV)) {unit.gather(patch)}”. Rather, you just write “Worker.gather(MineralPatch)”.

What does "typed" and "strongly typed" mean?
Check e.g. en.wikipedia.org

I will let you know how this turned out in the next monthly report


*****
50 pts Copper League
JimmyJRaynor
Profile Blog Joined April 2010
Canada17240 Posts
October 11 2016 17:23 GMT
#2
when i introduce my friends new to SC/RTS i start them off with a very simple "macro cycle" that involves building only SCVs, Marines, CCs, and Rax. pretty cool how u r doing something similar to build the foundations of your AI.
Ray Kassar To David Crane : "you're no more important to Atari than the factory workers assembling the cartridges"
Jukado
Profile Blog Joined May 2011
805 Posts
October 11 2016 20:56 GMT
#3
Continuing from our PMs a few months ago, Ill send you a file.
Star Tale Public Domain project. Maps: (2)Gates Of Memphis, (2)Marshmallow Toast, (4)Bubbles, (4)Clay Fields, (6)Numbskull Desert. Also the Vaylu Public Domain Tileset. Also Ramp Palettes, Brood War guides and some fun stuff. Links in my profile
imp42
Profile Blog Joined November 2010
398 Posts
October 12 2016 16:59 GMT
#4
On October 12 2016 02:23 JimmyJRaynor wrote:
when i introduce my friends new to SC/RTS i start them off with a very simple "macro cycle" that involves building only SCVs, Marines, CCs, and Rax. pretty cool how u r doing something similar to build the foundations of your AI.


I guess the same principle applies to both humans and bots. To newbies all the added complexity of additional units, different maps, etc. distracts from learning the core elements. By scaling down to something simpler it is easier to grasp the essence of the game. Then slowly add complexity.

Good game developers make a very conscious effort of introducing the players gently to the game, as is nicely explained here:
http://www.deconstructoroffun.com/2012/05/5-points-for-killer-first-time-flow.html?q=introduction

50 pts Copper League
nepeta
Profile Blog Joined May 2008
1872 Posts
October 12 2016 18:54 GMT
#5
Keep up the good work! Also send me replays :p
Broodwar AI :) http://sscaitournament.com http://www.starcraftai.com/wiki/Main_Page
ZenithM
Profile Joined February 2011
France15952 Posts
October 13 2016 15:20 GMT
#6
Google about to solve Starcraft in 3...2...1...
Nah I'm kidding, you still got some months man, keep up the good work ;D!
Please log in or register to reply.
Live Events Refresh
Wardi Open
12:00
#72
WardiTV736
IndyStarCraft 212
TKL 190
Rex163
IntoTheiNu 11
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 212
TKL 190
Rex 163
StarCraft: Brood War
Calm 6349
Sea 5873
Bisu 3545
Horang2 2022
Shuttle 1956
Flash 1465
Hyuk 975
GuemChi 550
BeSt 545
EffOrt 491
[ Show more ]
Stork 468
ZerO 463
Mini 428
Light 353
firebathero 309
Snow 300
actioN 266
Soulkey 258
ggaemo 243
Aegong 197
Zeus 166
hero 158
Sharp 127
Hyun 125
Pusan 124
Killer 86
Mong 80
Sea.KH 78
Liquid`Ret 71
PianO 68
Free 58
Barracks 54
ToSsGirL 51
JYJ 33
IntoTheRainbow 29
Shinee 26
Yoon 25
Backho 22
Sacsri 18
Noble 18
SilentControl 17
Hm[arnc] 17
HiyA 16
zelot 15
910 14
Terrorterran 14
scan(afreeca) 14
ajuk12(nOOB) 13
yabsab 13
soO 12
Shine 12
ivOry 7
Dota 2
singsing3408
qojqva1247
Dendi506
XcaliburYe107
Counter-Strike
olofmeister2250
fl0m1724
byalli681
edward91
Super Smash Bros
Mew2King88
Other Games
B2W.Neo1328
Liquid`RaSZi1311
Fuzer 291
crisheroes266
Pyrionflax188
hiko176
Sick118
KnowMe58
ZerO(Twitch)17
Organizations
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
Dota 2
• lizZardDota260
League of Legends
• Nemesis4344
Upcoming Events
PiGosaur Cup
11h 28m
WardiTV Invitational
22h 28m
Replay Cast
1d 10h
The PondCast
1d 20h
WardiTV Invitational
1d 22h
Replay Cast
2 days
RongYI Cup
3 days
uThermal 2v2 Circuit
4 days
Replay Cast
5 days
Wardi Open
5 days
[ Show More ]
Monday Night Weeklies
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2026-02-02
HSC XXVIII
Underdog Cup #3

Ongoing

CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
Acropolis #4 - TS4
Rongyi Cup S3
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W7
Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
LiuLi Cup: 2025 Grand Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 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.