• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:50
CET 16:50
KST 00:50
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
ComeBackTV's documentary on Byun's Career !3Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win3Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15
StarCraft 2
General
Did they add GM to 2v2? Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win ComeBackTV's documentary on Byun's Career ! RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump
Tourneys
RSL Offline Finals Info - Dec 13 and 14! Master Swan Open (Global Bronze-Master 2) Winter Warp Gate Amateur Showdown #1: Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle How Rain Became ProGamer in Just 3 Months BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET [BSL21] RO8 - Day 2 - Sunday 21:00 CET [ASL20] Grand Finals
Strategy
Game Theory for Starcraft Current Meta Simple Questions, Simple Answers Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile General RTS Discussion Thread Dawn of War IV
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 Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2144 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
Canada17137 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
WardiTV 2025
13:00
Playoffs
herO vs SpiritLIVE!
Scarlett vs Gerald
Rogue vs Shameless
MaNa vs ShoWTimE
Nice vs Creator
WardiTV1489
ComeBackTV 711
TaKeTV 391
IndyStarCraft 241
Rex133
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko450
Hui .262
IndyStarCraft 241
Rex 133
ProTech81
BRAT_OK 66
DivinesiaTV 15
StarCraft: Brood War
Britney 30554
Sea 3326
Calm 2543
Mini 1017
Larva 942
EffOrt 927
Horang2 894
ZerO 489
Soma 474
GuemChi 390
[ Show more ]
Snow 350
Stork 312
firebathero 304
Rush 213
Sharp 194
hero 154
PianO 104
Hyun 81
JYJ 57
Mind 45
Light 43
Pusan 40
sorry 39
Sea.KH 38
Mong 33
soO 29
Aegong 29
Killer 27
Movie 25
Terrorterran 22
scan(afreeca) 17
Shine 10
Dota 2
Gorgc5864
singsing4294
qojqva3114
Dendi1108
syndereN334
Counter-Strike
byalli1341
oskar154
markeloff125
Other Games
B2W.Neo1421
Beastyqt618
crisheroes353
mouzStarbuck168
QueenE91
Livibee77
Mew2King54
DeMusliM42
Trikslyr30
ZerO(Twitch)20
nookyyy 14
Organizations
StarCraft: Brood War
lovetv 5
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 17
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV589
League of Legends
• Nemesis2487
• TFBlade754
Upcoming Events
WardiTV 2025
19h 10m
ByuN vs TBD
Clem vs TBD
OSC
22h 10m
CranKy Ducklings
1d 18h
WardiTV 2025
1d 19h
SC Evo League
1d 20h
Ladder Legends
2 days
BSL 21
2 days
Sziky vs Dewalt
eOnzErG vs Cross
Sparkling Tuna Cup
2 days
Ladder Legends
3 days
BSL 21
3 days
StRyKeR vs TBD
Bonyth vs TBD
[ Show More ]
Replay Cast
3 days
Wardi Open
3 days
Monday Night Weeklies
4 days
WardiTV Invitational
5 days
Replay Cast
6 days
WardiTV Invitational
6 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Offline Finals
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 1
WardiTV 2025
META Madness #9
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL Season 19: Qualifier 2
CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 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.