Inconsistency in Dodge calculation

MikeB

Staff member
Loreseeker
Joined
31/10/2016
Messages
1,444
Location
Germany
In the description of the Dodge proficiency, it states "+5 for each DEX point above 4, and +2 for each AWA point above 4".

However, when playing with trait values in the character creation screen, it can easily be seen that Dodge follows the same rules as other skills/proficiencies, i.e. +4/+2 for every point above 4 of the primary/secondary trait, and -2/-1 penalty for every point below 4 of the primary/secondary trait, respectively.

So negative Dodge and therefore negative Avoidance is possible (and actually occurs in the game, e.g. when looking at the stats of Sage Crabs).

@DavidBVal: Is this a calculation bug or is the description wrong?
 

Mogura

New member
Joined
17/01/2020
Messages
13
If I understand correctly, this is how dodge is calculated:
The proficiency total is calculated by adding the trait bonus and the proficiency base value
C#:
 public int GetProficiencyTotal(string skill_id)
    {
      int skillTraitBonus = CalculatedStats.GetSkillTraitBonus(this, skill_id);
      int num1 = Skills.GetProficiencyBaseValue(skill_id) + this.GetProficiencyTrained(skill_id);
      int num2 = 0;
      foreach (SheetBonus bonuse in this.bonuses)
        num2 += bonuse.GetBonus().GetSkillValue(skill_id);
      return skillTraitBonus + num1 + num2;
    }
The trait bonus is calculated here like you said, with +4 for the primary and +2 for the secondary trait
C#:
 public static int GetTraitBonus(CharacterSheet sheet, TraitSet.Trait trait, bool primary)
    {
      int num = sheet.GetTrait(trait) - 4;
      if (num == 0)
        return 0;
      return num > 0 ? (primary ? num * Mechanics.SKILL_BONUS_PRIMARY_TRAIT : num * Mechanics.SKILL_BONUS_SECONDARY_TRAIT) : (primary ? num * 2 : num);
    }
Where
SKILL_BONUS_PRIMARY_TRAIT = 4;
SKILL_BONUS_SECONDARY_TRAIT = 2;
And dodge uses the same method (CharacterSheet.GetProficiencyTotal) in the code as the others
C#:
 public static int Dodge(CharacterSheet sheet)
    {
      int proficiencyTotal = sheet.GetProficiencyTotal("dodge");
      CharacterSheet.LAST_ENHANCEMENT_BONUSES_CHECKED = 0;
      foreach (SheetBonus bonuse in sheet.bonuses)
      {
        proficiencyTotal += bonuse.GetBonus().GetValue(StatsInfo.Stat.Dodge);
        if (bonuse.enhancement)
          CharacterSheet.LAST_ENHANCEMENT_BONUSES_CHECKED += bonuse.GetBonus().GetValue(StatsInfo.Stat.Dodge);
      }
      int num1 = 0;
      float num2 = Math.Min(0.2f, (float) Math.Max(0, CalculatedStats.GetArmorTraining(sheet) - sheet.ArmorBulk()) * 0.05f);
      switch (sheet.ArmorCategory())
      {
        case ArmorStats.ArmorCategory.Light:
          num1 = (int) Math.Round((double) proficiencyTotal * (0.20000000298023224 - (double) num2));
          break;
        case ArmorStats.ArmorCategory.Heavy:
          num1 = (int) Math.Round((double) proficiencyTotal * (0.5 - (double) num2));
          break;
      }
      if (num1 <= 0 || proficiencyTotal <= 0)
        return proficiencyTotal;
      CharacterSheet.LAST_ENHANCEMENT_BONUSES_CHECKED -= num1;
      return proficiencyTotal - num1;
    }
And as you know Dodge and Deflect are added together to get avoidance:
C#:
public static int Avoidance(CharacterSheet sheet)
    {
      return sheet.IsHelpless() ? 0 : CalculatedStats.Dodge(sheet) + CalculatedStats.Deflect(sheet);
    }
So I'm not sure why the character panel says it's +5. It's weird, because in a script called "CharacterWindow", it looks like it uses the same method to calculate the avoidance. I'll have to look into it further.
C#:
num = CalculatedStats.Avoidance(this.sheet);
    string str5 = num.ToString() + "%";
    avoidance.text = str5;
 

DavidBVal

Developer
Staff member
Administrator
Joined
28/02/2015
Messages
7,585
In the description of the Dodge proficiency, it states "+5 for each DEX point above 4, and +2 for each AWA point above 4".

However, when playing with trait values in the character creation screen, it can easily be seen that Dodge follows the same rules as other skills/proficiencies, i.e. +4/+2 for every point above 4 of the primary/secondary trait, and -2/-1 penalty for every point below 4 of the primary/secondary trait, respectively.

So negative Dodge and therefore negative Avoidance is possible (and actually occurs in the game, e.g. when looking at the stats of Sage Crabs).

@DavidBVal: Is this a calculation bug or is the description wrong?

The "+5 bonus per DEX point" description is outdated, I'll update the description. It's indeed +4 / +2.
 

Top