An overlay is a second graphic that rides on a unit. The first idea is to park another unit on top, and it is wrong for three reasons.
- An EUD map has 1,700 unit slots, half of classic's 3,400. One overlay per unit does not scale.
- A unit dressed as an overlay neither attaches nor animates: you re-position it every frame yourself.
- Several kinds of overlay means spending unit types, of which there are 228.
Cheap overlays make StarCraft itself own the overlay, by borrowing a place where the engine already attaches and plays a graphic. The easiest is the spell overlay: the Defensive Matrix bubble, the green of Ensnare, the glow of Irradiate all come from one byte of status timer.
Usually setting the timer is all it takes, and it costs nothing. The catch is that a timer set on a unit already on screen does not always attach its overlay - and the trick for that is burrow and unburrow. Spell overlays are deleted on burrow and recreated on unburrow from the unit's current state, so setting the timer and then issuing an unburrow redraws it on the spot. The unburrow order has no requirements, so it works whatever the race.
A transform clears any overlay on the unit. If you use both, transform first and attach the overlay second: the other order loses the overlay silently.
TransformThe five pools the engine draws from