PDA

View Full Version : Calculating Swift Slashes Extra Attacks



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!

metroid112
12-29-2009, 02:25 PM
OMG i couldnt read it all but i see you got work on it

Zann
12-29-2009, 02:29 PM
Isnt Swift Disarmed while using the skill?

Cyra
12-29-2009, 02:31 PM
Isnt Swift Disarmed while using the skill?
Nope.

InYourFace4
12-29-2009, 02:49 PM
Isnt Swift Disarmed while using the skill?
he`s slashing with his sword . what do you think ? he`s disarmed ?

Marko
12-29-2009, 02:50 PM
Wow looks GREAT, I was just reading a thread somewhere asking for exactly this- very nicely laid out; love the colours :D (obviously I havn't tried to understand the mechanics behind it, but this is SURE to earn you a puzzlebox award, GJ!)

rickster
12-29-2009, 03:53 PM
A link to a guide on how to calculate attack speed would be nice. That way you could figure out at level 6 and 11+ how to maximize your ult effectiveness. Though it looks like you won't be able to afford the needed items at those stages to jump from 2 to 3 or 3 to 4.

It's also debatable whether SotM is a good item on swiftblade. Maybe compare shieldbreaker's damage to SotM's.

Ice_Phoenix
12-29-2009, 04:11 PM
A link to a guide on how to calculate attack speed would be nice.
Added a couple pictures that should clear things up.

ElementUser
12-29-2009, 07:15 PM
I'll convert those math formulas to an image so it's a lot easier to read :)

EDIT: Here it is, after lots of simplifying with algebra. Too many brackets originally :(.

I tested it with Ice_Phoenix's test case and it came out to the exact same number.

http://img407.imageshack.us/img407/7438/swiftslashesformula.jpg

Also, moved to Guides & Lists.

Ice_Phoenix
12-29-2009, 08:51 PM
http://img407.imageshack.us/img407/7438/swiftslashesformula.jpg

Spot on...thanks Element!

DonTomaso
01-02-2010, 11:19 AM
Nice, but some inconsistencies exist in the graph colors.

In the first graph (the one without SotM) the colors for level 1/2/3 are blue/red/green. In the second graph (the one with SotM) however the colors for level 1/2/3 are the opposite, green/red/blue.

:)

Ice_Phoenix
01-02-2010, 02:52 PM
Hehe, didn't think anyone would notice; had to do with Excel's automatic themes and how I selected the data from the spreadsheet.

Changelog:
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 (http://img136.imageshack.us/img136/4061/swiftslashesdetailed.png) for more accurate representation of extra attacks. Added zipped .xls spreadsheet of data to Thread Attachments.

Malle1
01-03-2010, 10:13 AM
Good work, but when you discarded the rounding the engine you added an error, which can be confirmed at, for instance, 480 attack speed. At that point, your model says 12 attacks, but the result is actually 10 attacks. (I did this test by modding the game files to print out every extra attack in console)

The game runs (by default, anyway) at 20 frames per second (in other words, intervals of .05 seconds) and everything, even attacks, can only be executed during a given frame. Thus, attack speed doesn't produce a continuous decrease in the time per attack but rather a discrete one (where the time per attack and time to action is rounded up to the closest integer amount of frames). See this thread (http://forums.heroesofnewerth.com/showthread.php?t=26983) for more information.

If you take the discrete nature of frames into account, everything seems to fit well and you get the following graphs:

http://hon.mikaelsunde.se/mechanics-swiftslashes-extraattacks-normal.png
http://hon.mikaelsunde.se/mechanics-swiftslashes-extraattacks-withstaff.png

I also tested with this how the action time was rounded and can confirm that it is calculated from the unrounded time per attack and not the rounded one. The effect wouldv'e been really small, differing only one attack on a small amount of the simulated attack speeds from 0 to 500, but this is the way it should be to be closer to the continuous case.

Ice_Phoenix
01-03-2010, 11:23 AM
Very interesting...I wasn't aware of the limitation the framerate posed on the case, or that by performing test cases at an altered host_timescale I was skewing results.

I'll get to work on fixing the title post.

Malle1
01-03-2010, 12:18 PM
I may have been a bit ambiguous: host_timescale shouldn't affect the result, but specifically changing the server frame rate only (I don't remember the command by heart) could possibly affect it, depending on how it is coded.

host_timescale shouldn't affect it since it can be seen as simply generating the frames at a slower rate, but each frame still does the exact same things as it would otherwise, which leads to the game running slower than normal.

Ice_Phoenix
01-13-2010, 08:38 PM
Changelog:
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.

Thanks Malle for pointing out my lack of rounding-compliance. ElementUser, I'd update the post if you'd like to simplify it again, but don't feel obligated to by any means. I should do it myself, but you spoiled me. <3

ElementUser
01-13-2010, 08:51 PM
Those roundup/rounddown functions confuse me :(.

The formula won't be as pretty with the "round to nearest 0.05 seconds" and roundups&downs

Ice_Phoenix
01-13-2010, 09:01 PM
In order to round up to the nearest 0.05 in excel, I had to use this work-around:

ROUNDUP((number I want rounded)/5, 2)*5

It takes the number I want rounded, divides it by 5, rounds up to the second digit after the decimal place, and multiplies it by 5. MROUND rounds to a multiple, but it rounds to the closest, not just rounding up like I need. If you can find a better way of doing it, let me know. :P

Example:
ROUNDUP((0.111)/5, 2)*5
=ROUNDUP(0.0222, 2)*5
=0.03*5
=0.15

ElementUser
01-13-2010, 09:03 PM
I'm an Excel newbie so you'll have to find someone else ^^

Jager
01-13-2010, 09:23 PM
Swift Slashes without SotM has 8 slashes on level 3, not 7. And with Sotm level 2 only has 7 slashes. So idk if they're just typos or the graphs don't match his skills.

Ice_Phoenix
01-13-2010, 09:41 PM
Swift Slashes without SotM has 8 slashes on level 3, not 7. And with Sotm level 2 only has 7 slashes. So idk if they're just typos or the graphs don't match his skills.
Gah, fail on my part. I grabbed the wrong columns. Fixing right now...

Edit: Fixed, thanks Jager.

Jager
01-14-2010, 09:45 PM
Gah, fail on my part. I grabbed the wrong columns. Fixing right now...

Edit: Fixed, thanks Jager.
Np. Thank you for making a graph so others players can easily find the extra slash values. :)

Johnson
01-26-2010, 02:57 PM
This is my favorite thread on the forums. Thank you so much for clearly explaining what you did and presenting your results so neatly.

MahdSkillz
02-21-2010, 04:17 PM
Is Swiftblade still getting normal attacks in between slashes?
Just got flamed to death in a game for saying that he should make his steamboots agi before using ultimate...
He said "read the tooltip .." etc.
Greetz

ElementUser
02-21-2010, 04:21 PM
Is Swiftblade still getting normal attacks in between slashes?
Just got flamed to death in a game for saying that he should make his steamboots agi before using ultimate...
He said "read the tooltip .." etc.
Greetz

Of course he does

Os
03-12-2010, 06:40 AM
This thread is blessed.

TenSun
03-12-2010, 06:54 AM
But you don't have to order any of the normal slashes/auto attacks during the ult do you? It's just click - ult - have enough attack speed and hope for the best?

ElementUser
03-12-2010, 07:18 AM
You don't have to do anything because the attack command is issued in the code:


<order command="attack"/>

ChikenMcTest
03-12-2010, 03:02 PM
This is so helpful thank you very much Ice!

Yoda``
03-14-2010, 01:05 AM
Interesting. If only you could also compare dmg vs as @ -10, 0, 10, 20, 30 armor that would be awesome.

Monkeyninja
03-14-2010, 01:18 AM
If you used Mom before ulting would it stay on and give you a few extra attacks or would it get dispelled? Same question, but if you used it mid ulti( i think you can use items mid ulti right?)

ElementUser
03-14-2010, 09:33 AM
Interesting. If only you could also compare dmg vs as @ -10, 0, 10, 20, 30 armor that would be awesome.

You can calculate that yourself, it's not that hard.

Just use the armor damage reduction formula in the Mechanics FAQ sticky and then multiply your damage by that, then multiply by the # of extra attacks to find out damage from normal attacks in-between Swift Slashes. If you want the true total damage, then simply add on the # of Scripted Swift Slashes * Damage of each Individual Slash * Damage Reduction.

In other words:

Total Damage from Swift Slashes and Extra Attacks =

Physical_Damage_Reduction [(Damage*#_Extra_Attacks) + (#_Scripted_Slashes*Damage_Per_Scripted_Slash)]

Shinta
03-14-2010, 09:53 AM
If you used Mom before ulting would it stay on and give you a few extra attacks or would it get dispelled? Same question, but if you used it mid ulti( i think you can use items mid ulti right?)

Sorry, but you'll have to ask your dad.

ElementUser
03-14-2010, 09:56 AM
Sorry, but you'll have to ask your dad.

Wow...

Anyway, yes it will add to your attackspeed and therefore add more slashes. MoM = Elder Parasite for non-DotA players

ChikenMcTest
03-16-2010, 01:03 PM
What about late game when Swiftblade's regular physical attack would do more than 150-250 damage. Does his regular physical damage override the swiftslash scripted damage?

ElementUser
03-16-2010, 05:22 PM
What about late game when Swiftblade's regular physical attack would do more than 150-250 damage. Does his regular physical damage override the swiftslash scripted damage?

Of course not, the Scripted Slashes will always be there. There is no over-riding of any sort

ElementUser
03-20-2010, 10:12 AM
Long overdue because there's no "nice" way to express Roundup & Rounddown functions. I simplified the 1.7/(0.01*AS) to 170/AS to get:

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.

J61
04-03-2010, 04:09 AM
I love your videos on Youtube and also your wonderful guides dude!
I didn't have the chance to read them but in just a glance it looks nice !:)

FlyingFury
04-03-2010, 04:35 AM
You can calculate that yourself, it's not that hard.

Just use the armor damage reduction formula in the Mechanics FAQ sticky and then multiply your damage by that, then multiply by the # of extra attacks to find out damage from normal attacks in-between Swift Slashes. If you want the true total damage, then simply add on the # of Scripted Swift Slashes * Damage of each Individual Slash * Damage Reduction.

In other words:

Total Damage from Swift Slashes and Extra Attacks =

Physical_Damage_Reduction [(Damage*#_Extra_Attacks) + (#_Scripted_Slashes*Damage_Per_Scripted_Slash)]


im sorry but isnt swift blade invulnarable when slashing? so mom would dispell when you ult.... unless they changed that cause ive done it with DD rune and it went away

ElementUser
04-03-2010, 09:03 AM
im sorry but isnt swift blade invulnarable when slashing? so mom would dispell when you ult.... unless they changed that cause ive done it with DD rune and it went away

No, Swift Slashes doesn't have a StatusDebuff or a StatusBuff line in the code, thus it won't dispel any states when you use it.

Also, how on earth did you get Mask of Madness/Elder Parasite out of that post you quoted me on? -.-

FlyingFury
04-03-2010, 11:16 PM
No, Swift Slashes doesn't have a StatusDebuff or a StatusBuff line in the code, thus it won't dispel any states when you use it.

Also, how on earth did you get Mask of Madness/Elder Parasite out of that post you quoted me on? -.-

lol sorry i was reading it over and i clicked the wrong one. but that isnt what i ment. i know in dota he becomes invulnarable so buffs or debuffs get dispelled. i guess it is different here?

Rajeon
05-08-2010, 10:14 AM
So you're saying I need exactly 425% IAS or more to have 8 slashes (10 w/ SotM) in-between Swift Slashes. I know this isn't DotA, but isn't the max IAS in DotA 400%? Is the max IAS different here in HoN?

ElementUser
05-08-2010, 10:20 AM
Yes, max attack speed is 20 attacks/second of 0.05 seconds/attack.


Actually there is a limit in HoN: 20 attacks/second or 0.05 seconds/attack.

Using the formula, Attacks per second: (1 + IAS) / BAT , we get:

20 = (1+IAS)/BAT

Assuming the hero's BAT is 1.7 (all heroes but Magebane and War Beast in his ultimate form), we'll get:

20 = (1+IAS)/1.7

Then 34 = 1+ IAS
IAS = 33

Since IAS is considered a percentage, that means we have to multiply it by 100.

Therefore, IAS required to reach maximum attack speed in HoN for a hero with a BAT of 1.7 is 3300

MacroHard
05-08-2010, 12:43 PM
In order to round up to the nearest 0.05 in excel, I had to use this work-around:

ROUNDUP((number I want rounded)/5, 2)*5

It takes the number I want rounded, divides it by 5, rounds up to the second digit after the decimal place, and multiplies it by 5. MROUND rounds to a multiple, but it rounds to the closest, not just rounding up like I need. If you can find a better way of doing it, let me know. :P

Example:
ROUNDUP((0.111)/5, 2)*5
=ROUNDUP(0.0222, 2)*5
=0.03*5
=0.15

The way you did it is the best way to round up to nearest 0.05. Congratulations! :)

YurneroBR
05-29-2010, 12:06 PM
The thing is, on DotA, attack modifiers can be applied on the extra slashes, such as BF, chain lightning, stun and other stuff, i also think that he jumps too much compared to old juggernaut. Besides that, item skills could be used when omnislashing such as wards, dagger, shivas, even codex and any other..

ElementUser
05-29-2010, 12:08 PM
And they do in HoN too. And you can in HoN too, except for Portal Key because he's immobilized while in Swift Slashes.

He has the same # of triggered Swift Slashes in HoN.

Rajeon
05-31-2010, 10:31 AM
And they do in HoN too. And you can in HoN too, except for Portal Key because he's immobilized while in Swift Slashes.
http://www.youtube.com/watch?v=gO1xuRf6ZtA