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.
Comments
Antiga / Iruian on :
MicroDK on :
Jay Scott on :
Antiga / Iruian on :
MicroDK on :
McRave on :
krasi0 on :
McRave on :
MicroDK on :
Arrak on :
Jay Scott on :
Iruian / Antiga on :