The Speed Guide for Combat (global, weapons, talents)

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Message
Author
jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

The Speed Guide for Combat (global, weapons, talents)

#1 Post by jenx »

Here is a Guide to the Effects of Speed on Combat.

Hits Per Turn
Three variables affect your speed in combat and together they combine to give your number of hits per turn (HPT). The variables are global speed, attack speed, and weapon speed.

The game mechanics use "energy" to track all this. 100% global speed gives you 1000 energy points per turn (EPT), and a regular attack costs 1000 energy points per hit (EPH).

So for a normal character at 100% global speed, with regular 100% attack speed, and with a regular weapon at 100% weapon speed, you simply get exactly 1 hit per turn (1000 EPT/ 1000 EPH = 1.00 HPT).

Naturally, we can eliminate 1000 from this formula, as the 1000 number is arbitrary. The hits per turn formula is therefore simply

Hits Per Turn = Global_Speed x (1 + Attack_Speed) / Weapon_Speed.

But if Weapon Speed is slower than 100% (a negative number in the Character Sheet, it is counted as zero). This can happen with talents like Aim and Precise Strikes. So strictly the formula is:

Hits Per Turn = Global_Speed x MAX [ (1 + Attack_Speed)/Weapon_Speed), (1 + Attack_Speed) ].

However, I find it helpful to think using 1000 energy, so I'll stick with this in the calculations below. Also, and more importantly, the addon uses this as the 1000 base for energy/speed, rather than as percentages, so it is important to know where the figures come from.

Weapon speed and Attack speed both affect Energy per Hit EPH. We will look at these first.

The effect of weapon speed
Weapon speed is listed on the weapon as 100% for regular melee weapons, 90% for quick weapons, 80% for regular shooters, 70% for swiftstrike shooters, and gauntlets vary from 50% to 80%.

This percentage is multiplied by the energy per hit (EPH). Thus a sling at 80% weapon speed costs 800 EPH.

Example 1: Regular bow/sling at 80% weapon speed. 1000 EPT / 800 EPH = 1.25 HPT.
Example 2: Quick weapon at 90% weapon speed. 1000 EPT / 900 EPH = 1.11 HPT

The effect of attack speed
Attack speed also reduces/increases the amount of energy per hit EPH. Attack speed is reduced/increased by many talents, such as Rapid Shot, Precise Strikes, and equipment differences (e.g. gloves vs gauntlets, amulets of enraging, etc). So rapid shot at 5/5 for at talent level 1.3 gives 65% increase in attack speed. To calculate the energy required, divide 1000 by 1 + the percent increase. So 65% increase gives 1000 / 1.65 = 606 energy points per turn (as indicated by lukep's addon).

Some talents decrease attack speed, such as precise strikes and aim. In this case, the EPH increases.

Example 3: Rapid shot gives 65% attack speed increase and an (hypothetical) bow at 100% weapon speed (as they have lower than this, see next section). 1000 EPT / 606 EPH = 1.65 HPT.

The effect of attack speed and weapon speed combined
Attack speed and weapon speed stack, so, using my example, rapid shot at 5/5 gives me 606 EPH and weapon speed of 80% gives 0.8 x 606 = 485 EPH. Thus the hits per turn are 1000 EPT / 485 EPH = 2.06 HPT.

However, when weapon speed is over 100%, as in Precise Strikes on a regular weapon, or for Aim, EPH is not multipled again (otherwise it would be calculated twice in the equation). This is example 1 below.

So precise strikes of 10% decrease in attack speed with no other mods is 1000 EPT / (1 - 0.1) = 1111 EPH. Thus the hits per turn are 1000 EPT / 1111 EPH = 0.9 HPT.

Example 4: Precise Strikes at 10% decrease to attack speed, with regular weapon. 1000 EPT / (1 - 0.1) = 1111 EPH. 1000 EPT / 1111 EPH = 0.9 HPT.
Example 5: Rapid Shot at 65% increase to attack speed, with swiftstrike bow at 70% weapon speed. 1000 EPT / 0.7 x 606 EPH = 2.36 HPT
Example 6: Rapid Shot at 65% increase to attack speed, with Precise Strikes 10% decrease to attack speed, giving attack speed of 48.5% in char sheet, with regular bow at 80% weapon speed. EPH = 1000 / 1.485 = 674. 1000 EPT / 674 EPH = 1.86 HPT. This makes sense, as it is slightly lower HPT than without precise strikes (2.06 HPT, see above)

Incidentally, if you want to calculate how to get the 48.5%, it is Increase - (Decrease x (1 + Increase)). (e.g. 0.65 - (0.1 x (1.65) = 0.485). That is, you decrease based on the increased amount.

The effect of global speed
Global speed increases the amount of energy per turn EPT. So 40% increase gives you 1400 EPT. So you get more time (= energy) to do stuff.

Equipment and talents can increase global speed, some temporarily and some permanently.

Eden's Guile for instance, gives you 29% increase to global speed. We simply then change EPT to 1290 and calculate accordingly. This is where we see significant changes to HPT.

Example 7: Eden's Guile at 129% global speed, regular weapon. 1290 EPT / 1000 EPH = 1.29 HPT.
Example 8: Eden's Guile at 129% global speed, regular shooter at 80% weapon speed. 1290 EPT / 800 EPH = 1.61 HPT
Example 9: Eden's Guile at 129% global speed, swiftstrike shooter at 70% weapon speed, Rapid shot at 65% increase attack speed. 1290 EPT / 424 EPH = 3.04 HPT.
Example 10: Blinding Speed at 141% incrase, swiftstrike shooter at 70% weapon speed, Rapid Shot at 65% increase attack speed. 1410 EPT / 424 EPH = 3.31 HPT

Theoretical Maximum for HPT
This is hard to estimate precisely.

I think it would be a Yeek Archer: Yeek (global speed 15% increase) + global speed prodigy (15% increase), Rapid Shot with extra talent point + Ring of War Master + enraging amulet at 10% increase would give close to 100% attack speed increase I think. Randart sling with double swiftstrike for 60% attack speed (is this possible?) and 5% global speed increase, with offhand blazebringer at 5% global speed increase. Blinding Speed (but not with extra talent point, as to get global speed prodigy you need 20 in equi, which requires 2 unlocks, and we've spent 2 already), so 41% increase, to base of 140% global speed of yeek 15% + prodigy 15% + sling 5% + offhand 5%, giving total (temporary) global speed of 97.4% increase.

That is, hypothetically, you might get temporarly 97.4% increase in global speed, 100% increase in attack speed, and 60% increase in weapon speed!

This would give then, using generic formula above 1.974 * (1 + 1) / 0.6 = 6.58 hits per turn!

The other class that might outdo this even is a Yeek Brawler, but I'll leave it to someone else to calculate.

The 3.31 HPT (example 10 above) with max Blinding Speed, Swiftstrike, and max Rapid Shot, can be achieved by an archer by about lvl 17, if you save class points for this effect, and find a swiftstrike, which are quite rare. When your ammo has on hit effects, this means you increase your chance of landing one of these per turn.

When do I get my extra hits per turn?
You have to accumulate the energy to the point when you have enough to do more than one action per turn. For example, you have weapon speed of 80% and no other modifier. In turn one you'll accumlate 200 energy, then 400, then 600, then 800. At this stage, you use 800 for your first shot, using up your spare energy and then you get your second shot. You can see this by putting on a regen infusion, and shooting randomly, and seeing when you get two shots per turn.

So then, can you assume that you have to wait, in such an example when HPT = 1.25, for 4 turns before an extra shot? No, because the complication is that you can accumlate energy from all sorts of places. You might have movement speed increase, and so you move, giving you some spare energy each move. Move 3 times, to pump up your stock, and then shoot twice. Hard to coordinate, but it happens. So in practice, the extra shot appears anywhere in the 5 turn period.

But this also illustrates why getting HPT > 2 is so valuable. In this case, you always get 2 and sometimes 3 shots in a turn. And if you get to example 10, which can be done by about lvl 17, you can get HPT = 3.31 HPT. In 4 turns you'll shoot about 13 times with Blinding Speed! And that makes a BIG difference.

What about wielding two weapons with different weapon speeds?
The weapon speed can be different for offhand and for mainhand. The HTP are calculated separately and they use energy separately.

I'm not sure though what happens when only one weapon has enough energy to act, but the other doesn't. Perhaps only one weapon hits? But they don't interact with other in any way.

The offhand weapon speed for a sling makes no difference at all.

Acknowledgements
The clock addon by lukep, and the many forums posts on speed and on Rapid Shot vs Aim, and some code delving, and running lots of archers, finally gave me the tools to figure this out properly I hope.

Conclusion
I hope this guide helps you understand more how speed affects combat in the game, as of version 1.0 of Tome.

Please post any corrections or comments or clarifications, and I'll do my best to answer them. I've probably made some errors, but I did check everything as carefully as possible.
Last edited by jenx on Tue Feb 19, 2013 10:34 am, edited 2 times in total.
MADNESS rocks

CaptainTrips
Wyrmic
Posts: 227
Joined: Thu Mar 10, 2011 9:10 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#2 Post by CaptainTrips »

Very nice to see things like this being done. How about posting it on the wiki?

This reminds me of back when Momentum would stay on even if switching to a single weapon, e.g. a bow. I had a bow TW running Rapid Shot, Momentum, and a bunch of + global speed affects (including Harmony) that took down the final bosses before they had a chance to move more than two squares in my direction, iirc. :P

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: The Speed Guide for Combat (global, weapons, talents)

#3 Post by nate »

Interesting, thanks! I'm going to have to read more closely later. Any idea on how off-hand weapon speed interacts with mainhand weapon speed?

One thing, though: while it's customary, on the forums, to talk about a "turn" as being that thing that is the time between brand-new player actions, the game actually counts turns as being only a tenth of that length. In other words: if you start up a new character, take a step, and ask the game how many turns have passed, it will say "10 turns have passed."

Why's that matter? Because you don't actually get 1000 energy all at once-- you get it in chunks of 100. It's almost impossible to get two actions on the same turn (when we're talking about those mini-turns), you really need to be running about something like 1000% global to do that. But if you act at turn 11, and at 16, and at 21, and you compare yourself to somebody that acts only at turn 12 and 22, it looks like a free action, and energy fluctuations can make your actions occur slightly irregularly-- like at turn 10, then 16, then 21, without your speed changing.
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#4 Post by jenx »

CaptainTrips wrote:Very nice to see things like this being done. How about posting it on the wiki?
Done: http://te4.org/wiki/guide-speed-and-combat
CaptainTrips wrote:This reminds me of back when Momentum would stay on even if switching to a single weapon, e.g. a bow. I had a bow TW running Rapid Shot, Momentum, and a bunch of + global speed affects (including Harmony) that took down the final bosses before they had a chance to move more than two squares in my direction, iirc. :P
I hadn't thought of Harmony global speed increases. If that stacks with talents, then the theoretical maximum hits per turn will increase considerably.

I'll investigate and update the entry if need be.
MADNESS rocks

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#5 Post by jenx »

nate wrote:Interesting, thanks! I'm going to have to read more closely later. Any idea on how off-hand weapon speed interacts with mainhand weapon speed?
I forgot to explain that mainhand and offhand weapon speed are calculated separately. So then, what if you say have 900 energy and mainhand costs 1000 and offhand costs 800? Do you only attack with the offhand, or not at all, or does one hand allow the other? I'm not sure. The clock addin would need to be adjusted to include mainhand and offhand (and ideally, take into account, weapon speed.)
nate wrote:One thing, though: while it's customary, on the forums, to talk about a "turn" as being that thing that is the time between brand-new player actions, the game actually counts turns as being only a tenth of that length. In other words: if you start up a new character, take a step, and ask the game how many turns have passed, it will say "10 turns have passed."

Why's that matter? Because you don't actually get 1000 energy all at once-- you get it in chunks of 100. It's almost impossible to get two actions on the same turn (when we're talking about those mini-turns), you really need to be running about something like 1000% global to do that. But if you act at turn 11, and at 16, and at 21, and you compare yourself to somebody that acts only at turn 12 and 22, it looks like a free action, and energy fluctuations can make your actions occur slightly irregularly-- like at turn 10, then 16, then 21, without your speed changing.
Yes, and I alluded to this when I wrote about, when does my extra hit arrive? The clock addon gives you a much better sense of where you are in a turn, as it provides fractions of a turn.
MADNESS rocks

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

Re: The Speed Guide for Combat (global, weapons, talents)

#6 Post by jotwebe »

nate wrote:Because you don't actually get 1000 energy all at once-- you get it in chunks of 100. It's almost impossible to get two actions on the same turn (when we're talking about those mini-turns), you really need to be running about something like 1000% global to do that.
Actually, I think it is impossible to get two actions per mini-turn, since the way it works is that each turn, the game looks at every actor whether they have enough energy to act. If they do have the energy, they get to act and the energy cost is substracted. If your speed is over 1000%, your energy cost is lower than 100, and you keep accumulating energy while still only acting once per mini-turn. In effect this extends the duration of your speed boost a little bit.

1000% speed is ToME's speed of light.
Ghoul never existed, this never happened!

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: The Speed Guide for Combat (global, weapons, talents)

#7 Post by nate »

You can get two actions per mini-turn with movement speed increases-- movement infusion and something else. I'll get around to checking all the relevant code someday, but I'm pretty sure that if you have enough energy to act after acting, the game turn isn't incremented. (Which is actually responsible for some buggy behavior.)
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: The Speed Guide for Combat (global, weapons, talents)

#8 Post by lukep »

A few comments:

A much easier way to get two turns instantly: Activate Gift of the Highborn on a character with powerful Fungus talents. You will get the 1000 extra energy, without spending any. You will then have 2000 energy, and you can then act until you drop below 1000 (so, two normal actions).

As for mainhand/offhand weapons, the speed of an attack is set to the slower of the two ((Line 175).

As for the fastest attack speed, I think a TW would be up there, as it can stack Speed (from Eden's Guile/cloak of the hunt/anomalies), Haste, Elemental Harmony (fire), and Momentum with a sling and offhand Blazebringer's dagger, in addition to most of the tricks posted before.

Double or even x3 or x4 ego'd randarts are possible, it is just extremely unlikely (I've seen a bow of x4 greater speed from the merchant on a scumming char, with 0% attack speed)
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

madmonk
Reaper
Posts: 2257
Joined: Wed Dec 12, 2007 12:21 am
Location: New Zealand

Re: The Speed Guide for Combat (global, weapons, talents)

#9 Post by madmonk »

I've stickied this, it's too useful to lose! 8)

Thank you for creating this, Jenx. Much appreciated! :D
Regards

Jon.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#10 Post by jenx »

Glad to be of help. I hope DG doesn't change the mechanics too much in future. I I like the system, despite its complexities.
MADNESS rocks

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: The Speed Guide for Combat (global, weapons, talents)

#11 Post by nate »

One more question, just in case anybody has the answer handy: where in the code is the energy recovery amount? Confident that it's 100/tick, but I'd rather reference the actual variable for modding purposes.
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#12 Post by Hachem_Muche »

The energy recovered is stored in game.energy_per_tick which is initialized in the function _M:init(keyhandler, energy_to_act, energy_per_tick) in engine.GameEnergyBased.lua
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: The Speed Guide for Combat (global, weapons, talents)

#13 Post by nate »

Excellent, thanks!
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

wobbly
Archmage
Posts: 400
Joined: Tue Jul 03, 2012 8:35 am

Re: The Speed Guide for Combat (global, weapons, talents)

#14 Post by wobbly »

Anyone know if talents like block count as an "attack" for speed purposes?

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: The Speed Guide for Combat (global, weapons, talents)

#15 Post by jenx »

wobbly wrote:Anyone know if talents like block count as an "attack" for speed purposes?
Not sure. Good question.
MADNESS rocks

Post Reply