Post by sekira on Nov 8, 2009 18:24:11 GMT -5
I'm not sure this is the right place for this, as it will probably be greek to those who have never looked at the lua script code.
My issue is how the calc_bonuses function in passive.lua calculates each bonus... namely the order that each bonus is calculated.
Currently there are several places (I'm not sure how many, I haven't done an exhaustive audit of the function, it is quite huge) where a bonus (say bonus A) is calculated based on the value of another bonus (say bonus B). The problem is, because of the order that all the bonuses to B are calculated, some come after this bonus to A is calculated, so those later bonuses to B have no affect on A.
Take for example, my current character... Vrudish, the kobold warrior. He is a dex warrior relying heavily on the warrior ability battle skill to increase his damage, instead of relying on strength. I really like how the bonus to_hit from Battle skill and the bonus to_dam from battle skill are split.... that way you can get the to_hit boosted by dex, and then after that get the to_dam (which is a % of your to_hit) bonus. The problem I have, is I use swords for the sword spirit ability (more to hit should be more damage from battle skill, right?) but the sword spirit boost to_hit is AFTER the battle skill boost to_dam so that extra to_hit isn't calculated into the bonus to_dam. Same applies to the to_hit bonuses from blessing, heroism, high dual wield skill (another thing I will eventually depend on) and martial arts skill.
I look at calc_bonuses and I see just a few general formats of bonuses...
The idea is to calculate bonuses based on values that will never be modified by calc_bonuses first (such as AP in an ability, alignment, misfortune, or base stat or skill)
- These include any ability that gives a flat bonus to a stat or skill per AP in that ability
Next, calculate bonuses that involve a multiplication of the stat that is getting the bonus with one of the values that are never modified by calc_bonuses
Finally, calculate bonuses that involve a multiplication of stats that are modified inside calc_bonuses, but beware of the order so that each bonus gets the full value of the stat that it is using to calculate the bonus.
My issue is how the calc_bonuses function in passive.lua calculates each bonus... namely the order that each bonus is calculated.
Currently there are several places (I'm not sure how many, I haven't done an exhaustive audit of the function, it is quite huge) where a bonus (say bonus A) is calculated based on the value of another bonus (say bonus B). The problem is, because of the order that all the bonuses to B are calculated, some come after this bonus to A is calculated, so those later bonuses to B have no affect on A.
Take for example, my current character... Vrudish, the kobold warrior. He is a dex warrior relying heavily on the warrior ability battle skill to increase his damage, instead of relying on strength. I really like how the bonus to_hit from Battle skill and the bonus to_dam from battle skill are split.... that way you can get the to_hit boosted by dex, and then after that get the to_dam (which is a % of your to_hit) bonus. The problem I have, is I use swords for the sword spirit ability (more to hit should be more damage from battle skill, right?) but the sword spirit boost to_hit is AFTER the battle skill boost to_dam so that extra to_hit isn't calculated into the bonus to_dam. Same applies to the to_hit bonuses from blessing, heroism, high dual wield skill (another thing I will eventually depend on) and martial arts skill.
I look at calc_bonuses and I see just a few general formats of bonuses...
A = A + cB
A = A + cAB
A = A + cBC
A = A + cABC
where c is a constant, and A, B, and C are some character statistic
The idea is to calculate bonuses based on values that will never be modified by calc_bonuses first (such as AP in an ability, alignment, misfortune, or base stat or skill)
- These include any ability that gives a flat bonus to a stat or skill per AP in that ability
Next, calculate bonuses that involve a multiplication of the stat that is getting the bonus with one of the values that are never modified by calc_bonuses
Finally, calculate bonuses that involve a multiplication of stats that are modified inside calc_bonuses, but beware of the order so that each bonus gets the full value of the stat that it is using to calculate the bonus.