Help: Right-clicking on enemy sometimes does not issue attac
Posts: 3
Joined: Mon Nov 16, 2009 2:48 am

Help: Right-clicking on enemy sometimes does not issue attac

Postby blueblimp » Mon Nov 16, 2009 3:10 am

EDIT: I realized after posting this that it would be more appropriate to put it in the issue tracker, so I've done that.

Summary: Sometimes when I tell one of my units to right-click on an enemy unit, my unit moves to the enemy unit instead of attacking it. Is this a bug or something I'm doing wrong?


I have attached a simple AI (AttackFailsAI) and a simple map (AITestMap) that reproduce the issue.

AttackFailsAI sets the complete map information flag to true (for simplicity). Each frame, the AI finds a friendly worker and an enemy worker. If there is any enemy worker, the AI orders the friendly worker to right-click on the enemy worker it found.

AITestMap consists of a single probe and an SCV (with health reduced to 5 to make testing faster), along with one trigger, which creates a new SCV when the old one dies.

To reproduce the issue, create a singleplayer UMS game on AITestMap with AttackFailsAI loaded.

Expected Behaviour:

The probe should kill SCVs indefinitely.

Observed Behaviour:

The probe kills 3 SCVs and then stops killing them. Selecting the probe reveals that its "Move" command is highlighted.


On my machine, there is a "big difference" between the values of Unit* for the SCVs the probe fails to attack and the ones the probe successfully attacks. I don't see why the memory address should be related to anything, but it might be worth taking a look at them.

Creating new SCVs after old ones have died is important. I have yet to see an SCV failed to be attacked if is created before any other SCVs have died. It's easy to observe this by just adding a few more SCVs to the AITestMap, and note that they all get killed. I originally found this issue on a normal map vs the default StarCraft AI, where my probes would kill the initially-produced SCVs but would sometimes fail to kill newly-produced SCVs.

Return to “BWAPI (wrappers in other languages / questions and announcements related to BWAPI itself)”

Who is online

Users browsing this forum: No registered users and 1 guest