archive by month
Skip to content

cancellation and destruction

If you cancel a unit, or cancel research for tech or for an upgrade, you get back its full cost in minerals and gas. Some bots know how to cancel a zerg egg if it is about to die, to save the cost. For example, Steamhammer cancels eggs, lurker eggs, and guardian/devourer cocoons that are very low on hit points (not the ideal criterion, but it helps).

If you cancel a building that is under construction, you get back 75% of the original cost in gas and minerals, rounded down to the nearest integer. Buildings tend to be expensive, so many bots cancel buildings that are about to be destroyed. If a terran SCV is killed while constructing a building, the player should either dispatch another SCV to finish the building, or cancel the building, depending on the situation; it’s not an easy decision. If the building is destroyed before it is completed, which is easier because it doesn’t have all its hit points yet, you lose the full value.

But these are not all the cases!

If a building is carrying out research when it is destroyed, the research is cancelled by force majeure. You get back 75% of the research cost, again rounded down. Do any bots cancel research when a tech building is about to be destroyed? Steamhammer does not (yet). You save 25% of the research cost, which is not much, and you accept a risk that the building might survive (maybe the enemy will stop shooting it), and you’ll have canceled for nothing.

If a building is producing units when it is destroyed, you are refunded the full cost of the units. It’s the same whether the unit is actually in production, or is queued behind other units for later. There is still a theoretical advantage to canceling pending units that will not be produced, though. It returns the resources sooner (minerals, gas, and supply), which might be valuable if you are resource constrained and can use the resources another way.

The refund for pending units of a destroyed building is an advantage for terran and protoss (though not a big one). Zerg has to worry about canceling eggs and cocoons, and must accept the risk of canceling incorrectly versus losing the unit for nothing.

Trackbacks

No Trackbacks

Comments

Dan on :

PW's cancel logic, if it's of any help to folks: https://github.com/dgant/PurpleWave/blob/master/src/Micro/Actions/Basic/Cancel.scala#L11

In short, predicts if cancelling would return value, if this is the last frame to issue commands to a unit before it'd die, and if we're not relying on this unit for a fight (eg. Cannons vs. a 4-Pool). framesToLive is the time prediction -- that's the unit's total health divided by the total damage-per-frame-against-this-unit of enemies in range of it.

Jay Scott on :

Predicting the frames to live is the key step, if you ask me. It’s valuable for combat purposes too.

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.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.