• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:34
CEST 11:34
KST 18:34
  • 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 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, Maru3BGE Stara Zagora 2025: Info & Preview27
Community News
Firefly suspended by EWC, replaced by Lancer2Classic & 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)14BGE Stara Zagora 2025 - Replay Pack2
StarCraft 2
General
Firefly suspended by EWC, replaced by Lancer Jim claims he and Firefly were involved in match-fixing How herO can make history in the Code S S2 finals Rogue & 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. Code S RO8 Results + RO4 Bracket (2025 Season 2)
Tourneys
[GSL 2025] Code S: Season 2 - Semi Finals & Finals WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament $3,500 WardiTV European League 2025 Sea Duckling Open (Global, Bronze-Diamond)
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
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
BW General Discussion ASL20 Preliminary Maps BGH Auto Balance -> http://bghmmr.eu/ Recent recommended BW games FlaSh Witnesses SCV Pull Off the Impossible vs Shu
Tourneys
[Megathread] Daily Proleagues [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET Small VOD Thread 2.0 [BSL20] ProLeague Bracket Stage - Day 4
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread 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
Things Aren’t Peaceful in Palestine US Politics Mega-thread UK Politics Mega-thread Russo-Ukrainian War Thread Vape Nation Thread
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
Formula 1 Discussion 2024 - 2025 Football Thread 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: 33827 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
Canada16669 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
Next event in 1h 26m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech79
StarCraft: Brood War
Britney 23718
Mong 573
actioN 353
Mini 267
Zeus 258
Leta 172
Sharp 140
JulyZerg 134
Killer 112
EffOrt 50
[ Show more ]
Movie 48
Rush 41
Barracks 26
Sacsri 20
sorry 16
ivOry 4
Dota 2
420jenkins452
XcaliburYe417
Fuzer 196
Counter-Strike
olofmeister1390
Stewie2K967
shoxiejesuss674
Super Smash Bros
C9.Mang0481
Heroes of the Storm
Khaldor196
Other Games
ceh9652
Liquid`RaSZi351
crisheroes304
Organizations
Dota 2
PGL Dota 2 - Secondary Stream11166
Other Games
gamesdonequick565
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• LUISG 52
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2112
Upcoming Events
Wardi Open
1h 26m
Replay Cast
14h 26m
Replay Cast
1d
RSL Revival
1d
Cure vs Percival
ByuN vs Spirit
PiGosaur Monday
1d 14h
RSL Revival
2 days
herO vs sOs
Zoun vs Clem
Replay Cast
2 days
The PondCast
3 days
RSL Revival
3 days
Serral vs SHIN
Solar vs Cham
RSL Revival
4 days
Reynor vs Scarlett
ShoWTimE vs Classic
[ Show More ]
uThermal 2v2 Circuit
4 days
SC Evo League
5 days
Circuito Brasileiro de…
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2025-06-11
2025 GSL S2
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
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.