Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > Fantasy Wars

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.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2008, 12:08 AM
shinyhalo shinyhalo is offline
Registered Member
 
Join Date: Dec 2007
Posts: 12
Default 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
Reply With Quote
  #2  
Old 01-12-2008, 12:27 AM
bman654 bman654 is offline
Approved Member
 
Join Date: Jan 2008
Posts: 226
Default

Well, the damage is some-what random so I would say that K is not always the same but is some random distribution.
Reply With Quote
  #3  
Old 01-12-2008, 12:53 AM
shinyhalo shinyhalo is offline
Registered Member
 
Join Date: Dec 2007
Posts: 12
Default

Quote:
Originally Posted by bman654 View Post
Well, the damage is some-what random so I would say that K is not always the same but is some random distribution.
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.
Reply With Quote
  #4  
Old 01-17-2008, 05:33 PM
shinyhalo shinyhalo is offline
Registered Member
 
Join Date: Dec 2007
Posts: 12
Default

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?
Reply With Quote
  #5  
Old 01-17-2008, 06:01 PM
bman654 bman654 is offline
Approved Member
 
Join Date: Jan 2008
Posts: 226
Default

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.
Reply With Quote
  #6  
Old 01-17-2008, 09:59 PM
shinyhalo shinyhalo is offline
Registered Member
 
Join Date: Dec 2007
Posts: 12
Default

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.
Reply With Quote
  #7  
Old 01-18-2008, 01:41 AM
bman654 bman654 is offline
Approved Member
 
Join Date: Jan 2008
Posts: 226
Default

lines that have '--' in them are just comments and do not do anything.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.