Age of Mythology: Extended Edition

Age of Mythology: Extended Edition

Advance to the Steam Age
Explore modified graphics as well as new scenarios, maps, AI, and more! Ready to share your creations with the world? Upload right from the in-game mod manager.
amyhaf 13 Dec, 2019 @ 3:58am
Rate of Attack
Isn't setting up an attack with a chargeaction and a rechargetime the same thing as just tweaking the 'rate' param?

Like a rate of 0.1 would simulate a long recharge time?

Or am I misunderstanding what rate is?
< >
Showing 1-15 of 18 comments
Loggy 27 13 Dec, 2019 @ 4:18am 
Attack speed is determined by the animation files, not by anything into the proto. As far as I'm aware the Rate tag for attacks doesn't do anything besides specify that something is a valid target for the attack in question.
amyhaf 13 Dec, 2019 @ 5:31am 
Pretty sure "Rate" is frequency of attack. Higher number equals more swings per second.
Loggy 27 13 Dec, 2019 @ 8:48am 
Sure, it seems backwards, but modifying anim files is the only way I've successfully managed to change the attack anim length of a unit.
Zeus 19 13 Dec, 2019 @ 10:21am 
Originally posted by Loggy:
Sure, it seems backwards, but modifying anim files is the only way I've successfully managed to change the attack anim length of a unit.

Like Loggy said, anim files have lenght that can increase or decrease rate of attack
amyhaf 15 Dec, 2019 @ 11:38pm 
Ah OK, I gleaned bad info from an old guide (stephen caines 'an intoduction to modding for age of mythology' via AoMHeaven) -- It clearly says Rate "defines a higher frequency of attack with higher number being more swings per second". I also (now) tested this and it seems to have no affect in game.

So you are saying (a) that guide is incorrect and (b) the reality is that the anim file besides showing the animation is actually talking to the engine and signifying an attack took place and then referencing the proto for damage etc?

Lastly, believe it or not, once I confirm this with you, i think my original question will still stand, but in another form.
Last edited by amyhaf; 16 Dec, 2019 @ 4:26am
Loggy 27 16 Dec, 2019 @ 4:45am 
The anim file determines the length of the attack anim. If a length is not specified (which seems to be the majority of cases) it uses the native length of the anim, which is stuffed into the brg or grn file itself. The anim file also says at what point in the anim to do the damage or shoot the projectile.

In most cases, the proto number is the damage per second and not the actual damage. Real damage is simply calculated by the engine as dps * anim length, with a couple of exceptions: area and lightning attacks always do the damage per attack, not per second.
amyhaf 16 Dec, 2019 @ 3:58pm 
Originally posted by Loggy:
The anim file also says at what point in the anim to do the damage or shoot the projectile.
Which would be the "sure, it seems backwards" part. Got it.

In my testing, a unit with damage value1="10" does exactly 10 actual damage to the target. Is this simply an illusion because most hit animation is seemingly timed around a second? Because boy it feels like "per hit".

Originally posted by Loggy:
dps * anim length
With dps in this case being param name="Rate" type="All" value1="1.0"?

I'm trying (and failing) at breaking these elements down to move forward:

a units 'damage' (proto) = their base damage

a units 'damage rate' (proto) = (counterdicting Caines guide) multiplies the base damage per second (maybe?)

a units 'tag Attack' (anim) = determines (a) when to visually represent an attack and (b) when to actually calculate the attack.


Last edited by amyhaf; 16 Dec, 2019 @ 4:06pm
Loggy 27 16 Dec, 2019 @ 5:01pm 
Originally posted by amyhaf:
In my testing, a unit with damage value1="10" does exactly 10 actual damage to the target. Is this simply an illusion because most hit animation is seemingly timed around a second? Because boy it feels like "per hit".

Some units do indeed have attack anims that last exactly one second, yes. Alternatively, the UI might be doing a poor job of displaying the noninteger portion of the damage (its integer display always seems to round down, though I never looked at what happens if you get in the range 0 < hp < 1, though)


Originally posted by amyhaf:

a units 'damage rate' (proto) = (counterdicting Caines guide) multiplies the base damage per second (maybe?)

I believe this to be false. As far as I know the value1 of rate parameters doesn't mean anything besides that the attack in question can choose the unit type as a target. I don't actually know if setting it to 0 prevents targeting, come to think of it...

To hopefully clear up a few things, to my knowledge at least...

1) The thing governing attack rate is the animation file. The duration of the animation is included (though not in a human readable manner) in the brg/grn files, which is used unless a "length" line is in the unit's anim file for the relevant action.

2) The thing governing damage is essentially always the proto. The numbers given are in >90% of cases the damage PER SECOND, not per attack - the game will dynamically calculate damage per attack based on the attack animation length. The ingame UI also reflects the damage per second defined in the proto. This means that for most units with multiple attacks with differing animation lengths (for example the humble hippikon) the final DPS is unaffected by whichever attack animation the game randomly decides to use. Naturally, unit armours are applied to the damage after this calculation.

3) Some things instead do the listed damage per attack, not per second. These are the exception rather than the rule, though, and are generally lightning attacks, unit special attacks, and attacks with an area effect (value2) component on their damage param. Examples of this include petsuchos, son of osiris, titans, phoenix...

4) The anim file also dictates when in the anim to launch the projectile or do the handattack damage. A VERY small number of units (v2.5 chu ko nu, fire giants, heka gigantes) actually attack twice per animation, which leads to them doing twice the expected DPS.

5) The thing that decides what an action can target is the Rate parameter. This is of interest in (for example) defining what a dock can shoot at, what an immortal uses a bow on, restricting villagers' ranged attacks to huntable animals, and so on. As far as I know, the value1 for this isn't of much importance.

Sure, I'm not saying I'm correct on all of this, but certainly in all the tests I've done working out how internal damage calculation actually works I've not once found a case where the Rate parameter has any impact on the final result. There's a handful of weird cases (hydra's extra heads, damage vs unfinished buildings) where different stuff happens, but for most combat I believe the above to be correct.
Last edited by Loggy; 16 Dec, 2019 @ 5:03pm
amyhaf 16 Dec, 2019 @ 10:44pm 
Originally posted by Loggy:
Alternatively, the UI might be doing a poor job

Or a good job? (Hehe) -- For example I fired up the Dwarf, and perfectly every time he swung his little sticker the exact damage would come off of the opponent. But it sounds like all that is actually happening is that when the dwarf is within the set melee range for one second he causes his damage value.


Originally posted by Loggy:
As far as I know the value1 of rate parameters doesn't mean anything

While I am grateful to have learned this param does not mean "more swings" it has nonetheless created a new hump for me. Upon a deeper look at the proto the values can be seen dancing around a bit more than one first might think. Not that I was looking for a new rabbit hole, but there has to be something a bit more to this value... I'll have to switch gears.


Originally posted by Loggy:
the game will dynamically calculate damage per attack based on the attack animation length.
What do you mean dynamically? Just curious because I've done enough tests to know it is always doing the exact amount of damage (armor defense aside) I set in the proto, no more no less, and not a RNG.


Originally posted by Loggy:
3) Some things instead do the listed damage per attack, not per second. These are the exception rather than the rule, though, and are generally lightning attacks, unit special attacks, and attacks with an area effect (value2) component on their damage param. Examples of this include petsuchos, son of osiris, titans, phoenix...
These were the most obvious to me, probably because of the distance between opponents, but when the attack is 'fired', it does damage. The units swinging swords perceptually were doing that as well for me (unit swings sword makes sound, I sequentially see opponent damage go down, rinse, repeat).

Although this does bring up another point. If ranged attacks can miss (accuracy, aim, tracking, etc)... it seems dps couldn't apply. Animation to fire bow takes a second, arrow is in air a second (or two), arrow misses target. No damage. Same sequence of events but arrow happens to hit target, set damage amount dealt. Perhaps the RangedAttack param overrides this dps thing?


Originally posted by Loggy:
4) The anim file also dictates when in the anim to launch the projectile or do the handattack damage. A VERY small number of units (v2.5 chu ko nu, fire giants, heka gigantes) actually attack twice per animation, which leads to them doing twice the expected DPS.
Is the following a good, at least Neanderthalic, way to think about this? More often than not, if a unit is within its handattack range of an opposing unit for one second, it deals its damage value1 to that opponent.


Originally posted by Loggy:
5) The thing that decides what an action can target is the Rate parameter.
This is my biggest takeaway. Thank you. (And boo hiss ES for a horrible param naming convention)


Originally posted by Loggy:
As far as I know, the value1 for this isn't of much importance.
Yet the devs altered it in quite a few places. A new area of interest for me to say the least.


Originally posted by Loggy:
but for most combat I believe the above to be correct.
You've undeniably brought much clarity to the topic..
Last edited by amyhaf; 16 Dec, 2019 @ 10:52pm
amyhaf 17 Dec, 2019 @ 12:28am 
Did a smidge of testing, coupla things...

Attack Rate Value1
Haven't given up yet, and I know I'm preaching to the choir here, but it's maddening. It's even used in FreezeAttacks with its adjustment having no bearing. (E.g. Medusa and Hero Perseus stone opponents in controlled tests with the exact same results despite the vast discrepancy in freezeattack rate value)

FWIW when the value is set to zero or negative it does indeed disable the ability to attack the designated type... One could (dangerously) extrapolate that if 0 or negative causes me to not be able to target said type, then a 5 should enable me to somehow target said type better/stronger/faster. Yeah no.

Drawing board awaits.

DPS
Boy I regret to mention this, but I switched my main testing unit from the dwarf to Perseus randomly. When that guy smacks a unit it does damage, seemingly clean and simple. if I immediately turn him away no damage, if I quickly click on another opponent it, again, does damage, exactly when the animation strikes, not before or after.

Is 'damage per second' vs 'damage per attack' a distinction without a difference for unit melee combat? Trying to simulate an example where I can see damage ticking off an opponent by the clock as my unit animates... vs the tip of the sword cutting into the baddie and causing one helping of my hand-cranked damage value.
Last edited by amyhaf; 17 Dec, 2019 @ 3:00am
Loggy 27 17 Dec, 2019 @ 8:35am 
Originally posted by amyhaf:
For example I fired up the Dwarf, and perfectly every time he swung his little sticker the exact damage would come off of the opponent. But it sounds like all that is actually happening is that when the dwarf is within the set melee range for one second he causes his damage value.

The attack anim length for the dwarf is exactly 1 second, which is why you're seeing this.

Originally posted by amyhaf:
What do you mean dynamically? Just curious because I've done enough tests to know it is always doing the exact amount of damage (armor defense aside) I set in the proto, no more no less, and not a RNG.

Take for instance the hippikon. It has 3 different attack anims which I kinda arbitrarily named:
1) "Underhand swing": 1s
2) "Prancing overhand swing": 1.2s, the horse's front hooves leave the ground during this
3) "Small overhand": 0.85s

If the hippikon does 10 hack dps, that means the different attacks do a dynamically calculated 10, 12, and 8.5 hack damage respectively. The DPS is always 10, no matter which attack is rolled.

Originally posted by amyhaf:
Although this does bring up another point. If ranged attacks can miss (accuracy, aim, tracking, etc)... it seems dps couldn't apply. Animation to fire bow takes a second, arrow is in air a second (or two), arrow misses target. No damage. Same sequence of events but arrow happens to hit target, set damage amount dealt. Perhaps the RangedAttack param overrides this dps thing?

Missed ranged attacks simply do 0 damage for the sake of DPS. Take for instance Hippolyta, the worst of the Greek classical heroes. She has a 2s attack anim time. Because accuracy increases per shot consecutively fired at the same target (this is a whole other topic that has not been researched extensively) and missing hurts her so much, she is way worse than Odysseus who fires every 1.2s. This is because she's terribly inaccurate on the first shot, resulting in inconsistent damage output that also wastes a lot on overkill due to her slow anim time.

This isn't to say that low anim times are always desirable though. If you only have time to make one attack against a passing unit, the slower attack will inherently do more damage providing it hits.

Originally posted by amyhaf:
Is the following a good, at least Neanderthalic, way to think about this? More often than not, if a unit is within its handattack range of an opposing unit for one second, it deals its damage value1 to that opponent.

For the units I listed above, this won't apply because they will do twice the listed damage :P
I always consider it on a per-attack basis simply because of the factors (ranged attack missing, multiple units attacking one target) that make things more complicated.

Oh yeah, Perseus' melee attack is 1.5 seconds, so he should be doing MORE than the listed damage per attack.
Last edited by Loggy; 17 Dec, 2019 @ 8:36am
amyhaf 17 Dec, 2019 @ 2:10pm 
Originally posted by Loggy:
no matter which attack is rolled.
So is this determination a 1d 'amount of diff attacks' roll then? Can we weight?

Originally posted by Loggy:
Missed ranged attacks simply do 0 damage for the sake of DPS. Take for instance Hippolyta, the worst of the Greek classical heroes. She has a 2s attack anim time. Because accuracy increases per shot consecutively fired at the same target (this is a whole other topic that has not been researched extensively) and missing hurts her so much, she is way worse than Odysseus who fires every 1.2s. This is because she's terribly inaccurate on the first shot, resulting in inconsistent damage output that also wastes a lot on overkill due to her slow anim time.
As I suspected, if a (albeit ranged) dps attack misses, it misses. If a dps attack hits, it hits. All of which feels very much like a per attack vs per second system.

Originally posted by Loggy:
I always consider it on a per-attack basis simply because of the factors (ranged attack missing, multiple units attacking one target) that make things more complicated.
And there it is. Thank you for your honesty with this statement, it's actually what I needed to hear.

The only caveat is I am such a control freak when I mod, the fact that I have to set a units damage value and then go check the animation file to make sure that is the damage his attack is actually doing (and not 1.5X that amount or what have you) is very bad for my OCD.

So close (to a simple per attack setup)... and yet...

Originally posted by Loggy:
Oh yeah, Perseus' melee attack is 1.5 seconds, so he should be doing MORE than the listed damage per attack.
Confirmed.

Oddly he always does +1 base damage than what I set his proto at. Maybe the 'hero flag' or something.

Oh and the weirdest thing ever... his handattack rate value of 5 seems to have zero affect on anything even when manipulated. *wink*
Last edited by amyhaf; 17 Dec, 2019 @ 2:13pm
Loggy 27 17 Dec, 2019 @ 2:14pm 
Originally posted by amyhaf:
Can we weight?

If you were creative with the anim files, almost certainly. I don't see any reason why you can't just add duplicates to create whatever ratio you want.

Originally posted by amyhaf:
Oddly he always does +1 base damage than what I set his proto at. Maybe the 'hero flag' or something.

That is puzzling. Considering he's a hero it could be an invisible tech effect...
amyhaf 17 Dec, 2019 @ 2:19pm 
Originally posted by Loggy:
Originally posted by amyhaf:
Can we weight?

If you were creative with the anim files, almost certainly. I don't see any reason why you can't just add duplicates to create whatever ratio you want.
But beyond that, if you list 3 attacks (in anim but I assume also in proto or the anim attack has no data) there is a straight 33% chance of which attack is fired?

Originally posted by amyhaf:
the fact that I have to set a units damage value and then go check the animation file
Actually I lied here... I have no idea how/where you are checking to find that Perseus does *1.5 per second
Last edited by amyhaf; 17 Dec, 2019 @ 2:20pm
Loggy 27 17 Dec, 2019 @ 2:28pm 
The easiest way to check animation lengths is using the editor's animation viewer for the unit in question.
< >
Showing 1-15 of 18 comments
Per page: 1530 50