Understanding Infinite Attack Range in StarCraft

March 31, 2012

It should be noted that this is not particularly useful or groundbreaking. The aim is to increase the understanding of this phenomenon so that one day it might be of use to someone. The trick works under very specific circumstances.

Background

Most of units in StarCraft have pre-attack animation sequence that must be played before the actual attack registers. For most of them, they only have one pre-attack sequence.

All subsequent attacks do not require the unit to go through the sequence again. For the Marine, once it holds up its weapon, it does not put it down again. For the Hydralisk, once it opens its mouth, it doesn't have to open it again.

The exception is when the unit has to change targets. If a unit's attack target changes, it must go through its pre-attack sequence again. This phenomenon is most prevalent for the Photon Cannon, whose tower goes up and down constantly as it acquires new targets.

However, there are a few units that goes through its pre-attack sequence every single time it attacks, regardless of whether it has acquired a new target. And one of them is the Sunken Colony.

Mechanism

Due to the fact mentioned about the Sunken Colony and its pre-attack sequence is awfully long, we will use it as a test subject to breaking down the mechanism.

The StarCraft unit attack sequence is possibly as follows.

1) Acquire target in range.

2) Begin pre-attack sequence.

3) Once pre-attack sequence is finished, attack the target.

It all seems fine. Target acquired. Target attacked. Target died.

However, it turns out that this sequence is not so bug-free. Imagine that we could introduce an interrupt between 2 and 3.

1) Acquire target in range.

2) Begin pre-attack sequence.

X) Acquire higher priority target.

3) Once pre-attack sequence is finished, attack the target.

In this case, since there is no check for whether the higher priority target is in range, the unit attacks the higher priority target at step 3, regardless of how far away it is.

Interruption

Suppose that you are A-move at enemy base and then your units were attacking enemy buildings. After that, enemy units came by and started attacking you. The game mechanism is smart enough to recognize that the unit is getting killed, so the unit changes target.

Example

One of the best uses of this trick is to outrange cannon rush. You can build a Sunken Colony outside the range of a Photon Cannon and still be able to kill it.

The Sunken Colony is in range of the left Pylon but not the Photon Cannon. Thus, the Photon Cannon cannot hit the Sunken Colony either.

The Sunken Colony does 1) Acquire target in range. The target is the Pylon.

Then it does 2) Begin pre-attack sequence.

Once the Photon Cannon attacks the Hatchery then the Sunken Colony does X) Acquire higher priority target. The higher priority target is the Photon Cannon.

The Sunken Colony finally does 3) Once pre-attack sequence is finished, attack the target. Because there was no range check, the Sunken Colony ends up attacking the target, the Photon Cannon, even though it's outside range.

Conclusion

This phenomenon is not limited to the Sunken Colony. Any Starcrafts unit can have infinite range (possibly except for the Lurker and the Firebat), because of the existence of the interrupt without range checking. The only reason why the Sunken Colony is special is that it fires its pre-attack sequence every single time it attacks and that the sequence is quite long. The pre-attack sequence is the window in which the interrupt must occur.

Closing Thought

This theory also explains the well-known "Zealot killing two marines in one attack" from a long time ago. Basically, the Zealot do two attacks and has a pre-attack sequence before each "Warp Blade" strikes, which is one frame long. What happened was that the first blade killed the first marine, and during the pre-attack sequence for the second blade, the second marine attacked it, causing the Zealot to change target without checking range, and thereby killing the second marine, with the second blade.