Intro
Quick summary is presented in a “Tl;dr” under a spoiler cut.
For melee units, Reload Time is only a guideline for the actual time intervals when the damage is inflicted. The latter are synchronized with the attack animation (0% and 50% fractions of the attack animation duration, tAD, to be precise), which in practice leads to deviation in time-to-kill compared with theoretical calculations based solely on Reload Time, tRel. Moreover, if a unit has not been attacking for t > Reload Time, the first hit will ignore the Reload Time and will be inflicted at 50% fraction of the first attack animation cycle (with the second hit allowed to come in after the first cycle of Reload Time elapses), which somewhat significantly lowers practical time-to-kill the shorter the engagement is. Some examples can be found in “Implications” section.
Disclaimers and Abbreviations
- I am not sure whether this has already been covered somewhere else. The hint is Battle Elephant’s attack animation duration of weird 0.985 sec;
- All I used was Advanced Genie Editor (AGE3), scenario editor, and 60 FPS recordings captured in the latter;
- The formula I managed to derive may –and will, for long engagements– deviate from practical observations, with the possible reasons discussed in “Notes”, {3.1};
- All the timings match the 1.0 game speed (“Normal” game speed in DE is probably supposed to be 60 : 35.5 = ×1.69… to match the Userpatch v1.5, though comparing in-game timer vs. real-time recordings, I had it ×1.641… and ×1.660… instead on two separate occasions);
- Rams are unique as they have an attack animation replay delay of 2 sec (meaning the next attack animation will be offset by 2 sec after tAD has elapsed). I did not investigate into that.
- tRel = [Attack] Reload Time. For a specific unit, it can be found in Advanced Genie Editor, ‘Units’ tab.
- tAD = [Attack] Anim[ation] Duration. For a specific unit, it can be found in Advanced Genie Editor, ‘Graphics’ tab. Here, its 50% fractions (0.5 × tAD) are often used instead as they indicate timings when the damage can be inflicted.
- tΔ – timer which tracks the “real” [= in-game timer] time which has elapsed since the start of the attack by the point of time in question (current time).
- tΔ,AD – “attack animation” timer split into n × 0.5 × tAD intervals, where n is an integer tracking the number of 50% fractions of attack animation elapsed by the time tΔ.
- tΔ,Rel – reload timer split into m × tRel intervals, where m is an integer tracking the number of reload cycles elapsed by the time tΔ.
- HTK = hits-to-kill.
- TTK = time-to-kill (practical).
Ruleset
When attacking (entering the attack animation loop):
- {1} Melee units can only inflict damage at 0% or 50% of Anim. Duration (tAD) (in time or keyframes of the animation), regardless of what Reload Time (tRel) states.
- {2} If it is the first attack (I guess the condition is: the unit has not been attacking for t > tRel), ignore {3} and {4} and only abide {1} (i.e., this will almost always mean inflicting the first hit at tΔ = 0.5 × tAD). For the next (second) attack, consider {3} and {4} but track the Reload timer from the moment when the unit entered its first attack animation. Put it another way, reload timer tΔ,Rel does start alongside with the first attack, but only restricts the second hit.
- For second and any subsequent hits: If {3} reload timer (tΔ,Rel) has elapsed, then, upon reaching the closest 0% or 50% fraction of attack animation (closest tΔ,AD), inflict damage. Else: {4} wait for the Reload Time to elapse. Reload Time is a separate counter which resets independently from attack animation cycles (i.e., it resets as soon as the previous tRel interval has elapsed, though it’s hard to say what should occur if tΔ,AD = tΔ,Rel, as discussed in {3.1} of “Notes” section).
- {2.1} Let’s take a Spearman (tRel = 3 sec, tAD = 1 sec) that has not started any attack animation for the last 3 seconds. Let’s say it has closed in on a Scout and entered an attack animation; due to {2}, the latter will receive the first hit in 0.5 sec (0.5 × tAD). However, if the Scout dies within this 0.5 sec interval from any other attack, Spear's attack will be aborted, but the Spearman –given it has already entered the attack animation– will not be able to inflict damage until the Reload Time (3 sec) elapses.
- {2.2 & 3, 4} Light Cavalry has tRel = 2 sec and tAD = 1.35 sec. Per {2}, the first attack is inflicted in 0.5 × tAD = 0.68 sec; the second hit cannot be inflicted when the first attack animation cycle ends (tΔ = 1 × tAD = 1.35 sec < tΔ,Rel); however, on the 50% fraction of the second attack animation, tΔ = 1.5 × tAD = 2.025 sec > tΔ,Rel (which is 2 sec by then). This means that our Light Cav will be able to inflict two hits in 2.025 sec. The third hit, however, will only be inflicted at tΔ = 4.05 sec (= 3 × tAD), when the second tRel expires (tΔ,Rel = 4 sec), and for a long period, the Light Cav will be inflicting hits every 2.025 sec.
- {2.3 & 3, 4} On the other hand, consider a Spearman again, which has not been attacking for > 3 seconds. By {2.1}, its first attack will be inflicted in 0.5 sec (0.5 × tAD); for the next two animation cycles, our Spearman will not be able to inflict a hit (e.g., at 50% of the third attack animation cycle, tΔ,AD will still be lower than tΔ,Rel (tΔ,AD = 2.5 × tAD = 2.5 sec). At the end of the third animation cycle, tΔ,AD = tΔ,Rel (3 sec); however, it seems that the second attack demands a strict tΔ,AD > tΔ,Rel, and thus the second hit will only be inflicted at 50% fraction of the fourth attack animation cycle (tΔ,AD = 3.5 sec). Our Spear will then consistently deal damage every 3 sec matching the Reload Time.
Calculating Practical TTK
Practical TTK (and every hit’s timing) can be calculated as following (could not force proper formula background in Word/MathType):
Or as a text, in case something happens to the image:
TTK = 0.5tAD × INT{ [ (nHTK – 1) × tRel ] / 0.5tAD ] + 1 },
where 0.5tAD is a 50% fraction of the attack animation, tRel is the coded Reload Time, nHTK is the number of hits-to-kill (or particular hits of interest); “INT” means integer (rounding down). It might seem slightly intimidating at a first glance, but in practice, the integer part is there to calculate the closest number of 50% fractions of the attack animation to match the required reload time (ignoring the first hit), and “+1” is meant to move the first attack outside the brackets to prevent TTK = 0.
Or, as text:
TTK = max(0.5tAD, 0.5tAD × CEILING{ (nHTK – 1) × tRel / 0.5tAD } ),
but in this case, if the part in the brackets is already an integer, the result will be underestimated by 0.5tAD. It is possible that the latter formula is actually used by the game, but it fits the practically observed results worse than the formula outside of the spoiler cut.
Excel Spreadsheet to calculate practical TTK
I’ve compiled the formula into a simple Excel spreadsheet (link to the Google Drive) which, upon entering unit’s and target’s stats (fields filled with light yellow) –such as attacking unit’s damage, tAD, and tRel and target’s HP & armor,– calculates practical TTK and timeframes when the damage should be inflicted. Note that it is meant to be viewed in Excel as Google Docs have different approach to formatting altering the graph and conditional formatting.- Variables are described in the comments in the spreadsheet. There are some hidden columns used as crutches for conditional formatting.
- It is limited to 50 hits and 1000 sec, but the formulas and conditional formatting can be modified.
- Hopefully it works properly in older and other language Excel versions – I only checked 2010 different language and 2019 English Excel versions.
- No google docs spreadsheet as it would work out slightly differently there.
- Second sheet contains practically observed damage timeframes (scenario editor, ×1.0 game speed, damage per hit = 1, 60 fps recording) compared against calculated results (the latter were calculated and copied from separate spreadsheet as values).
Implications
- Can the system be abused? I don’t think so, as {2} checks if the Reload Time has elapsed. The only implication is probably microing cavalry (esp. Steppe Lancers) chasing other units down (moving the cav unit as soon as the hit is inflicted, skipping the remaining 50% of attack animation); however, you risk to waste a hit and get stuck with a unit sitting in one place for t = 2 × tAD cycles if {3} was not satisfied (Reload Time has not elapsed yet), which in practice occur, for example, for a Scout chasing an unmicroed vill.
- Thanks to {2}, in short engagements (HTK –number of hits-to-kill– is low), practical TTK will deviate the most from the Reload Time (by being lower), while in prolonged fights, TTK gets close to the coded Reload Time tRel. E.g.: In a Knight vs. Monk scenario (assuming the latter has no Sanctity and is not fleeing), if we used Reload Time only, we would expect the Monk to die in 5.4 sec; in practice, however, the TTK is only 4.05 sec. The difference is more than 1 “monk-second” (1.25 sec) – see T-West’s comprehensive video on Monks if unfamiliar with conversion mechanics. However, assuming instant reaction by the Monk player, closing in with a Knight from 9 tiles away and attempting to kill a Monk will still likely (c. 78%) result in a free donation – see calculation under the spoiler cut if interested.
Assuming a direct path, no Husbandry and no Sanctity, the process will take 9 [distance, tiles] / 1.35 [Knight speed, tiles / sec] + 4.05 [TTK, sec] ≈ 10.7 sec (Knight tAD = 1.35 sec, tRel = 1.8 sec, and, just like Light Cav (despite the lower reload time), it can inflict 3 hits in 4.05 sec); in 10.7 sec, there are p = 5 procs for a conversion chance in total (5, 6.25, 7.5, 8.75, 10 sec), with the conversion chance assumed to be c = 26%; thus, the conversion chance in the Knight vs. Monk scenario, let's call it bless_rng, can be calculated as: bless_rng = (1– (1 – c)p) × 100%) = 1 – 0.745 ≈ 78%).
Calculation examples
- Even though Hussars/Paladins have lower/higher Reload Time tRel than their respective previous upgrades (Light Cav/Cavalier), it does not come into play until 7th hit for the former and 5th hit for the latter. Before the tAD for the Hussar was buffed in DE (tAD = 1.89 → 1.35 sec), it actually had been a downgrade for Light Cav in terms of damage output prior to the 8th hit (despite tRel = 1.9 sec for Hussar vs tRel = 2 sec for Light Cav). See graph examples under a spoiler cut below the next bullet in the list.
- If the reload timer tΔ,Rel has elapsed, Japanese Spears (tAD = 1 sec, tRel = 2.25 sec) can inflict two hits in just 2.5 sec. Full HP Scouts without Bloodlines can be killed in just 5 sec by Japanese Spears (6.5 sec for generic Spears). Knowing this, we can also reinforce a generic rule of “3 Scouts to take out 1 Spear”: 3 full HP Scouts will be able to inflict 4 hits (in 6.075 sec) each (calculation: 4 (n of hits per Scout) × 3 (n of scouts) × 5 (melee dmg) = 60 potential dmg output) by the time a Spear would be able to kill a Scout in three hits. It should work vs. a Japanese Spear, too (Scouts will be able to inflict 3 hits (4.025 sec) before one of them dying and will have a 1 sec margin to stack on top of a lonely Japanese Spear altogether).
11 hits in total; the lower the line, the better (the lower the TTK). Apologies for the white background:
- {2} means that Coustilliers’ charge attack can be inflicted in just 0.6 sec (its tAD = 1.2 sec). Microed Steppe Lancers can inflict damage in 0.68 sec (their tAD = 1.35 sec), retreat, and then attack again after the tRel (= 2 seconds) elapses.
- Farimba and Stirrups Cavaliers both kill a FU Paladin in c. 22.3 sec. The latter kills them in only 19.6 sec, though.
- The only two units which may occasionally inflict two attacks in 1 second (aside for the first hit) are Samurai (its attack is split into 0.8 / 1.6 sec intervals) and Japanese Man-at-Arms (0.88 / 1.76 sec). Bulgarian Knights and Cavaliers have their Reload Time matching their Attack Anim. Duration and thus always (aside for the first hit) inflict damage every 1.35 sec.
Notes
I recorded a 1 dmg Knight attacking a 10 HP Spearman in the scenario editors of AoC 1.0c, AoC 1.5 RC (Userpatch), HD, and DE (the latter one in singleplayer and on a server with c. 250 ms ping, though with no other human players in the lobby). Safe for frame rounding and possible attack animation rounding (pre-DE Knight attack animation consists of only 10 keyframes, while in DE, it’s 30 keyframes), the outcome –ttk and damage timings distribution– ended up being identical, indicating there has been little to no change since AoC. A bonus fact is that the described mechanic works the same way in AoE I DE (that’s where I actually noticed it first). I would not be surprised if that’s the case in AoE I and AoK (and in Genie Engine in general); however, I don’t have AoE I at hand, and AoK seems to only work in Voobly multiplayer for me where even the ‘Slow’ speed appears to be bugged (it’s actually c. ×1.25 – maybe it’s a feature, though) and I have no access to the scenario editor there for proper testing.
While trying to figure out the formula based on the ruleset, I’ve stumbled upon the fact that I was not able to fully formalize the results (so that practical and calculated timings –presented in the second sheet of a spreadsheet in the attachment– would fit 100% for long engagements). Notably, deviation occurred in the cases where the reload time and animation cycles were either matching each other (tΔ,AD = tΔ,Rel) or were close enough, with a difference up to 0.1–0.2 sec (with building up later). There could be several explanations: either (1) there is a small mistake in the formula (e.g.: could be if tΔ,AD ≊ tΔ,Rel (equal or close to equal), the attack can only be inflicted if the attack animation is at 50% fraction currently (but not 0%), or vice versa), or (2) there is a dedicated Δt with a small value added to the reload timer tΔ,Rel every attack, or (3) the reload timer tΔ,Rel and attack animation timer tΔ,AD are not synchronized with each other / to the global timer (with the resulting attack occurring in the next 50% fraction of tAD compared with a calculated prediction in the deviating cases).
In Ruleset {2}, I would add a questionable {2.1}: (?) if retargeted before closest 50% of tΔ,AD has been reached → discard and wait for the next 50% of tAD. If constantly switching targets during the attack animation, the practical reload time will be severely increased, though I am not sure how does it work exactly. Examples:
- With a looping trigger for a Tarkan to constantly switch between two targets every 1 second with no movement required (game speed was ×1.0), I ended up with only 90 hits in 388 seconds, or c. 4.3 practical reload time (vs. 2.1 sec coded tRel).
- With a Light Cav in the same scenario (but game speed ×1.7), it ended up being more interesting, as first 46 hits were inflicted on the first target (second target left unharmed), while subsequent 45 hits only applied to the second target).
Watching what little AoE IV open beta gameplay footage I managed to record (man, ding-ding + tunnel vision is a guaranteed migraine for me), it seems that at least {2} is applicable there as well (first hit is inflicted faster than tRel suggests), albeit with some tweaks. M@A first hit took 0.5 sec on one occasion and 0.75 sec on another (from the in-game tooltip, tRel = 1.25 sec for M@A), Horseman – 0.75 sec (tRel = 1.62 sec); time calculated from full stop and rotation till the damage is displayed on the HP bar. The difference for M@A can be caused by the difference between a regular and a charge attack. I have only one footage of subsequent attacks (2 M@a vs Scout): it seems that M@a has two different attack animation (slashing and pocking) with different durations (1 and 1.5 sec) which inflict damage in 0.5 and 0.75 sec, respectively. Thus, attacks are inflicted at 50% of the tAD, but that is not enough to confirm whether {3} and {4} apply to AoE IV as well.