Ice_Phoenix
12-29-2009, 02:14 PM
Introduction:
Like DotA's Yunero the Juggernaut, HoN's Swiftblade can perform a number of regular attacks during his ultimate, referred to as extra attacks. These attacks operate like any other regular attack: Attack and Exclusive modifiers are applied to the target, Swiftblade can critical strike the target, and Runed Axe splashes damage to nearby units.
The number of these regular attacks performed depend on the attack speed of Swiftblade. The higher his attack speed, the more extra attacks Swiftblade performs. The mechanics of Swift Slashes operates differently than Juggernaut's Omnislash (each Swift Slash not interrupting regular attacks, 20fps server limit, etc.), so the Omnislash (http://zelks.com/dondump/JuggOmnislashExtra.gif) table is not the correct graph to reference when determining the number of extra attacks performed.
Note that if you issue other commands during Swift Slashes (move, stop, attack, etc.), it will negatively affect the number of Swift Slashes performed. This formula and graph assumes you don't issue any other commands while Swift Slashing.
So without further ado,
The Formula:
Where:
AS = Attack Speed (starts at 100, boosted by agility and attack speed items)
X = the number of Swift Slashes, determined by level of the skill and whether or not Staff of the Master is held
Excel formula: =ROUNDDOWN(((X*0.4)-(ROUNDUP((ROUNDUP((1.7/(AS*0.01))/5, 2)*5*0.33/1.7)/5, 2)*5))/(ROUNDUP((1.7/(AS*0.01))/5, 2)*5)+1, 0)
or:
http://img689.imageshack.us/img689/7438/swiftslashesformula.jpg
, where "RU" is the Roundup Function to the nearest 0.05 value and "RD" is the Rounddown Function to the nearest 0.05 value.
Determining Attack Speed:
To find Swiftblade's (or any unit's) current attack speed, hover the cursor over here:
http://img513.imageshack.us/img513/9265/mouseover.png
And look here:
http://img707.imageshack.us/img707/9799/lookhere.png
Graphs:
Because when asked, 98.7% of the population choose line graphs over algebra.
http://img710.imageshack.us/img710/8093/swiftslashesextraattack.png
Explanation:
So I realize that simply posting the formula isn't going to be enough for my fellow HoN mechanics nerds, so here's step by step of how the formula works. The example I will be using is a level 25 Swiftblade with a 265 attack speed and his Swift Slashes maxed with Staff of the Master, granting him 10 slashes total.
Because each Swift Slash does not interrupt Swiftblade's normal attacks (extra attacks), the general idea of what I'm doing is calculating how many extra attacks can be performed during the entire duration of Swift Slashes.
Step 1: We'll start by getting the duration of Swift Slashes. resources\heroes\hiro\ability_hiro4.entity sets the duration of the first slash 400ms (0.4 seconds), and the same for each subsequent slash found in resources\heroes\hiro\affector_ability4.entity. We can therefore calculate the Swift Slashes duration in seconds as follows:
Where X = number of slashes performed,
Swift Slashes Duration = X*0.4
Example: 10*0.4 = 4 seconds Swift Slashes duration
Step 2: Next we need to get Swiftblade's attack cooldown. I started by using the in-game displayed attack cooldown, but it just wasn't adding up with the other numbers. I found out that the in-game cooldown calculator does some goofy rounding, and as such, I needed to calculate the attack cooldown myself using Swiftblade's attack speed and his base attack time (attackcooldown in the resources file). Here's the formula:
Adjusted Attack Cooldown = base attackcooldown/(attack speed*0.01)
Adjusted Attack Cooldown = 1.7/(AS*0.01)
Example: 1.7/(265*0.01) = 0.641509434 adjusted attack cooldown
We've still got one more step here. Because HoN operates at a 20fps server framerate, this cooldown is rounded up to the closest 0.05s.
Example: 1.7/(265*0.01) = 0.641509434, rounded up to 0.65
Step 3: Now the attack cooldown we just calculated is the complete time it takes to perform an entire attack, including animation backswing. However, the final attack doesn't need to complete the animation backswing; Swiftblade just needs to reach the damage point (referred to in HoN as attackactiontime). From the resources\heroes\hiro\hiro.entity file, we know that his base attackactiontime is 330. We can use his base attackactiontime in conjunction with his base attackcooldown and adjusted attack cooldown we just calculated in order to find his adjusted attackactiontime.
Adjusted attackactiontime = adjusted attackcooldown*base attackactionpoint/base attackcooldown
Adjusted attackactiontime = adjusted attackcooldown*0.33/1.7
Example: 0.65*0.33/1.7 = 0.126176470 adjusted attackactiontime
Again, we need to round this to the next 0.05 in order to comply with the framerate.
Example: 0.65*0.33/1.7 = 0.126176470, rounded up to 0.15
Step 4: Okay, we've got everything we need! Now for plugging them into the equation. We start by subtracting our adjusted attackactiontime from the total Swift Slashes duration, and adding 1 to our extra attack count for that. Even though that shortened duration applies to the last slash, we'll take it out at the beginning because it allows us to determine the number of full attacks that will fit in the rest of the duration.
Adjusted duration = Swift Slashes duration - adjusted attackactiontime
Example: 4 - 0.15 = 3.85 adjusted duration
Step 5: Now to see how many full attacks will fit in that adjusted duration. We round down because anything that's not a full attack at this point will not be performed.
Full extra attacks = (adjusted duration/adjusted attackcooldown) rounded down
Example: 3.85 / 0.65 = 5.923076923076923, rounded down to 5 full extra attacks.
Step 6: We then add the final attack, which we subtracted to get the adjusted duration, and that gives us the total number of extra attacks.
Total number of extra attacks = full extra attacks + final partial attack
Example: 5 + 1 = 6 total extra attacks on a Swiftblade with 265 attack speed and 10 total attacks.
6 extra attacks, which after counting the slashes in slow motion, is correct!!
Verification:
I initially didn't take into account the fact that the game rounds each attack to the nearest 0.05 seconds, as Malle pointed out. I also was manually counting wrong, as Swiftblade will "drift" away from his target after the last slash and can perform extra attacks then, but not be in the effect of Swift Slashes. I found the easiest way to count extra attacks was at 10% game speed and with a Nullfire blade, as the mana burned appears on extra attacks but not the regular Swift Slashes.
If anyone runs into any more inconsistencies, please let me know!
Changelog:
01-13-2009, 8:52 PM - Fixed graph error and reattached Excel spreadsheet.
01-13-2009, 7:30 PM - Corrected formula to comply with HoN's rounding attacks to the next frame. Updated graph and explanation accordingly. Removed incorrect information. Updated attached Excel spreadsheet.
01-02-2009, 1:47 PM - Updated line graphs with more accurate data, calculating on every 1 attack speed instead of every 10. Linked to a large version of the graph for more accurate representation of extra attacks. Added zipped .xls spreadsheet of data to Thread Attachments.
12-29-2009, 8:09 PM - Added ElementUser's LaTeX-ed formula and simplified equation
12-29-2009, 01:14 PM - Initial post
Where to from here?
If there's anything else can be added to the article, feel free to make suggestions.
Happy Slashing!
Like DotA's Yunero the Juggernaut, HoN's Swiftblade can perform a number of regular attacks during his ultimate, referred to as extra attacks. These attacks operate like any other regular attack: Attack and Exclusive modifiers are applied to the target, Swiftblade can critical strike the target, and Runed Axe splashes damage to nearby units.
The number of these regular attacks performed depend on the attack speed of Swiftblade. The higher his attack speed, the more extra attacks Swiftblade performs. The mechanics of Swift Slashes operates differently than Juggernaut's Omnislash (each Swift Slash not interrupting regular attacks, 20fps server limit, etc.), so the Omnislash (http://zelks.com/dondump/JuggOmnislashExtra.gif) table is not the correct graph to reference when determining the number of extra attacks performed.
Note that if you issue other commands during Swift Slashes (move, stop, attack, etc.), it will negatively affect the number of Swift Slashes performed. This formula and graph assumes you don't issue any other commands while Swift Slashing.
So without further ado,
The Formula:
Where:
AS = Attack Speed (starts at 100, boosted by agility and attack speed items)
X = the number of Swift Slashes, determined by level of the skill and whether or not Staff of the Master is held
Excel formula: =ROUNDDOWN(((X*0.4)-(ROUNDUP((ROUNDUP((1.7/(AS*0.01))/5, 2)*5*0.33/1.7)/5, 2)*5))/(ROUNDUP((1.7/(AS*0.01))/5, 2)*5)+1, 0)
or:
http://img689.imageshack.us/img689/7438/swiftslashesformula.jpg
, where "RU" is the Roundup Function to the nearest 0.05 value and "RD" is the Rounddown Function to the nearest 0.05 value.
Determining Attack Speed:
To find Swiftblade's (or any unit's) current attack speed, hover the cursor over here:
http://img513.imageshack.us/img513/9265/mouseover.png
And look here:
http://img707.imageshack.us/img707/9799/lookhere.png
Graphs:
Because when asked, 98.7% of the population choose line graphs over algebra.
http://img710.imageshack.us/img710/8093/swiftslashesextraattack.png
Explanation:
So I realize that simply posting the formula isn't going to be enough for my fellow HoN mechanics nerds, so here's step by step of how the formula works. The example I will be using is a level 25 Swiftblade with a 265 attack speed and his Swift Slashes maxed with Staff of the Master, granting him 10 slashes total.
Because each Swift Slash does not interrupt Swiftblade's normal attacks (extra attacks), the general idea of what I'm doing is calculating how many extra attacks can be performed during the entire duration of Swift Slashes.
Step 1: We'll start by getting the duration of Swift Slashes. resources\heroes\hiro\ability_hiro4.entity sets the duration of the first slash 400ms (0.4 seconds), and the same for each subsequent slash found in resources\heroes\hiro\affector_ability4.entity. We can therefore calculate the Swift Slashes duration in seconds as follows:
Where X = number of slashes performed,
Swift Slashes Duration = X*0.4
Example: 10*0.4 = 4 seconds Swift Slashes duration
Step 2: Next we need to get Swiftblade's attack cooldown. I started by using the in-game displayed attack cooldown, but it just wasn't adding up with the other numbers. I found out that the in-game cooldown calculator does some goofy rounding, and as such, I needed to calculate the attack cooldown myself using Swiftblade's attack speed and his base attack time (attackcooldown in the resources file). Here's the formula:
Adjusted Attack Cooldown = base attackcooldown/(attack speed*0.01)
Adjusted Attack Cooldown = 1.7/(AS*0.01)
Example: 1.7/(265*0.01) = 0.641509434 adjusted attack cooldown
We've still got one more step here. Because HoN operates at a 20fps server framerate, this cooldown is rounded up to the closest 0.05s.
Example: 1.7/(265*0.01) = 0.641509434, rounded up to 0.65
Step 3: Now the attack cooldown we just calculated is the complete time it takes to perform an entire attack, including animation backswing. However, the final attack doesn't need to complete the animation backswing; Swiftblade just needs to reach the damage point (referred to in HoN as attackactiontime). From the resources\heroes\hiro\hiro.entity file, we know that his base attackactiontime is 330. We can use his base attackactiontime in conjunction with his base attackcooldown and adjusted attack cooldown we just calculated in order to find his adjusted attackactiontime.
Adjusted attackactiontime = adjusted attackcooldown*base attackactionpoint/base attackcooldown
Adjusted attackactiontime = adjusted attackcooldown*0.33/1.7
Example: 0.65*0.33/1.7 = 0.126176470 adjusted attackactiontime
Again, we need to round this to the next 0.05 in order to comply with the framerate.
Example: 0.65*0.33/1.7 = 0.126176470, rounded up to 0.15
Step 4: Okay, we've got everything we need! Now for plugging them into the equation. We start by subtracting our adjusted attackactiontime from the total Swift Slashes duration, and adding 1 to our extra attack count for that. Even though that shortened duration applies to the last slash, we'll take it out at the beginning because it allows us to determine the number of full attacks that will fit in the rest of the duration.
Adjusted duration = Swift Slashes duration - adjusted attackactiontime
Example: 4 - 0.15 = 3.85 adjusted duration
Step 5: Now to see how many full attacks will fit in that adjusted duration. We round down because anything that's not a full attack at this point will not be performed.
Full extra attacks = (adjusted duration/adjusted attackcooldown) rounded down
Example: 3.85 / 0.65 = 5.923076923076923, rounded down to 5 full extra attacks.
Step 6: We then add the final attack, which we subtracted to get the adjusted duration, and that gives us the total number of extra attacks.
Total number of extra attacks = full extra attacks + final partial attack
Example: 5 + 1 = 6 total extra attacks on a Swiftblade with 265 attack speed and 10 total attacks.
6 extra attacks, which after counting the slashes in slow motion, is correct!!
Verification:
I initially didn't take into account the fact that the game rounds each attack to the nearest 0.05 seconds, as Malle pointed out. I also was manually counting wrong, as Swiftblade will "drift" away from his target after the last slash and can perform extra attacks then, but not be in the effect of Swift Slashes. I found the easiest way to count extra attacks was at 10% game speed and with a Nullfire blade, as the mana burned appears on extra attacks but not the regular Swift Slashes.
If anyone runs into any more inconsistencies, please let me know!
Changelog:
01-13-2009, 8:52 PM - Fixed graph error and reattached Excel spreadsheet.
01-13-2009, 7:30 PM - Corrected formula to comply with HoN's rounding attacks to the next frame. Updated graph and explanation accordingly. Removed incorrect information. Updated attached Excel spreadsheet.
01-02-2009, 1:47 PM - Updated line graphs with more accurate data, calculating on every 1 attack speed instead of every 10. Linked to a large version of the graph for more accurate representation of extra attacks. Added zipped .xls spreadsheet of data to Thread Attachments.
12-29-2009, 8:09 PM - Added ElementUser's LaTeX-ed formula and simplified equation
12-29-2009, 01:14 PM - Initial post
Where to from here?
If there's anything else can be added to the article, feel free to make suggestions.
Happy Slashing!