|
Fantasy Wars Turn-based strategy. Gather an army, upgrade units, study magic spells, participate in castle sieges and assaults to destroy the great Orc Ugraum’s horde. |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Where is the K coefficient please?
The manuals describes the formula for calculating damage as:
M(damage) = (Attack Skill / Defense Skill) * (Current hitpoints / Initial hitpoints) * K I have looked but I can't find K. Is K always the same? For that matter, I can only seem to find half of the above formula in battle.script Is there a cleanly written version of the whole formula anywhere in the data files? Thanks |
#2
|
|||
|
|||
Well, the damage is some-what random so I would say that K is not always the same but is some random distribution.
|
#3
|
|||
|
|||
So I can't find K because it's not written as a single, fixed constant, but instead as another formula(random distribution). Interesting possibility. I have seen some "random damage" type formulas.
|
#4
|
|||
|
|||
Well, I've been changing a bunch of numbers in battle.script and testing after each one, but I can't seem to figure it out.
I'm trying to multiply the damage units do to each other by 5 without altering the Attack/Defense ratio. Obviously, if I just multiplied their Attack by 5 in UnitTypes.csv, I'd get more damage but that would throw the Attack/Defense values out of balance. Any ideas on how to multiply the final casualty numbers by 5? |
#5
|
|||
|
|||
Look in ApplyAttackToDetachment() at the variable randomisedCasualties. This appears to be the damage done to the unit. Note: damage is health and each unit has 15 little guys and each of those little guys has health. So "15" damage may only mean 1 little guy dies.
But anyway, there is a for() loop near the end of the function that goes from 0 to randomisedCasualties and applies the damage to the unit. Just before this for() loop, try multiplying randomisedCasualties by 5 and it should have the effect you want. |
#6
|
|||
|
|||
Heh, sweet. Thanks!
I changed: averageCasualties = AttackAverageOfDistribution(targetDetachment, role, attackAction, currentAttackCount); to averageCasualties = 5 * AttackAverageOfDistribution(targetDetachment, role, attackAction, currentAttackCount); and changed --local maximumDeviation = 2; to --local maximumDeviation = 10; Tests show the damage is both increased and the Attack/Ratio is preserved, but I'm not sure if the random deviation +/- also got a 5x bump. It's not critical anyway. |
#7
|
|||
|
|||
lines that have '--' in them are just comments and do not do anything.
|
|
|