Steamhammer 1.1.1’s configuration file

The config file is named Steamhammer_1.1.1.json and controls settings including the bot’s choice of opening build order.

The config file is easy and fun to edit. Especially useful are the Debug section if you want to see what the bot is thinking, and the Strategy section if you want to change its openings. If you want to test your own play or any bot against a specific zerg opening, you can write out the opening build order and tell Steamhammer to follow it. (The config file is inherited from UAlbertaBot and you can do the same with UAlbertaBot for any race, though Steamhammer has more features.)

The file is in JSON format. If you introduce a syntax error that you can’t find, drop it into any handy JSON checker (plenty are online).

I’ll go through section by section.

Bot Info

The bot’s name and author. If you fork Steamhammer, don’t miss this part! Setting PrintInfoOnStart to true tells the bot to announce its name and author when it starts up.

BWAPI

SetLocalSpeed is 0 to let the bot play at its full speed in games you set up against other bots. Some bots set a slower local speed by default. If UserInput is true, then you can enter commands like /speed 30 to slow it down and /speed 0 to speed it up again. These commands work across bots, not only in Steamhammer, and there are other commands. Set CompleteMapInformation to true for the bot to cheat and see everything (it is not allowed in competition, obviously).

Micro

Various micro settings. The most confusing is KiteLongerRangedUnits, which really means “kite these units even if the opposing unit has a longer weapons range.” It makes sense mostly for fast units like mutalisks and vultures. If ScoutDefenseRadius is set to a positive integer, then an enemy worker scout which approaches to within that range of our main base (in pixels) will be met with a worker of our own that tries to chase it away. It is turned off in Steamhammer because the defending worker may be lost.

Macro

This section is of little use and I may end up removing it in a later version. But in the meantime you can play around if you’re interested.

Debug

In release versions, all the “draw” options except DrawStrategySketch are turned off. In development, I turn on the appropriate ones to see what the bot is thinking. They draw information on the screen. If you turn on too many at the same time, they’ll draw all over each other. DrawGameInfo and DrawProductionInfo are my favorites.

Modules

The only remaining module is UseStrategyIO, which uses a simple machine learning method to seek openings which are successful against previously-played opponents. I have not tested the feature to work with Steamhammer’s random openings.

Tools

The map grid that Steamhammer uses to keep track of explored areas. I have never had a reason to change the number.

Strategy

The next entries tell which opening to play when. Steamhammer inherited the opening specification from UAlbertaBot, but adds many features.

There are several different ways to tell Steamhammer which opening to play.

1. If you put in a line "Zerg" : "5Pool", then Steamhammer will play 5 pool whenever it is zerg, or in other words, always. (Don’t forget the comma that separates it from the next line.)

2. If you put in a line "ZvT" : "ZvT_2HatchMuta", then Steamhammer will play its 2 hatch mutalisk opening every time it faces a terran. In the matchup name, “U” means that the opponent chose random (the race is “unknown”). Note: The bot’s own race can never be unknown, even when playing random; we know it as soon as the game starts.

3. Steamhammer can play different openings against opponents that it recognizes by name. Set UseEnemySpecificStrategy to true and, inside the EnemySpecificStrategy subsection, give an opening for each opponent that you want to treat differently. The example means “When playing Jakub Trancik as zerg, play the 9 pool expo opening.”

    "Jakub Trancik" : { "Zerg" : "9PoolExpo" }

4. Steamhammer can choose openings randomly. Instead of the name of an opening, give a StrategyMix which lists different openings with weights for how often they should be played. The weights can be any positive integer, but I like to choose weights which add up to 100 so that they are percentages. This also works for opponent-specific openings. (Get the punctuation here exactly right.)

    "ZvU" :
        { "StrategyMix" : [
            { "Weight" : 10, "Strategy" : "5Pool" },
            { "Weight" : 20, "Strategy" : "9PoolExpo" },
            { "Weight" : 70, "Strategy" : "9PoolSpeed" }
        ]},

5. The random openings also work inside the EnemySpecificStrategy section, but they assume that you are playing a fixed race. If you play random, you can’t specify random openings against specific opponents.

Finally, the Strategies subsection defines the opening build orders themselves. The opening build order is a sequence of items to build one after the other. Each item can be a unit, a building, an upgrade, a tech to research, or a command. The name of each item is case-insensitive, that is, upper case and lower case do not matter.

As an abbreviation, you can order up multiple units of the same kind. "3 x zergling" is the same as "zergling", "zergling", "zergling".

Steamhammer provides a number of commands that can be executed during the build. All the commands start with the keyword “go”.

When you first build an extractor, Steamhammer assumes that you want to collect gas right away, so gas collection is turned on. I put “go gas until” commands right after the extractor: "extractor", "go gas until 100". Steamhammer remembers the intention and executes the steps at the right time (though it often collects 8 or 16 gas more than it should).

If you ask for “hatchery”, Steamhammer assumes you want the hatchery at a gas expansion. You can choose.

If you ask for "creep colony" to build static defense, Steamhammer assumes that you want it at the main base. You can choose—a little bit. This arrangement is awkward and limited and I will probably change it in a future version. Steamhammer does not have the smarts to place creep colonies in good locations (like toward the enemy), so it may do something silly.

a note on other races

Steamhammer plays zerg, but is it descended from UAlbertaBot which can play all 3 races. In making updates, I have tried to avoid breaking the ability to play all 3 races. But I only test with zerg, and we all know that nothing keeps working if you don’t test it. If you configure Steamhammer to play terran or protoss or random then no promises, but it is likely that you would have only a small number of problems to fix.


page originally created 5 March 2017