UAlbertaBot fixes #9 and #10
And these are the last of the batch.
#9 tracking mineral patches—or not
WorkerData
has two maps of worker unit -> mineral patch.
std::map<BWAPI::Unit, enum WorkerJob> workerJobMap; std::map<BWAPI::Unit, BWAPI::Unit> workerMineralMap; std::map<BWAPI::Unit, BWAPI::Unit> workerDepotMap; std::map<BWAPI::Unit, BWAPI::Unit> workerRefineryMap; std::map<BWAPI::Unit, BWAPI::Unit> workerRepairMap; std::map<BWAPI::Unit, WorkerMoveData> workerMoveMap; std::map<BWAPI::Unit, BWAPI::UnitType> workerBuildingTypeMap; std::map<BWAPI::Unit, int> depotWorkerCount; std::map<BWAPI::Unit, int> refineryWorkerCount; std::map<BWAPI::Unit, int> workersOnMineralPatch; std::map<BWAPI::Unit, BWAPI::Unit> workerMineralAssignment;
They are workerMineralMap
and workerMineralAssignment
. workerMineralAssignment
is the “real” one that is updated. workerMineralMap
is not updated and is referred to only in WorkerData::getWorkerResource()
, which in UAlbertaBot happens to be called only to get the refinery and never the mineral patch.
I deleted workerMineralMap
and replaced its 2 occurrences with workerMineralAssignment
. The bug has no practical effect without other code changes, but it was lying in wait.
#10 no overlords in combat
This one is not mine--AIL reported it in a blog comment. If a zerg bot includes overlords in a combat squad as detectors (which you have to write code to do), then the bot does not pass the overlords in to SparCraft and ends up fleeing from dark templar without trying to fight because there is “no detection”.
I rewrote InformationManager::isCombatUnit()
like this. The original has a redundant check to exclude lurkers and doesn’t include overlords.
bool InformationManager::isCombatUnit(BWAPI::UnitType type) const { return type.canAttack() || type == BWAPI::UnitTypes::Terran_Medic || type == BWAPI::UnitTypes::Terran_Bunker || type == BWAPI::UnitTypes::Protoss_Observer || type == BWAPI::UnitTypes::Zerg_Overlord; }
Thanks, AIL!
Comments
Ail on :
Like I periodically call rebalanceMineralWorkers to see if it maybe should go to an expo but despite saying to only consider mineral-workers it often happens that a gas worker gets reassigned to mining and loses the gas it is carrying.
One thing I tried yesterday unfortunately reduced the performance of my Bot. I wanted it to dynamically calculate scores for units to build based on enemy unit composition and remaining cost to tech to them. While it worked as intended, the effect just wasn't very good. Manually picked pro-active choices just seemed better. So not sure how much of that I am going to keep.
Another thing I did was making it save minerals and larvae when the spire was on it's way. This resolved one of the remaining weaknesses in ZvZ. My Bot looks as if it could beat almost all other Z bots with relative ease now. That mu is really well suited for different highly aggressive openings.
It's ZvP and ZvT is still very lackluster.
Jay Scott on :
Jay Scott on :