HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit attack speed formula

12-06-2004, 10:16 PM#1
th15
Does anyone know the exact attack speed formula that the game uses to detect the bonus provided by items that add attack speed?

I just did a little test on my own with a unit with 1.750 cooldown. Without an item it attacked at exactly 1.75 cooldown (edited the hero to have 0 starting agil).

With a +75% AS item, it attacks at 1.0 cooldown. That is 57.14% of the original 1.75s. It appears to be that the gloves of haste tooltip is erroneous. That item (and it's associated skill) provides a flat absolute value deduction to a unit's attack speed. Spells like endurance aura would increase attack speed by a %.

Has anyone else encountered a similar oddity? Does anyone know of an item ability that inreases attack speed by a % (aside from endurance aura).
12-07-2004, 03:00 AM#2
BBDino
Are you certian of your method? How do gloves of haste interact with a unit with say, 0.5 cooldown?
12-07-2004, 06:03 AM#3
Ant
I don't think it does a flat deduction, otherwise buying multiple gloves of haste on a fast attacking hero would allow it to get up to 0 attack speed with bloodlust and whatnot.

Anyway I did some tests on a hero with a cooldown of 1 second, no agil.

No items equipped, time between attacks - 1.00s
With 100% IAS item equipped - 0.500s
With 2 100% IAS items equipped - 0.333s
With 3 100% IAS items equipped - 0.250s

With 1 15% IAS item equipped - 0.870s
With 2 15% IAS items equipped - 0.769s
With 3 15% IAS items equipped - 0.690s
With 4 15% IAS items equipped - 0.625s
With 5 15% IAS items equipped - 0.571s
With 6 15% IAS items equipped - 0.526s

I tested around and contrary to what the results suggest, the number of items don't matter, only the total IAS.

You realise however, that each item equipped gives diminishing returns.

More significantly, 100% IAS gives makes the attack speed 50%. 200% IAS makes attack speed 33%. That means that when the attack speed is 200% of the base attack speed, the time taken is halved. 300%, the time taken is one third.

My theory behind attack speed (just found this out while testing) is that

Attack speed (Percentage) x Attack speed (Base) = The same all the time.

So by increasing the attack speed by 15%, you're modifying the speed so that 115% x speed = 100%.

This would explain why your IAS item provides a flat increase. It seems to be just a coincedence.

At the start: 100% x 1.75 = 1.75
At the end: 175% x 1.00 = 1.75

The end product is the same, but by increasing the % attack speed, you make the time between attacks like that.

I hope I'm quite clear. I haven't proven this and I'm not sure if there's any other thread about this but I just found this out to test out what you tested.
12-07-2004, 07:18 AM#4
BBDino
Good to see someone cleared that up, i though th15's data seemed suspect.
12-07-2004, 09:02 AM#5
th15
Okay, I did a second round of tests and my data is the same as yours. Thanks Ant.

The thing is, I still can't figure out the exact formula. I'm doing some pretty delicate unit balancing and I really need a solid formula. I tried reducing your formula to algebraic form but that keeps going nowhere...
12-07-2004, 11:54 AM#6
Anitarf
What do you mean, keeps going nowhere?
I't simple, actual attack cooldown is equal to default cooldown divided with (1 + attack-spped-bonus). so, if a unit attacks every 2 seconds, and gets a 50% attack speed bonus, it will now attack every 2/(1+0.5) seconds.
You can get the ammount of attacks per second by dividing 1 with the cooldown.
You can get damage per second by dividing attack damage with cooldown.
So the actual damage per second is equal to ((default damage*(1 + percent-damage-bonus))+damage bonus)*(1+percent-attack-speed-bonus)/(default cooldown)
12-07-2004, 01:15 PM#7
th15
Ah that's the formula. Sorry, haven't had a math class in 3 years (currently studying a video/journalism course). Thanks :)