Page 1 of 1

UI hit chance doesn't count graze band or crit promote

Posted: Sun Jan 29, 2017 9:07 pm
by sectoidfodder
Pretty sure this should be a bug, since the UI attempts to factor in the contribution from dodge demotes, but not graze band or crit promotes.

Example: 70% weapon hit, 60% weapon crit, +/-10% graze band. Shot breakdown should be 36% crit, 36% hit, 8% graze, 20% miss. UI instead shows "70% to hit" and "36% to crit." The hit chance reflects neither the crit+hit sum (72%) nor the crit+hit+graze sum (80%).

Example with dodge: 20% dodge added to the above. Shot breakdown should be 29% crit, 36% hit, 13% graze, 22% miss. UI instead shows "68% to hit" with a "dodge -2%" modifier that represents the graze->miss demote, when the actual hit chance should be 78%.

Re: UI hit chance doesn't count graze band or crit promote

Posted: Mon Jan 30, 2017 11:54 pm
by sectoidfodder
I believe I've found the problem:

Code: Select all

StandardAim.m_ShotBreakdown.FinalHitChance = StandardAim.m_ShotBreakdown.ResultTable[eHit_Success] + Adjustments.DodgeHitAdjust;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Crit] = Adjustments.FinalCritChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Success] = Adjustments.FinalSuccessChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Graze] = Adjustments.FinalGrazeChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Miss] = Adjustments.FinalMissChance;
FinalHitChance is what the UI displays, and right now all it does is take the pre-graze-band hit chance and subtract dodge demote, which is wrong. Hopefully the actual shot roll doesn't use FinalHitChance, because then the actual hit calculation would be off (rather than just the UI display).

Something like this should work:

Code: Select all

StandardAim.m_ShotBreakdown.ResultTable[eHit_Crit] = Adjustments.FinalCritChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Success] = Adjustments.FinalSuccessChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Graze] = Adjustments.FinalGrazeChance;
StandardAim.m_ShotBreakdown.ResultTable[eHit_Miss] = Adjustments.FinalMissChance;
StandardAim.m_ShotBreakdown.FinalHitChance = Adjustments.FinalSuccessChance + Adjustments.FinalCritChance + Adjustments.FinalGrazeChance;

Re: UI hit chance doesn't count graze band or crit promote

Posted: Sat Feb 04, 2017 9:20 pm
by Amineri
I'm pondering what to do with this.

You are correct that crit in general reduces the graze band chances, so using hit + crit + 1/2 (graze) the displayed value is no longer accurate. However, increasing the displayed hit chance (while mathematically correct in some sense) is also misleading in some sense because the chance to miss has not been altered.

Re: UI hit chance doesn't count graze band or crit promote

Posted: Sun Feb 05, 2017 7:14 am
by sectoidfodder
Graze band alters the chance to miss though, so I think the current UI is already misleading because showing crit + hit + half graze isn't really intuitive. We're not arbitrarily weighing crit vs hit, so why only half graze? It makes the most sense to me if the UI just shows total crit+hit+graze chance, which is conveniently what existing hit chance display mods assume FinalHitChance is.

The shot wing will need an extra line like "graze band +10%" so the modifiers add up properly. Though short of explicitly showing graze chance (or crit + hit + graze and crit + hit side-by-side) I can't think of a good way to convey to the player that it's also making full damage less likely, and isn't some sort of difficulty handicap.