archive by month
Skip to content

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())

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.


No Trackbacks


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?


Jay Scott on :

Why not use pull requests? Because it’s not what he preferred. I did mention that.

Jay Scott on :

I think that using vs2015 is not going to work for you unless you also compile BWAPI yourself with the same compiler. You have to link to the .dll, and Microsoft says that everything has to be compiled with the same toolchain to work together. The distributed BWAPI.dll is compiled with vs2013.

krasi0 on :

If you want / need to use VC140 (the VS2015) compiler, you'd have to switch to a client AI (.exe). The transition isn't that hard BTW

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.

Form options

Submitted comments will be subject to moderation before being displayed.