How is the damage determined?
Moderator: Forum Moderators
How is the damage determined?
It's one of those questions that's been bothering me for a while. I'm curious how does the damage equation look like-how damage bonuses (ToD and resistance) are added. Which leads me to another question - when and how does the rounding occur. We all know that fractions does not appear in game, so there must be a rounding process. Does it happen at the very end? Or after every step? And is it always rounded down, up, or something custom (like <.5 rounded down and >=.5 rounded up)?
I've came up with two possible equations, I hope they will clarify a bit what I mean:
Let x be the final damage, a the base damage, b the ToD bonus and c the resistance bonus.
x = a(1+b)(1+c)
x = a(1+b+c)
The difference may seem small, but we've all seen those lucky scouts with 1hp left who then retreat and heal.
I've came up with two possible equations, I hope they will clarify a bit what I mean:
Let x be the final damage, a the base damage, b the ToD bonus and c the resistance bonus.
x = a(1+b)(1+c)
x = a(1+b+c)
The difference may seem small, but we've all seen those lucky scouts with 1hp left who then retreat and heal.
Oh, I'm sorry, did I break your concentration?
Re: How is the damage determined?
It's the first formula. Modifiers are multiplied sequentially, not added and then multiplied. As for rounding, fractions greater than 1/2 round up, and fractions less than 1/2 round down, with exactly 1/2 being rounded toward the base damage.
For instance, a strong spearman at day with leadership:
Damage = base damage * leadership modifier * daytime modifier = 8 * 1.25 * 1.25 = 12.5 Since 12.5 is greater than base damage, it rounds down to 12.
For instance, a strong spearman at day with leadership:
Damage = base damage * leadership modifier * daytime modifier = 8 * 1.25 * 1.25 = 12.5 Since 12.5 is greater than base damage, it rounds down to 12.
Re: How is the damage determined?
oh, thanks! I'm actually glad to hear that because that is exactly how I would do it
Now it will be much easier for me to plan my attacks!
Now it will be much easier for me to plan my attacks!
Oh, I'm sorry, did I break your concentration?
Re: How is the damage determined?
Well, it'd be easier to do the damage calculations mentally if it was addition of all modifiers, then multiplication, but this yields satisfactory results as well
Re: How is the damage determined?
Sorry Caphriel,
ist not the first but the second formula, which can easily be seen by using leadership on the unfavorable time of day. They cancel out since (1+0.25-0.25)=1 were as the first formula would suggest (1+0.25)(1-0.25)=(1-0.0625)=0.9375. Of course the difference between between these 2 formulas could only be seen for heavy hitters like Infantryman (11*1=11, 11*0.9375=10.3, Infantrymen does 11 supported with leadership at nightime)
ist not the first but the second formula, which can easily be seen by using leadership on the unfavorable time of day. They cancel out since (1+0.25-0.25)=1 were as the first formula would suggest (1+0.25)(1-0.25)=(1-0.0625)=0.9375. Of course the difference between between these 2 formulas could only be seen for heavy hitters like Infantryman (11*1=11, 11*0.9375=10.3, Infantrymen does 11 supported with leadership at nightime)
Re: How is the damage determined?
Hmm. I asked this same question ages ago, and I'd swear one of the devs/mods/etc. told me it they were multiplied in sequence, not added and then multiplied. Well, if that's the case, then I guess I'll have to update my notes
If that's the case, it's not only relevant with heavy hitters, but also in cases of high resistance/weakness to a damage type, because it also means that cumulative bonuses stack less than I thought.
If that's the case, it's not only relevant with heavy hitters, but also in cases of high resistance/weakness to a damage type, because it also means that cumulative bonuses stack less than I thought.
Re: How is the damage determined?
I'm pretty sure that leadership and time of day are added together, and then multiplied by resistance.
Re: How is the damage determined?
Well, the game is open source, so anyone who wants to go poking through the code could go find out how it's calculated. I might do it later today after work if I have time.
Re: How is the damage determined?
I tested to work this out for myself a while back. It's not quite as definite as consulting the source code, but I'm also pretty confident that ToD and Leadership modifiers are added, then multiplied by resistances.
This makes leadership better than I'd expected at adverse times of day, and worse than expected at favourable times of day.
This makes leadership better than I'd expected at adverse times of day, and worse than expected at favourable times of day.
Re: How is the damage determined?
Yup. It's a sad sad world.
Why not just look up the answer in the game files?
Why not just look up the answer in the game files?
My new account is: Power_Pixel_Wannabe. Yea. Yea.... Why are you still reading this? What the heck m8? You have some kind of problem? Yea. I draw. NO I'M NOT 5 ANYMORE!!! Little brats.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
Re: How is the damage determined?
Go ahead, and let us know what you find. Thanks!
Re: How is the damage determined?
I'm not sure where to look?
My new account is: Power_Pixel_Wannabe. Yea. Yea.... Why are you still reading this? What the heck m8? You have some kind of problem? Yea. I draw. NO I'M NOT 5 ANYMORE!!! Little brats.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
Re: How is the damage determined?
powershot wrote: Why not just look up the answer in the game files?
Bingo!powershot wrote:I'm not sure where to look?
Oh, I'm sorry, did I break your concentration?
Re: How is the damage determined?
Maybe there is no specifying file...
My new account is: Power_Pixel_Wannabe. Yea. Yea.... Why are you still reading this? What the heck m8? You have some kind of problem? Yea. I draw. NO I'M NOT 5 ANYMORE!!! Little brats.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
The heck m8? I thought you left... No seriously... go... serious...
ok bye m8. I'm serious.
Re: How is the damage determined?
...moving on- it seems like Ant is right. I checked it by modifying orcish archer file so it would have 10000-2 fire attack and attacked wose at night with elvish captain next to archer. Surprisingly enough, the archer had 15000-2 attack - the only possibility is formula Ant mentioned. So it looks like this:
x = b (1+l+t)(1+r) where b=base damage l=leadership bonus t=ToD bonus and r=resistance bonus
Mmm... math... yummy...
P.S:I also checked the result at night and conclusion was the same
x = b (1+l+t)(1+r) where b=base damage l=leadership bonus t=ToD bonus and r=resistance bonus
Mmm... math... yummy...
P.S:I also checked the result at night and conclusion was the same
Oh, I'm sorry, did I break your concentration?