Steamhammer’s elo is plummeting, a clear sign that the voters have taken an interest in the new release and are wielding their monkey wrench. At this rate, they’ll lose interest again pretty soon....
Here is the change list. Opening selection in the opponent model should help all races choose stronger openings against each opponent, when the bot has gathered enough experience. The map analysis changes have no effect on play (yet), but are part of the effort to jettison the terrain analysis library BWTA2 and will make a variety of analyses easier in the future. Protoss should no longer break the time limit after its base fills up with buildings. Terran tanks don’t siege and unsiege so insanely often. Terran building addons are built more quickly and reliably. Many of the other changes help all races play better. Macro for terran and protoss is much improved. Micro is a trifle crisper, especially for melee units.
It’s a complicated update, and there is a higher than usual risk of new bugs.
The most important changes are in bold type.
opponent model
• Select openings which have been successful against this opponent before. Take the map into account; with experience, Steamhammer will play different openings on different maps (though with 14 maps to learn about, map adaptation is slow as a snail). If past opening choices are not fully successful, try out different openings. With an increasing number of games, this increasingly includes openings that aren’t tagged as suitable for the opponent’s recognized plan, or for the opponent’s race, or even openings that Steamhammer otherwise won’t play at all. We will occasionally see openings that Steamhammer has never played in public before, because they were written in but not configured to be played. This is more or less as described in my earlier plans. I’ll post a more detailed description separately.
• When recording the opponent’s game record to a file at the end of each game, rewrite the entire file instead of appending to it. Appending works on SSCAIT, but most other competitions require the file to be rewritten.
• The plan recognizer recognizes a new Factory
plan that can be followed only by terran. It means terran is starting with a mech opening. Zerg is configured to counter the Factory
plan with an AntiFactory
opening. In tests against different opponents, the plan is accurately recognized, and the change produces much stronger zerg play against terran mech openings. Terran and protoss are not configured with anti-mech openings, but could be.
• The plan recognizer is smarter in one way: If the opponent plays a fast opening plan, the recognizer doesn't change its mind later when it sees signs of a slow opening plan; it wants to recognize the first thing the opponent does. The plan recognizer was doing things like correctly recognizing a 5 pool as Fast rush
, then later seeing the 5 pooler add a second hatchery, and deciding that it was a macro opening after all. In the next game, Steamhammer could react incorrectly.
• There was a typo in the UCB code! Fixed. This affected the auto gas steal, if it was turned on.
• Separately, the auto gas steal is a little more conservative. It wants to see more evidence that it is useful before it is repeated.
• Try to detect whether the opponent always plays the same strategy. If so, the game info display notes it as (say) “surely Fast rush” instead of “expect Fast rush”. The opponent model uses the information behind the scenes (a little bit).
map analysis
• New code calculates base locations and stores related information. It works, and is used for some purposes, but most of Steamhammer still relies on BWTA. The information manager indexes bases by their BWTA::BaseLocation
, and it turns out to be something that should be redone in one sweep. Later I’ll move the information manager functions into the new Bases
class.
openings
• The opponent model is now in charge of choosing openings, so the CounterStrategies
section of the configuration file is now used only when the opponent model wants to try out openings that respond to the enemy's expected plan, rather than whenever the enemy has an expected plan. I made the probabilities more even, so that stronger counters are still preferred but weaker counters will come up more often than they used to. That will help the opponent model collect the data it needs.
• I haven’t documented it before, but Steamhammer for a time has had some openings which are included in the configuration file but not configured to be played. Bot authors might choose them for their own bots, or take them as starting points for developing new openings. The opponent model is now able to select these openings. It will occasionally choose one at random and try it out against an opponent which it has played many games against, and if the opening is successful it will keep playing it against that opponent. For this release, I added more unconfigured openings.
• Included in the openings provided but not configured to be played are a bunch of new protoss openings from Antiga. They deserve attention, but I ran out of time.
• OverpoolSpeed
was accidentally replaced with a bad opening in the previous version. I restored the good version.
• The classic Over10Hatch
opening was restored under that name. It makes 2 sunkens at earlier timing than the newer Over10Hatch2Sunk
, and builds fewer drones. The idea is that restoring it should allow old learned data at SSCAIT to remain useful—it’s useless when it refers to an opening name that no longer exists. Plus there are times when the low-economy version works better.
• New zergling rushes 5PoolHard2Player
which hits harder on 2 player maps, and 6PoolSpeed
which hits differently.
• Zerg has a new AntiFactory
opening to combat early vultures and their followup. It works great. Terran has a corresponding VultureWraith
opening for TvZ. I wrote it as one of the tests of AntiFactory
, and found that it is effective against zerg opponents which aren’t ready. And the opponent model should now be able to tell which opponents are not ready.
• New zerg openings Over10HatchBust
, Over10HatchSlowLings
, and Over10Hatch2SunkHard
are variations of the anti-zealot rush build and may be suitable for different opponents. They are intended as food for the opponent model. Overpool+1
is a weaker version of the ZvZ opening played by Marian Devecka’s Killerbot. Because of a limitation of the strategy boss, it gets carapace +1 instead of melee attack +1, which reduces its effectiveness. None of these openings is particularly good, but I expect they will have value against some opponents.
production
• No more queue deadlocks. Steamhammer avoids most production jams by recognizing and dropping jammed items. This affects terran and protoss; zerg already had virtually no production jams.
• Effective queue reordering. The previous version occasionally reordered queue items for more efficient production. This version generalizes the technique and benefits from it much, much more often. If the next queue item can’t be started immediately, and a later item up to 4 places ahead can be, and other conditions are satisfied, the later item is moved to the front of the queue and produced immediately. This affects all races, terran the most, protoss somewhat less, zerg the least.
With production unjamming and queue reordering working together, terran and protoss macro is way smoother. Production unjamming is aggressive; it drops any item which will cause a long delay. BOSS will often order (say) a cyber core and then dragoon range immediately afterward. It caused a long delay, though not a deadlock. Now when that happens, Steamhammer usually finds when it gets to dragoon range that the cyber core is still in the building manager’s queue and hasn’t been started yet, so it drops the research. BOSS will order the research again on its next cycle; not ideal but a big improvement overall. Meanwhile, the next cycle comes sooner because queue reordering makes production of this cycle faster. If the cyber core was started and hasn’t finished, other queue items will be pulled in front of dragoon range and produced first. Unfortunately, BOSS is as happy as ever to order all buildings and no units. Queue reordering can only mitigate the flaw to an extent.
• It’s possible in principle for queue reordering to be too thorough and break an opening’s intended build order. To cope with that, I added a new command that can be included in a build order, "go queue barrier"
. Nothing after "go queue barrier"
will be reordered to happen before it. It was just a tiny little bit trivial to implement, because it’s a command that does nothing; queue items are never reordered across any command. No openings use "go queue barrier"
currently; I tested the likely candidates and found that they worked fine with queue reordering.
• Protoss should not overstep the time limit when its base fills up with buildings. This is a major improvement for protoss. There are 2 contributors to the slowness: Failing building placement in the building manager, and failing building placement in the production manager when it tries to predict when a building can be started (it needs to know where, so it can figure out how far ahead of time to send a worker). The change is applied in both places; both are fixed. The production manager’s problem was already mitigated by a workaround which retries building placement less often, and I kept the mitigation since placement can fail for other reasons. The problem won’t be 100% solved and shelved until building placement is fast and reliable.
If the debug option Config::Debug::DrawBuildingInfo
is turned on, then buildings which are currently stalled and cannot be built are in red. After a pylon finishes and the buildings unstall, they turn back to the normal yellow color.
• Earlier versions tried to work around the protoss building placement problem in part by allowing certain types of protoss buildings to touch each other vertically. This made building layout more compact, but had the side effect of sometimes trapping units in enclosures. This version drops the workaround. Protoss base layout is loose to the point that it is awkward and causes problems, but that is not as bad as trapping units.
• Terran addons are produced via production goals, which construct them more reliably and earlier. It is a significant improvement for terran. Some terran openings are improved to take advantage; there is more room to improve them. I removed a workaround for a BOSS comsat bug, since production goals work around the bug automatically.
tactics and micro
• Deciding which base to attack now takes into account some of the enemy units seen near that base. Earlier versions took into account static defense only: Attack the base with the least static defense. This version also takes into account certain slow-moving units that are good for defense: Tanks, high templar, reavers, lurkers, guardians. The aim is still to attack the least-defended base. It’s smart enough that an air squad with no ground units only worries about defenses which can attack air, and a ground squad with no air units doesn’t worry about turrets or spore colonies.
• Deciding where to drop is more flexible. Drop navigation—moving the transport around the edge of the map—is rewritten, and its code is far simpler. The main practical effect of this work is that the dropship or shuttle always takes the shortest path around the map to its target. It used to be right only half the time, despite an attempt to figure it out. The protoss dark templar drop will land earlier up to half the time. With help from the addon production improvement (see above), the terran vulture drop always lands earlier.
I did not finish my plans to improve drop decisions. It’s a little smarter about where to drop, not as smart as I wanted. If no enemy base is known to drop on (which only happens in rare circumstances when other things have gone wrong), the transport is sent to drop on an unscouted base—and if the base is empty, it still drops there. Furthermore, the dropped units then sit around and do nothing. The issue is so rare that I didn’t fix it.
• Some rework of micro targeting. Zealots and zerglings are particularly improved. Melee units are allowed (as ranged units always have been) to ignore bad targets, which makes them less distractible. All units ignore targets outside of a maximum range limit, to make them less distractible. The method of prodding units to tend to move toward the squad goal is changed; this is responsible for most of the improvement in melee units. And there are various minor changes in detail.
• Units that can’t attack under dark swarm, don’t try to. This may help occasionally against those few opponent bots that use dark swarm. Mainly, it is preparation for when Steamhammer knows how to use defilers itself.
• Enemy nydus canals were usually given priority as important targets. Now they are always given yet higher priority. I think it is likely that they are still not high enough in priority, but Steamhammer has yet to need the knowledge, so it’s hard to be sure.
configuration file
• The debug option Config::Debug::DrawQueueFixInfo
prints information to the screen when the queue is reordered or a production jam is averted. For terran and protoss, this happens a lot. If you only watch the queue on screen and don’t turn on this option, it is hard to visually catch all of the changes.
• The IO option Config::IO::MaxGameRecords
limits the maximum number of game records that are stored for each opponent. When over the limit, the oldest records are dropped. The bot can be left running indefinitely on a server like SSCAIT without risk of using up its allotted space or growing slow because the opponent model files are too big.
• If you don’t want to use the plan recognizer, set Config::Strategy::UsePlanRecognizer
to false. The enemy plan will always be Unknown
. I expect this may be useful for some authors of forks.
• The configuration option Config::Micro::KiteLongerRangedUnits
is removed. Not only was it a confusing name, I decided it wasn’t something that bot authors needed to be able to reconfigure. You can still change the behavior in the code at Micro::AlwaysKite()
.
• The command "go queue barrier"
can be used in build orders to prevent queue reordering. It was explained above.
code
• CombatCommander::getMainAttackLocation()
renamed to getAttackLocation()
. If I keep this up, eventually all the names will make sense.
terran and protoss
• Tank siege and unsiege are much improved. There’s less “Siege! Unsiege! Siege! Maybe fire a shot? No, unsiege!” Terran tank play is considerably stronger—it is like putting dirt in your eye, instead of blinding yourself with a red-hot poker. There are other minor changes to tank behavior.
• Wraiths now use the same kiting code as mutalisks.
• Goliaths, wraiths, and scouts prefer air targets over ground targets. Suddenly they realize that their air weapons are much stronger. This change and the previous one were made first of all to improve terran wraith play, now that there is a VultureWraith
opening. Overlords beware.
• Protoss carriers do not target enemy interceptors. In carrier-on-carrier battles, Steamhammer’s carriers were ineffective because they tried to hit the swooping enemy interceptors, and failed—“I’ll hit that one... no. That one... no. That one...”.
zerg
• If we need a macro hatchery and adding it won’t delay important production, just add it! There was a bug where Steamhammer thought that adding a macro hatchery would prevent it from getting critical tech units in time, even when it had plenty of resources and adding the hatchery could only help. This fixes what I think is the one biggest cause of breakdowns in zerg macro. (There are more.)
• If we have a big mineral excess, be more eager to add extractors. This should improve gas-starved late game play, which is especially noticeable versus XIMP by Tomas Vajda.
• If we scout the enemy doing a fast rush, and we’re doing a fast rush ourselves—don’t react. Steamhammer’s current reaction is not appropriate for the situation; it’s better to stay the course.
• The gas steal sometimes failed because the strategy boss incorrectly dropped the extractor from the queue. Fixed.
• Fixed a bug that prevented 4 pool from working. I think this one has been around for a while; I have occasionally noticed odd games that were probably caused by this bug, but never diagnosed it because 4 pool is played so rarely.
• I made a minor change to the details of unburrowing a severely hurt unit after it heals up some.
• A minor change to defense against proxy buildings: Steamhammer no longer feels a need to defend against a terran proxy which lifts off and floats out of sight.