• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:01
CET 16:01
KST 00:01
  • 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 Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy5ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool40Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12Blizzard Classic Cup - Tastosis announced as captains18
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Potential Updates Coming to the SC2 CN Server Weekly Cups (March 2-8): ByuN overcomes PvT block Weekly Cups (August 25-31): Clem's Last Straw? Weekly Cups (March 9-15): herO, Clem, ByuN win
Tourneys
World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
Mutation # 518 Radiation Zone The PondCast: SC2 News & Results Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
Soulkey's decision to leave C9 JaeDong's form before ASL BGH Auto Balance -> http://bghmmr.eu/ [ASL21] Ro24 Preview Pt1: New Chaos ASL21 General Discussion
Tourneys
[ASL21] Ro24 Group A [Megathread] Daily Proleagues ASL Season 21 LIVESTREAM with English Commentary [BSL22] Open Qualifiers & Ladder Tours
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
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
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
U4GM Tips Counter Enemy Gadgets Fast in Black Ops rsvsr How to Keep Reward Chains Rolling in Monopol u4gm What to Do First in MLB The Show 26 Spring
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1528 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
Canada17368 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
#79
WardiTV831
OGKoka 127
Rex112
IntoTheiNu 16
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 227
ProTech161
Rex 112
Trikslyr19
MindelVK 8
StarCraft: Brood War
Calm 10842
Bisu 3941
Horang2 1592
Jaedong 1568
Shuttle 934
Larva 638
Hyuk 619
BeSt 564
Stork 481
Mini 460
[ Show more ]
Soma 378
Light 378
Leta 243
Rush 227
Snow 194
Backho 119
ggaemo 103
Pusan 97
PianO 61
Sea.KH 59
[sc1f]eonzerg 57
Dewaltoss 51
Shinee 51
ToSsGirL 34
Nal_rA 32
Shine 31
910 30
Movie 30
Free 24
Aegong 21
IntoTheRainbow 19
soO 19
zelot 19
Hm[arnc] 18
sorry 17
GoRush 17
ajuk12(nOOB) 17
Noble 14
Terrorterran 11
Dota 2
Gorgc6305
League of Legends
Reynor76
Counter-Strike
fl0m3791
Fnx 2207
byalli1578
shoxiejesuss820
kennyS494
Other Games
singsing2162
hiko807
B2W.Neo694
XBOCT467
Beastyqt411
Lowko405
Happy225
OGKoka 127
Sick80
Mew2King61
oskar54
Organizations
Dota 2
PGL Dota 2 - Main Stream42
StarCraft: Brood War
Kim Chul Min (afreeca) 8
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• StrangeGG 28
• poizon28 3
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV316
• lizZardDota2119
• Noizen38
League of Legends
• Nemesis2909
Upcoming Events
Monday Night Weeklies
1h 59m
Sparkling Tuna Cup
18h 59m
Afreeca Starleague
18h 59m
Soulkey vs Ample
JyJ vs sSak
Replay Cast
1d 17h
Afreeca Starleague
1d 18h
hero vs YSC
Larva vs Shine
Kung Fu Cup
1d 19h
Replay Cast
2 days
KCM Race Survival
2 days
The PondCast
2 days
WardiTV Team League
2 days
[ Show More ]
Replay Cast
3 days
WardiTV Team League
3 days
RSL Revival
4 days
Cure vs Zoun
herO vs Rogue
WardiTV Team League
4 days
Platinum Heroes Events
4 days
BSL
5 days
RSL Revival
5 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
5 days
BSL
6 days
Replay Cast
6 days
Afreeca Starleague
6 days
Light vs Calm
Royal vs Mind
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2026-03-22
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
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
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
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
PGL Bucharest 2026
Stake Ranked Episode 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 © 2026 TLnet. All Rights Reserved.