archive by month
Skip to content

fixing a lurker micro bug

Change of plans. I solved a bug that others should know about, so Steamhammer-Tscmoo games will wait until next time.

Steamhammer has a bug that shows up when a lurker starts attacking a building: The lurker becomes unable to switch targets until the building is destroyed. So, for example, if a lurker doesn’t see any other immediate target, it will go after a supply depot. Once it has started in on the depot, marines can wander up behind the lurker in perfect safety, and perhaps scan and kill it. Until the depot is destroyed, all the marines have to do is stay out of the line of fire between the lurker and its target.

The bug is not in targeting. MicroLurkers correctly recognizes that the marines are higher priority targets and issues a command to target them. The bug is that Micro::SmartAttackUnit() does not act on the command. The code is inherited from UAlbertaBot, so probably many UAlbertaBot and Steamhammer forks have the same problem. Here is the inherited code:

// if we have issued a command to this unit already this frame, ignore this one
if (attacker->getLastCommandFrame() >= BWAPI::Broodwar->getFrameCount() || attacker->isAttackFrame())
{
    return;
}

I think the isAttackFrame() test may be a good idea if you are controlling, say, a dragoon. Retargeting a dragoon while it is in the middle of its animation will at best cause extra delay before the dragoon can fire again. But when I looked closely, it turned out that for a lurker attacking a fixed target every frame is an attack frame. Steamhammer drops the command because the lurker is constantly attacking.

Instead, it should accept the slight delay of retargeting lurkers. I rewrote it like this:

// Do nothing if we've already issued a command this frame, or the unit is busy attacking.
// NOTE A lurker attacking a fixed target is ALWAYS on an attack frame.
if (attacker->getLastCommandFrame() >= BWAPI::Broodwar->getFrameCount() ||
    (attacker->isAttackFrame() && attacker->getType() != BWAPI::UnitTypes::Zerg_Lurker))
{
    return;
}

Lurkers behave better, and other unit types are not affected. I see improved lurker micro in test games.

In Starcraft, every unit type behaves differently. UAlbertaBot, and therefore Steamhammer, tries to treat different unit types the same, which is sure to be causing other weaknesses. At some point I will analyze micro thoroughly and make sure that every unit type realizes its potential. For now, I’m happy that lurkers are a little smarter.

Trackbacks

No Trackbacks

Comments

Antiga / Iruian on :

I think you'll get good results with tweaked builds that work vs FFE protoss. The top 3-4 protoss bots have really got it down in the last 3-4 months and it has changed the meta in botworld.

MicroDK on :

Do you have any suggestions for anti FFE builds as Zerg? :)

Jay Scott on :

You can try to get your licks in before protoss has a big force ready. For Steamhammer, I added ling bust and hydra bust to break the cannons, and a slightly specialized 2 hatch muta opening. Each of these can be stopped if protoss is ready, but I think no bot is prepared for all of them. Or you can follow the main line and keep up with the protoss in macro. Iruian recommended 4 hatch before gas and 3 base spire into 5 hatch hydra, which are both in Liquipedia. They are sophisticated openings with a lot of opportunity for adaptation, so bots will do simplified versions....

Antiga / Iruian on :

2 / 3 H hydra busts, 3 H ling all ins, 2 H muta (13P or normal 2h varieties). The longterm anti plan is normally one of two builds: 5 H hydra muta [both hydra and muta first are good] (build on teamliquid or 3rd hatch in other natural which lets you take that main as well into 4 base ling ultra with quick upgrades. All of those choices work, some easier than others.

MicroDK on :

Thanks! I already have a 2H Hydra and 2H Muta in my list of openings, but they are not enabled for ZvP, only vs certain opponents. But I intend to add them and let the newly enabled opening learning do its trick.

McRave on :

It's really tough to get micro perfect without completely breaking it, that's for sure. You should have been around for the discussions we've had in Twitch chat dealing with making Dragoons micro the closest to frame perfect without sticking them! It's simple but quite the headache that each unit behaves slightly differently, even for just getting an attack off properly.

krasi0 on :

And have you guys achieved frame-perfect micro with dragoons (or any other war units for that matter)? Micro has always been one of the weakest aspects of my bot.

McRave on :

I believe it is frame perfect, yes. Though there are other issues with my movement after the shot due to the unit trying to re-do its path multiple times rather than continue the path it was on.

MicroDK on :

Great discovery! I have not noticed it myself.

Arrak on :

By the way, the same bug in the post occurs with sunken colonies, if you ever get around to that.

Jay Scott on :

Thanks, that’s a useful hint! My plan is to add static defense to squads and control it explicitly (except bunkers, which can’t be controlled). Someday it will come to the top of the list.

Iruian / Antiga on :

Arrak's sunken targeting, is extremely good and one of the better changes that his bot has. It is worth the time someday.

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.