UAlbertaBot fixes #1 and #2
I heard news from Dave Churchill about UAlbertaBot.
1. He has been working on SparCraft. He has changes that are not yet pushed to github.
2. He is willing to take my bug fixes and may merge them into UAlbertaBot as he has time (which I take to mean don’t hold your breath, he’s busy). He prefers bug writeups to pull requests, so I guess the code changes to UAlbertaBot are extensive.
I’ve already written up 2 bug fixes and sent them off. I’ll also post them here, because if you’re actively working on a UAlbertaBot fork then you don’t want to wait.
If you have your own bug fixes to UAlbertaBot, one way to get them into the pipeline is to send them to me. If you want to do it that way, post a comment here or e-mail me, and be sure to include enough details. I will post them for the community and send them on to Dave Churchill as appropriate, with credit to you, of course.
#1 null pointer bug
From CombatCommander::updateScoutDefenseSquad()
:
// get the region that our base is located in BWTA::Region * myRegion = BWTA::getRegion(BWAPI::Broodwar->self()->getStartLocation()); if (!myRegion && myRegion->getCenter().isValid()) { return; }
Oops, if the pointer is null it goes down on its face. It’s a simple slip. I haven’t found a map that tickles this bug, and as far as I know the pointer might never be null (if so, the whole check can be dropped). But in the spirit of defensive programming I changed the if condition:
if (!myRegion || !myRegion->getCenter().isValid())
#2 building zerg static defense
From ProductionManager::create(BWAPI::Unit producer, BuildOrderItem & item)
:
if (t.isUnit() && t.getUnitType().isBuilding() && t.getUnitType() != BWAPI::UnitTypes::Zerg_Lair && t.getUnitType() != BWAPI::UnitTypes::Zerg_Hive && t.getUnitType() != BWAPI::UnitTypes::Zerg_Greater_Spire && !t.getUnitType().isAddon()) { ...
This omits 2 morphed unit types. The error prevents a zerg bot from morphing any static defense.
&& t.getUnitType() != BWAPI::UnitTypes::Zerg_Sunken_Colony && t.getUnitType() != BWAPI::UnitTypes::Zerg_Spore_Colony
By the way, there is a similar omission in BOSS. From ActionTypeData::ActionTypeData(BWAPI::UnitType t, const ActionID id)
:
if (t == BWAPI::UnitTypes::Zerg_Lair || t == BWAPI::UnitTypes::Zerg_Hive || t == BWAPI::UnitTypes::Zerg_Greater_Spire || t == BWAPI::UnitTypes::Zerg_Lurker || t == BWAPI::UnitTypes::Zerg_Guardian || t == BWAPI::UnitTypes::Zerg_Sunken_Colony || t == BWAPI::UnitTypes::Zerg_Spore_Colony) { morphed = true; }
It omits Zerg_Devourer
. I haven’t tried to make a devourer via a BOSS production plan, so I don’t know what effects it has to leave them out. But it sure looks like a bug.
Tomorrow: The double overlord bug.
Comments
Nick on :
I have a number of changes after I tried to compile UAlbertaBot under VS2015, and there are number of warnings. After I made some, I started to think if anyone had the similar changes already. So I wonder where is the most recent version of the bot code?
>>>
PS: Also why not to use just ordinary PRs in Dave's github?
Thanks.
Jay Scott on :
Jay Scott on :
krasi0 on :