archive by month
Skip to content

reacting to build order disruptions

The live version of Steamhammer, when playing terran or protoss, tries to recover from a disrupted build order using a method inherited from UAlbertaBot: When it loses a building or a worker, it throws away the now-broken production plan and calculates a new one from scratch, using BOSS.

It’s not a very effective method. Games against Stone show why. When Stone kills a worker in the opening with its SCV rush, BOSS usually calculates a plan that says “OK, let’s build some gateways/barracks and workers, and later we’ll get combat units.” Then Stone kills another worker, the build is interrupted again, and BOSS says “OK, let’s build some gateways/barracks....” Steamhammer protoss beats Stone reliably because its probes fight well, but it often ends up with several extra gateways before it can get a zealot out and turn the tide. Steamhammer terran rarely gets a marine out before Stone beats it.

Today I improved the reaction. I didn’t change things when a building is destroyed, because that might genuinely break the build. I thought: If a few workers are lost in the middle game, it’s no big deal, so we can ignore it. If many workers are lost in the middle game, the game is probably over, so we can ignore that too. But if a worker is lost in the opening, we can replace it, and try to stay as close as possible to the original opening.

The code is in ProductionManager::onUnitDestroy().

	// If it's a worker or a building, it affects the production plan.
	if (unit->getType().isWorker() && !_outOfBook)
	{
		// We lost a worker in the opening. Replace it.
		// It helps if a small number of workers are killed. If many are killed, you're toast anyway.
		// Still, it's better than breaking out of the opening altogether.
		_queue.queueAsHighestPriority(unit->getType());

		// If we have a gateway and no zealots, or a barracks and no marines,
		// consider making a military unit first. To, you know, stay alive and stuff.
		if (BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Protoss)
		{
			if (UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Protoss_Gateway) > 0 &&
			    UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Protoss_Zealot) == 0 &&
			    (BWAPI::Broodwar->self()->minerals() >= 150 || UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Protoss_Probe) > 0))
			{
				_queue.queueAsHighestPriority(BWAPI::UnitTypes::Protoss_Zealot);
			}
		}
		else if (BWAPI::Broodwar->self()->getRace() == BWAPI::Races::Terran)
		{
			if (UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Terran_Barracks) > 0 &&
				UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Terran_Marine) == 0 &&
				(BWAPI::Broodwar->self()->minerals() >= 100 || UnitUtil::GetCompletedUnitCount(BWAPI::UnitTypes::Terran_SCV) > 0))
			{
				_queue.queueAsHighestPriority(BWAPI::UnitTypes::Terran_Marine);
			}
		}
	}
	else if (unit->getType().isBuilding())
	{
		// We lost a building. It may be serious. Replan from scratch.
		goOutOfBook();
	}

The main complication is that if several workers are lost, we don’t want to delay the production of combat units while replacing the workers. So if there are no zealots and we can safely make a zealot, we do; and the same for a marine. A more aggressive reaction might be better, but this is what I went with.

Steamhammer protoss now defeats Stone smoothly. You have to watch closely to see when it deviates from its opening book. I expected that Steamhammer terran would still lose, because it doesn’t know what to do when an SCV that is constructing a building comes under attack. In fact, terran puts up a much stronger fight than before and sometimes wins. The marines don’t fight efficiently, but if they accidentally build up a critical mass then they sweep the enemy SCVs away.

It’s hilarious to see Steamhammer tech up to academy while still struggling to clear its base of the SCV rush. In the picture, Steamhammer’s academy is almost finished but it can barely keep marines alive. Shortly after this, more marines came out, the marines happened to group together well, and the SCV rush was suddenly broken. I didn’t see it coming at all.

Steamhammer getting academy, Stone with SCVs

Trackbacks

No Trackbacks

Comments

krasi0 on :

Stone is still such a good benchmark for early worker defense :)

Jay Scott on :

It truly is. The only disadvantage is that it is too cautious. A more aggressive rush would be a stronger test.

krasi0 on :

Isn't MR's SCV rush much more aggressive? We don't see it on SSCAIT anymore so I can't really remember what it looks like

Jay Scott on :

Yes, it was less polished but more aggressive, and it caused problems for bots that could beat Stone.

LetaBot on :

After CIG, I will upload the SCV rush bot again. If allowed, I'll upload the bunker rush bot and the BBS bot as well.

krasi0 on :

You should just upload them as separate entries with some explicit naming scheme where the name indicates what kind of cheese they're about to do (e.g. "Bunker Rush Leta"). Also, they must *always* execute the specified cheese strategy. For instance, have a look at the (now disabled) "5 pool" bot.

You say: "after CIG" which kinda implies that you are about to use those strategies during the CIG tournament and don't want the opponents to have time to prepare against them? :D

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.