HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

All about cast delays.

02-27-2004, 04:10 AM#1
Grater
Cast Delays are something not many people know much about, so I'm here to explain how it all works, and how to make a unit or hero cast a spell instantly. (ie so using triggers it can cast multiple times with no waits).

Art - Animation - Cast Point
Found under Art in the unit editor it has serious effects on how long it takes the unit to cast, basically the unit casts "Cast Point" seconds after the order has been issued. The other parameters, Cast Backswing and Blend Time actually have no effect on how long it takes to cast a spell, because they are "optional" animations that are cancelled when a new order is issued.


(Base) Unit Type
Some units, such as the Sorceress, have a built in cast delay, I don't know how to remove this. The cast delay is attached to the unit type, not the model. Other units, such as the flying sheep, have no cast delay.

Turning delay
Most units need to turn to cast (buildings don't), the delay is simply how long it takes to turn to face the target. This delay can be negated by turning the unit with a trigger action.

Distance to target
For some unit types (especially flying), being very close to the target results in no turning delay. This behiavour is guaranteed for flying sheep, but uncertain for other, larger units.

Spell attributes
Some spells have cast delays built in, these are mostly AoE spells, like Chain Lightning and Impale. In most cases there is nothing that can be done to remove this cast delay, these spells simply cannot be cast instantly. Some abilities have a "Casting Time" parameter which can be changed (but may not do anything).

The Ideal Hidden Caster:
The Flying Sheep makes the best hidden caster in my experience, as it's cast delay is already 0, and it's turn delay is negated by moving the sheep to the target. There is no need to make any changes at all to the flying sheep unit to use it as a hidden caster, that is why I like it.

The Warden works as a hero instant-caster:
Set her Animation - Cast delay to 0.
Turn her to face the target before casting, as moving her to the target doesn't reliably negate the turn delay.

To demonstrate I have attached a very simple map, where I implement a spell that makes a warden send shadowstrikes in all directions, without using waits or hidden casters.
02-27-2004, 05:45 AM#2
Xinlitik
Nice tutorial.

I have one question, though. How about wisps? That's what I always use because they seem to have no built in cast delays etc.
02-27-2004, 06:14 AM#3
Grater
If it works, use it. I do prefer flying units however, in case I want to make a projectile appear to come from a unit - flying units can have their height set to the same as other flying units keeping it all nice and consistent. Ofcourse any unit can be made to fly, but using an unmodified unit saves a minute amount of space.
02-27-2004, 02:40 PM#4
Vexorian
Did you find a way to make attacks work like that?, since even when the attack weapon type is "instant" They are not instant...
02-27-2004, 10:22 PM#5
Grater
It seems units have an absolute top attack rate of 10 times per second.
02-28-2004, 12:44 AM#6
AnarkiNet
i think you can get unit to attack much faster than 10 times per second, by edting the "attack backswing" field in the object editor. im pretty sure that some of my TD's towers attack much faster than 10 times per second (more like 100)
02-28-2004, 04:08 AM#7
Grater
And I think you just fail to comprehend how fast 10 times a second already is. Anyway, heres a little test bed map with a castle, a trigger fires every time the castle takes damage, giving an accurate measurement of the attack delay of any single unit attacking it.

If anyone can get the attack delay for a single unit below 0.1 seconds (on average) then that would be quite impressive. Any means are valid (including model/hex editing).
02-28-2004, 02:33 PM#8
Vexorian
I dunno, probably it is a little lower than 0.1 seconds, but it is still too slow to make a unit to attack 3 targets in the same function process (as you can do with spells)