• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 09:32
CET 15:32
KST 23: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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced14[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband BGE Stara Zagora 2026 announced Information Request Regarding Chinese Ladder SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
$5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
Which season is the best in ASL? FlaSh's Valkyrie Copium [ASL20] Ask the mapmakers — Drop your questions BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Should offensive tower rushing be viable in RTS games? The Perfect Game
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 TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1880 users

Day 3: A word on Brute Force

Blogs > Revilo
Post a Reply
Revilo
Profile Blog Joined October 2010
Germany23 Posts
October 23 2010 14:52 GMT
#1
I had a number of people suggest brute force as a viable option in solving these short build order problems. I was skeptical, since the number of possible moves in a build order quickly explode in complexity. However, I was not content just thinking about it and so I tried it out for myself. The results are not too surprising...

I based my algorithm on the game as much as possible. This means that I run a simulation of the game for each build order with a minimum time unit of 1 game second. This allows me to bound the searches I make for optimal build orders by declaring my goal units and a maximum time limit for them to be reached. Since I know how long a 6-pool should take to be optimal, I can set a limit below this by 1 second and let the algorithm compute all elements in the search tree as a benchmark for the worst case. Sadly this number becomes quite staggering as the algorithm goes on.

Before you hit the 18 second mark the only things that are really possible are drones, spawning pool, overlords, hatcheries, extractors, moving drones to scout... So there are not that many options but nevertheless quite a few. However, as soon as you add a spawning pool or any other tech units this number of options grows to 20, then 30, and finally 62. This means that at each leaf of the tree, a set of 62 new actions have to be checked for validity and whether they achieve the goal. Of course I am not doing blind brute force (that would be even more horrendous), instead I only allow a small set of options based on the currently available technology to the Zerg simulation. Still, a run of the algorithm over all possible moves up to game time 10 seconds takes 1000ms to calculate. Setting the limit to 16 game seconds takes over 26000ms, and going beyond 30 game seconds is too long to wait for.

In conclusion:
Don't use brute force for this problem unless you can narrow down your tech A LOT! By this I mean, if you want to get a build for X number of zerglings, make sure you only allow the algorithm to use direct paths of tech (drones, overlords, spawning pool, queen) and ditch anything that you know will not help (extractors, roach warren, etc...)

*****
Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
Weasel-
Profile Joined June 2009
Canada1556 Posts
October 23 2010 15:50 GMT
#2
You don't have to check for something every second, I think it would be easier for your algorithm to simply order all of the things it can currently make and just make those things in some specific order whenever it has the cash to afford them.
gods_basement
Profile Blog Joined August 2010
United States305 Posts
October 23 2010 17:38 GMT
#3
On October 24 2010 00:50 Weasel- wrote:
You don't have to check for something every second, I think it would be easier for your algorithm to simply order all of the things it can currently make and just make those things in some specific order whenever it has the cash to afford them.


you're right. you should make your brute force build order optimizer to use build orders. i cant believe anyone didnt try this previously
(TT~TT)
Revilo
Profile Blog Joined October 2010
Germany23 Posts
October 23 2010 21:13 GMT
#4
The whole idea behind this is to set some target composition of units, say... 6 zerglings, and have the algorithm spit out the shortest way to get to that (in other words, a build order that is as fast as possible to get to 6 zerglings). And I do only do a set number of possible moves at the end of each build order. However, my simulator that checks how long each of those build orders takes in game time has to evaluate on some scale. That scale is the game second. Thats why the algorithm only starts getting slow beyond 18 game seconds (since it takes 17 game seconds to spawn a drone). The first move can only be one of maybe 6 or 7 moves. So here the search space is relatively small. Now once you reach the end of simulation for those 6 or 7 moves, each can now append another 6 or 7 (or more if tech has been unlocked) moves. This makes 36 to 49 buildorders to evaluate. A lot of these are illegal ones, and these I already filter out. However, once you hit the next level down you are already at 200 to 350 build orders. And that, although I have only 3 things building in the build orders.

As I stated before, you can make the algorithm more intelligent to speed things up by removing possible moves based on logic. However, you run the risk of excluding a possibility for a better solution in doing so and it no longer is "truly" brute force. This was only an experiment, but it has shown the core stats of the problem at hand. I will be revisiting Genetic Algorithms with more determination, since it seems the search space truly is IMMENSE!

I hope to release some code soon too Hold on tight!
Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
Please log in or register to reply.
Live Events Refresh
Wardi Open
12:00
Qualifier #3
WardiTV1011
IndyStarCraft 167
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko354
IndyStarCraft 167
ProTech113
LamboSC2 97
Vindicta 21
StarCraft: Brood War
Britney 50842
Calm 5560
Horang2 1198
Shuttle 1191
EffOrt 987
BeSt 851
Larva 584
PianO 414
firebathero 405
Mini 374
[ Show more ]
Hyuk 301
Light 214
Rush 177
Snow 176
ggaemo 143
Soulkey 137
hero 107
Mong 94
Dewaltoss 90
Barracks 78
Pusan 65
Sea.KH 65
JYJ47
Movie 38
soO 38
Shinee 36
Backho 25
JulyZerg 24
Terrorterran 22
scan(afreeca) 21
Shine 18
yabsab 16
NaDa 15
Sacsri 13
HiyA 7
Dota 2
Gorgc3565
qojqva3238
XcaliburYe223
420jenkins190
Dendi174
boxi98172
Counter-Strike
fl0m4767
olofmeister2360
byalli583
zeus356
markeloff38
Other Games
B2W.Neo1208
hiko629
Fuzer 272
Hui .243
QueenE174
Mew2King136
KnowMe105
DeMusliM99
Organizations
StarCraft: Brood War
lovetv 8
Kim Chul Min (afreeca) 4
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2311
• WagamamaTV623
League of Legends
• Jankos2303
• TFBlade566
Upcoming Events
StarCraft2.fi
2h 28m
PiGosaur Monday
10h 28m
Wardi Open
21h 28m
StarCraft2.fi
1d 2h
Replay Cast
1d 9h
The PondCast
1d 19h
Replay Cast
2 days
Korean StarCraft League
3 days
CranKy Ducklings
3 days
SC Evo League
3 days
[ Show More ]
BSL 21
4 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
4 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
4 days
BSL 21
5 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
5 days
Wardi Open
5 days
StarCraft2.fi
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-11-28
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
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
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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.