Jump to content

Welcome to Obsidian Forum Community
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

[435] Defences are not properly lowered from low attribute scores

Characters/Creatures

  • Please log in to reply
11 replies to this topic

#1
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

The BB fighter has average Dexterity and Perception, both 10. When he suffers a reduction of any of this two, the resulting value of the Reflex defence is by 1 point higher than it should be. I did some tests with different builds and spells -- and it looks like this issue holds for all the defences modified by the low sum of connected attributes.

The picture below shows different characters suffering by the bug:
Low_Attributes.jpg

For example, the first character has:
Deflection 25, Fortitude 19, Reflex 19, Will 19
-> Should have:
Deflection 24, Fortitude 18, Reflex 18, Will 18
and so on with others...

How to reproduce:
A) either, by putting Hobbled or similar effect on BB fighter -- the reflex defence will be off;
B) or create a new character from any of those in the picture above or similar (sum of two attributes modifying the tested defence to be < 20);


[comments]
According to several tests with different setups, the bug seems to occur only when the summed modifier from attributes is negative regardless to its value.

It's like the game does something like this for Deflection:
modifier = (Per - 10) + (Res - 10)
if (modifier < 0)  --> deflection = deflection + modifier +1
else                   --> deflection = deflection + modifier

And for Reflex defence (and similarly for For. and Will):
modifier = (Per - 10)*2 + (Dex - 10)*2
if (modifier < 0)  --> reflex = reflex + modifier +1
else                   --> reflex = reflex + modifier
 

Did some basic tests with attacking the corresponding defence and it seems the numbers are the same (wrong) in the combat log.

Leveling up also doesn't help with the issue.

 

Note: The first two character sheets also show the bug with bigger fonts (130%). The longer Background descriptions don't fit the sheet size. 

 



#2
Bazy

Bazy

    (5) Thaumaturgist

  • Members
  • 544 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

For example, the first character has:
Deflection 25, Fortitude 19, Reflex 19, Will 19
-> Should have:
Deflection 24, Fortitude 18, Reflex 18, Will 18
and so on with others...

I don't see what the problem is.

 

+10 Might = 10 Fort

+9 Con = 9 Fort 

 

10+9 = 19

 

Am I missing something?



#3
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

For Reflex, Fortitude and Will, there is +2 / -2 modifier to the corresponding defence per point of attribute above / below 10. And at lvl 1 the character will have the base 20 For / Ref / Will, without taking into account modifiers, if I recall correctly.

 

So if you look at the first sheet, there is already written +0 For from Mig = 10 and -2 For from Con = 9, then it should be For = 20 + 0 - 2 = 18.

 

Of course, the description and my estimation may be wrong. But your calculation would not work for the last character at all. As he has negative defences;)



#4
Sensuki

Sensuki

    Subway Apathist of the Obsidian Order

  • Members
  • 9963 posts
  • Location:Australia
  • Steam:STEAM_0:1:1229809
  • Pillars of Eternity Silver Backer
  • Kickstarter Backer
A while ago, there was a +0.5 added in the code for Fort/Ref/Will defenses. When I get home I'll check it to see if it's still there - that may be the cause if it's rounded up/down by 1.

#5
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

A while ago, there was a +0.5 added in the code for Fort/Ref/Will defenses. When I get home I'll check it to see if it's still there - that may be the cause if it's rounded up/down by 1.

 

Oh no, I'm being haunted by rounding demon... ;(

 

Thanks, Sensuki, much appreciated if you can catch it.



#6
Bazy

Bazy

    (5) Thaumaturgist

  • Members
  • 544 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

16 = 13   (-3)  --

17 = 15   (-2)  2

18 = 17   (-1)  2

19 = 19   (0)   2

20 = 20   (0 )  1

21 = 22   (+1)  2

22 = 24   (+2)  2

23 = 26   (+3)  2

24 = 28   (+4)  2

25 = 30   (+5)  2


Edited by Bazy, 11 February 2015 - 08:29 PM.


#7
Sensuki

Sensuki

    Subway Apathist of the Obsidian Order

  • Members
  • 9963 posts
  • Location:Australia
  • Steam:STEAM_0:1:1229809
  • Pillars of Eternity Silver Backer
  • Kickstarter Backer
Yeah it's the +0.5 from v301 or whatever hahah
 
public int CalculateDefense(DefenseType defenseType, AttackBase attack, GameObject enemy, bool isSecondary)
    {
        int num = (this.Level - 1) * AttackData.Instance.DefensePerLevel;
        switch (defenseType)
        {
            case DefenseType.Deflect:
            {
                num += this.Deflect;
                num += (int) (this.StatBonusDeflection + 0.5f);
                Equipment equip = base.gameObject.GetComponent<Equipment>();
                num += this.GetShieldDeflectBonus(equip);
                if ((enemy != null) && this.IsEnemyDistant(enemy))
                {
                    num += this.DistantEnemyBonus;
                }
                bool veilPiercing = false;
                if ((attack != null) && (attack is AttackRanged))
                {
                    veilPiercing = (attack as AttackRanged).VeilPiercing;
                }
                if (!veilPiercing)
                {
                    num += this.VeilDeflectionBonus;
                }
                break;
            }
            //////////////////////// PROBLEM RIGHT HERE /////////////////////////////
            case DefenseType.Fortitude:
                num += this.Fortitude;
                num += (int) ((GetStatDefenseTypeBonus(this.Might) + GetStatDefenseTypeBonus(this.Constitution)) + 0.5f);
                break;
            //////////////////////// PROBLEM RIGHT HERE /////////////////////////////
            case DefenseType.Reflex:
            {
                num += this.Reflex;
                num += (int) ((GetStatDefenseTypeBonus(this.Dexterity) + GetStatDefenseTypeBonus(this.Perception)) + 0.5f);
                Equipment equipment = base.gameObject.GetComponent<Equipment>();
                num += this.GetShieldReflexBonus(equipment);
                if ((enemy != null) && this.IsEnemyDistant(enemy))
                {
                    num += this.DistantEnemyBonus;
                }
                break;
            }
            //////////////////////// PROBLEM RIGHT HERE /////////////////////////////
            case DefenseType.Will:
                num += this.Will;
                num += (int) ((GetStatDefenseTypeBonus(this.Intellect) + GetStatDefenseTypeBonus(this.Resolve)) + 0.5f);
                break;

            case DefenseType.None:
                break;

            default:
                num += 50;
                break;
        }
        if (attack != null)
        {
            num += this.GetDefenseBonus(defenseType, attack, isSecondary);
        }
        AnimationController component = base.gameObject.GetComponent<AnimationController>();
        if (component != null)
        {
            if (component.CurrentReaction == AnimationController.ReactionType.Knockdown)
            {
                num += this.WhileKnockeddownDefenseBonus;
            }
            if (component.CurrentReaction == AnimationController.ReactionType.Stun)
            {
                num += this.WhileStunnedDefenseBonus;
            }
        }
        if (this.OnDefenseAdjustment != null)
        {
            int num2 = 0;
            this.OnDefenseAdjustment(defenseType, attack, enemy, isSecondary, ref num2);
            num += num2;
        }
        return (num + ((int) this.PotD_Bonus));
    }
Those +0.5 are no longer necessary because the calculation is no longer [Attribute A + Attribute B] x 1.5.

The +0.5 was added because I reported a bug with the rounding for that formula. That formula has now been changed to [Attribute A + Attribute B] x 2, so the cases where you have an odd numbered attribute don't lead to a fractional number anymore.

Edited by Sensuki, 11 February 2015 - 10:21 PM.

  • Arctic likes this

#8
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer
Ha, so your effort has actually bad impact on game;)

But now truly, well done! You are right these are whole numbers anyway...

I think in C this would mean they didn't take into account negative numbers? (so it wouldn't work even in that original calculation):
int(+3+0.5) -> 3
int(-3+0.5) -> -2

So it doesn't show any problems for positive sums of modifiers from attributes, but for the negative ones yes...
But I'm never sure about this things. This is C#?

#9
Sensuki

Sensuki

    Subway Apathist of the Obsidian Order

  • Members
  • 9963 posts
  • Location:Australia
  • Steam:STEAM_0:1:1229809
  • Pillars of Eternity Silver Backer
  • Kickstarter Backer
yep

#10
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

Also the same with the Deflection modifier, I guess?

num += (int) (this.StatBonusDeflection + 0.5f);

  • Sensuki likes this

#11
ushas

ushas

    (4) Theurgist

  • Members
  • 200 posts
  • Pillars of Eternity Backer
  • Kickstarter Backer
  • Deadfire Backer
  • Fig Backer

Bumping for BBv480.

 

If it's useful, I would like to add that the wrong negative modifier of defences from the sum of attributes doesn't only influence party members, but also enemies. In several instances, as a result of this issue they have a higher defence than should or the defence number isn't lowered enough by used debuff ability/spell.
-> So this time it also works against the player.

 

 

For example, Stone Beetle & BB Rogue ability Blinding strike:

 

On PoD difficulty Stone beetle has this attributes and defences:
Dexterity: 8, Perception: 12, Resolve:  12

Deflection: 56, Reflex: 47

 

Now we can see that in the beginning the modifiers from attributes aren't negative and thus probably working right (+0 to Refl from sum of Dex & Per, +4 to Defl from sum of Per & Res).

 

Blinding strike gives Blinded affliction:
-25 accuracy, -4 Perception, -2 Move speed, -20 Reflex, -20 Deflection

 

When the enemy is affected by the debuff, the modifier from the sum of Dexterity and Perception becomes negative:

[ ( Per - 10 ) * 2  +  ( Dex - 10 ) * 2 ]   =  -8 to Reflex

So the new Reflex number should be 47 - 20 - 8 = 19.

 

But the resulting Reflex defence used in game is 1 point higher.  For example, see the scenario of three attack following each other in game:
Stone_Beetle.jpg
Deflection: 32
Reflex: 20



#12
shmerl

shmerl

    (3) Conjurer

  • Members
  • 101 posts
  • Deadfire Backer
  • Fig Backer

On the community bug tracker: https://github.com/P...acker/issues/12







Also tagged with one or more of these keywords: Characters/Creatures

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users