• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:59
CEST 16:59
KST 23:59
  • 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 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Weekly Cups (July 7-13): Classic continues to roll2Team TLMC #5 - Submission extension1Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7Weekly Cups (June 30 - July 6): Classic Doubles7
StarCraft 2
General
RSL Revival patreon money discussion thread Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Final Player Roster TL Team Map Contest #5: Presented by Monster Energy Team TLMC #5 - Submission extension
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces Hiatus From ASL BW General Discussion A cwal.gg Extension - Easily keep track of anyone [Guide] MyStarcraft [ASL19] Finals Recap: Standing Tall
Tourneys
CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China [Megathread] Daily Proleagues 2025 ACS Season 2 Qualifier
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile CCLP - Command & Conquer League Project The PlayStation 5
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
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread HOW TO HIRE A HACKER TO RECOVER STOLEN BITCOIN. Russo-Ukrainian War Thread Summer Games Done Quick 2025! Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 617 users

Day 2: BOO with Genetic Algorithms

Blogs > Revilo
Post a Reply
Revilo
Profile Blog Joined October 2010
Germany23 Posts
October 14 2010 10:49 GMT
#1
Heya fine folks of TL,
I have finished making the controller for the Genetic Algorithm (Basically all the easy work is done). Now I have to get down and dirty with the fitness function and also replicate the Starcraft 2 game in mini form to evaluate timings, minerals, gas, etc... Wish me luck! If someone is interested in the bare bone Genetic Algorithm coded in python 2.7 which currently does nothing but find the optimal "Drone Only" build order, let me know and I can email it to you or provide a link.

Any inspiring ideas about the fitness function would be welcome It has dawned on me that this is definitely the hardest part of the algorithm I may however start with the Starcraft 2 simulator which would let people also just plug in a build order by hand and see the fastest execution time for it.

Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
Revilo
Profile Blog Joined October 2010
Germany23 Posts
Last Edited: 2010-10-14 13:43:33
October 14 2010 13:41 GMT
#2
I have finished making a basic version of the Starcraft 2 game simulator. The first thing I told it to try is to give me the build time for a 6 pool (naturally ). Here are the timings it spits out:

0:38 - Spawning Pool
0:53 - Drone
1:08 - Drone
1:10 - Drone Completes
1:25 - Drone Completes
1:43 - Spawning Pool Completes
1:43 - Zergling
1:43 - Zergling
1:43 - Zergling
2:07 - Zergling Completes
2:07 - Zergling Completes
2:07 - Zergling Compeltes

This is of course in game time and I have made no variance based on time to get to mineral patches, etc... If someone know how fast they can get 6 zerglings in a 6-pool, I would appreciate the data. If you beat the listed timings you will be added to a special thanks section of the final algorithm

EDIT: Bear in mind, this is not the genetic algorithm giving a perfect build order for 6 zerglings. Rather this is just the timing function that is telling me how fast this build order can be done.
Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
Revilo
Profile Blog Joined October 2010
Germany23 Posts
October 14 2010 15:10 GMT
#3
Just completed a build order "cleaner". It basically takes an arbitrary build order (even if its an illegal one) and goes through it and checks to make sure basic requirements are fulfilled for each step. For instance, if Zerglings are to be made, it checks to see if there is already a spawning pool in the build order. Also, it checks to make sure enough pop is available given the overlords produced beforehand in the build order. If something illegal is found, it simply removes it from the list and increments a penalty counter. At the end it returns a cleansed build order that is legal and a penalty count that tells you how many incorrect units were removed from the original build order. This is mainly a preprocessing tool for my genetic algorithm to keep the input to the Starcraft 2 simulator legal (preventing an infinite loop).
Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
ammeL
Profile Joined August 2009
United States211 Posts
October 14 2010 16:31 GMT
#4
Interesting stuff; I may be able to provide some input. I can probably take a look at the code, too, to see if any ideas spark for me and I can help you with the algorithm.
Those who criticize our generation forget who raised it.
palanq
Profile Blog Joined December 2004
United States761 Posts
October 14 2010 16:42 GMT
#5
the objective function is to maximize the probability of winning, but this depends on what your opponent is doing, and that could be a number of things, depending on what you see. so I don't see how you can manage the problem.

the best you could do maybe is to maximize the size of your army at 20 minutes, subject to the constraints that you must have at least such and such units and upgrades at particular timepoints.

fun project, and good luck, but I'm not sure if this will be useful for players
time flies like an arrow; fruit flies like a banana
ammeL
Profile Joined August 2009
United States211 Posts
October 14 2010 17:03 GMT
#6
Even though it may not be useful to players, it may still be useful in the context that you're able to see what times certain things can be done (though of course, I'm sure there will always be something more efficient).

This will probably be of no use to most people, but if you're just messing around with build orders and certain timing attacks, knowing that you can have X amount of Zerglings out in an X amount of time can help you in some ways.
Those who criticize our generation forget who raised it.
Revilo
Profile Blog Joined October 2010
Germany23 Posts
October 14 2010 18:06 GMT
#7
So I have extended the code to now include Queens (with larva injection), as well as extractors (with drones moving to extractor) and Roaches and the Roach Warren. I have been able to replicate some results by users for a 7 Roach Rush:

+ Show Spoiler +
7 Roach Rush
00:00 - Drone
00:13 - Drone
00:15 - Larva Spawn
00:17 - Drone Complete
00:24 - Drone
00:30 - Larva Spawn
00:30 - Drone Complete
00:33 - Drone
00:41 - Drone Complete
00:45 - Larva Spawn
00:50 - Drone Complete
00:50 - Overlord
01:00 - Larva Spawn
01:15 - Larva Spawn
01:15 - Overlord Complete
01:19 - Spawning Pool
01:27 - Drone
01:35 - Drone
01:42 - Larva Spawn
01:44 - Drone Complete
01:44 - Drone
01:51 - Drone
01:52 - Drone Complete
01:57 - Larva Spawn
01:57 - Drone
02:01 - Drone Complete
02:08 - Drone Complete
02:12 - Larva Spawn
02:12 - Drone
02:12 - Extractor
02:14 - Drone Complete
02:24 - Spawning Pool Complete
02:27 - Larva Spawn
02:27 - Drone
02:29 - Drone Complete
02:30 - Queen
02:42 - Larva Spawn
02:42 - Extractor Complete
02:42 - Drone
02:44 - Drone Complete
02:51 - Roach Warren
02:57 - Larva Spawn
02:58 - Drone
02:59 - Drone Complete
03:12 - Larva Spawn
03:12 - Overlord
03:15 - Drone Complete
03:20 - Queen Complete
03:27 - Larva Spawn
03:27 - Overlord
03:37 - Overlord Complete
03:42 - Larva Spawn
03:46 - Roach Warren Complete
03:46 - Roach
03:52 - Overlord Complete
03:57 - Larva Spawn
03:57 - Roach
04:00 - 4x Larva from Inject
04:00 - Roach
04:00 - Roach
04:03 - Roach
04:12 - Larva Spawn
04:12 - Roach
04:13 - Roach Complete
04:20 - Roach
04:24 - Roach Complete
04:27 - Larva Spawn
04:27 - Roach Complete
04:27 - Roach Complete
04:30 - Roach Complete
04:39 - Roach Complete
04:42 - Larva Spawn
04:45 - 4x Larva from Inject
04:47 - Roach Complete
Build finishes at 04:48 minutes.
Minerals at end: 255.0
Gas at end: 75.0


The algorithm has some built in timing issues with the transfer of workers between minerals to gas and from spawning to minerals. But I believe these are negligent and you should be able to almost replicate these times to the second. Playing on normal speed to try it out first might help with training it. This is a very aggressive build. If anyone has some other Zerg build orders they would like me to time and compare with your own play time, please feel free to post them (or pm me if you feel it might be embarrassing or secretive ).
Looking for practice partners on EU! Message me if you like :) "I dont wtach porn anymore, I watch Socke" - Rotterdam
Slithe
Profile Blog Joined February 2007
United States985 Posts
October 14 2010 18:47 GMT
#8
What kind of performance are you seeing on the algorithm for something about as complex as a 7 roach rush? Does the fitness level converge relatively quickly?
Please log in or register to reply.
Live Events Refresh
Wardi Open
11:00
#44
WardiTV1675
OGKoka 1058
Rex159
CranKy Ducklings150
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 1058
Rex 159
StarCraft: Brood War
PianO 5140
Rush 1883
Sea 1611
firebathero 1558
EffOrt 1273
JulyZerg 1083
zelot 703
Larva 666
Stork 626
Mong 488
[ Show more ]
Mini 315
Mind 146
Zeus 117
ToSsGirL 104
sorry 93
Pusan 82
Barracks 78
Movie 66
Shinee 56
sSak 47
soO 41
Shine 40
Terrorterran 31
sas.Sziky 31
Rock 16
IntoTheRainbow 9
yabsab 8
Bale 7
SilentControl 7
NaDa 4
Stormgate
NightEnD30
Dota 2
qojqva3439
syndereN585
League of Legends
Dendi1601
febbydoto7
Counter-Strike
flusha479
Super Smash Bros
Mew2King94
Heroes of the Storm
Khaldor219
Other Games
singsing2817
hiko1314
Fuzer 685
crisheroes456
Beastyqt353
Lowko288
oskar233
XcaliburYe233
Hui .224
Liquid`VortiX181
KnowMe103
ArmadaUGS99
QueenE51
Trikslyr1
Organizations
Other Games
gamesdonequick5050
StarCraft: Brood War
Kim Chul Min (afreeca) 7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 58
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2532
League of Legends
• Nemesis6008
Upcoming Events
RotterdaM Event
1h 1m
Replay Cast
19h 1m
WardiTV European League
1d 1h
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
PiGosaur Monday
1d 9h
uThermal 2v2 Circuit
2 days
Replay Cast
2 days
The PondCast
2 days
Replay Cast
3 days
Epic.LAN
3 days
CranKy Ducklings
4 days
[ Show More ]
Epic.LAN
4 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
5 days
Online Event
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
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

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
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.