Page 1 of 1

Display Graze Chance

Posted: Sat Feb 18, 2017 8:56 am
by Ithuriel
As of the moment, the interface will show us our chance to hit, as well as our chance to hit a critical shot. However, it doesn't show you your chance to graze at all. While the graze band is, by default, +/- 10% of your aim, there are also other factors, such as Grazing Fire and most importantly alien's dodge. I can see the impact an alien's dodge will have on my chances to land a crit, but not to if I'll graze the target... I can't see any balance reason that we can see hit chance and critical hit chance, but not our chance to graze- it seems inconsistent.

I understand interface limitations all too well, but would it be unbalancing to show the player their chance of a normal hit/grazing hit? If not, would it be possible to display it?

Re: Display Graze Chance

Posted: Sat Feb 18, 2017 9:15 am
by sectoidfodder
Seconded. Might as well show graze since it's the mechanical opposite of crit and crit is shown, could be done numerically next to crit % like Perfect Information does, just without all the other bells and whistles that might be too much info for newbies.

Then the actual hit chance display can be fixed to show "chance to not miss" instead of the current value that's usually (not always) somewhere between your chance to land a solid hit and your chance to hit at all.

Re: Display Graze Chance

Posted: Sat Feb 18, 2017 9:43 am
by Phantom
MAybe adress this to the mod authors of perfect information.

Re: Display Graze Chance

Posted: Sat Feb 18, 2017 9:49 am
by Ithuriel
This could be for perfect information? I simply brought it up here because I thought it was a reasonable hub for discussion.

@sectoidfodder- isn't it always that your "to-hit" value is something along the lines of (chance of normal hit) + (chance of graze) + (chance of crit) -10 ? So your chance to graze is (% hit) - (% crit) + 10 - (something unknown due to dodge >.<)

Re: Display Graze Chance

Posted: Sat Feb 18, 2017 12:40 pm
by sectoidfodder
Ithuriel wrote:your "to-hit" value is something along the lines of (chance of normal hit) + (chance of graze) + (chance of crit) -10

Doesn't that strike you as a really arbitrary value to display? It's always offset by -10 from "your chance to deal any damage at all," and depending on crit/dodge can be anywhere relative to "your chance to deal at least normal damage."

Also PI's breakdown bar is currently wrong because it assumes the displayed chance to be normal + graze + crit, which I consider to be more of a LW2 problem than a PI problem.

Re: Display Graze Chance

Posted: Sat Feb 18, 2017 10:25 pm
by Ithuriel
sectoidfodder wrote: Doesn't that strike you as a really arbitrary value to display? It's always offset by -10 from "your chance to deal any damage at all," and depending on crit/dodge can be anywhere relative to "your chance to deal at least normal damage."
You're preaching to the choir here, mate ^^ I think it's completely bonkers, which is why I brought it up. I could see it making sense if the crit display showed your % chance of landing a crit once you hit, but as is the mismatch is bizarre.

Re: Display Graze Chance

Posted: Sun Feb 19, 2017 12:28 am
by Devon_v
Grazing Fire doesn't interact with the shot breakdown at all. It's a separate 50-Dodge% chance to Graze after the attack has been confirmed to be a miss.

Displaying the Graze chance would be handy however because Crit and Dodge will make it not always equal to exactly +/-10.

Re: Display Graze Chance

Posted: Sun Feb 19, 2017 3:57 am
by Ithuriel
@Devon_v- Oh, does Grazing Fire suffer a penalty from dodge? I thought it was just "If you miss, you have a 50% chance to graze instead." But regardless of which of these is true, you can still calculate ahead of time the exact chance of a graze with grazing fire active.

Re: Display Graze Chance

Posted: Sun Feb 19, 2017 10:57 am
by LordYanaek
Ithuriel wrote:you can still calculate ahead of time the exact chance of a graze with grazing fire active.
Yes you can. It would just add (0.5-dodge)*(1-"total chance to hit or graze") to the "grazing band"
This could easily be calculated but i don't know whether PI can handle both vanilla and LW2 in a single mod. I'm still using it but i would definitely like a new shotbar (it's the only part of PI i actually use) made for LW2, or even integrated into LW2 because as you said, the current displayed values aren't terribly useful.

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 5:42 am
by Ithuriel
LordYanaek wrote:
Ithuriel wrote:you can still calculate ahead of time the exact chance of a graze with grazing fire active.
Yes you can. It would just add (0.5-dodge)*(1-"total chance to hit or graze") to the "grazing band"
This could easily be calculated but i don't know whether PI can handle both vanilla and LW2 in a single mod. I'm still using it but i would definitely like a new shotbar (it's the only part of PI i actually use) made for LW2, or even integrated into LW2 because as you said, the current displayed values aren't terribly useful.
Do you know anything about how PI is coded? I haven't modded XCOM2 before, but I'm a programmer by trade and if I delve into the code I should be able to modify it to work for Long War...

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 7:50 am
by Bluescreen
How the Dark Event Grazing Fire works exactly? The ufopaedia states that its chance is 33%. It means every third misses of the relevant enemy units become a graze? Its insane in that case.

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 8:49 am
by LordYanaek
Ithuriel wrote: Do you know anything about how PI is coded? I haven't modded XCOM2 before, but I'm a programmer by trade and if I delve into the code I should be able to modify it to work for Long War...
Unfortunately no. I'm not a programmer thought i dabbed into scripting languages at occasions and never modded XCom beyond simple ini editing. The sources are included with the mod if you want to have a look. Also the shotbar itself was first developed as an independent mod prior to it's inclusion and it's still available so if you don't want to deal with all of PI but only the shotbar that displays crit/hit/dodge/miss chances it might be easier. You'll probably want to contact GrimyBunyip if you plan to modify his mod for LW2 but i trust being a programmer you knew this :)
Bluescreen wrote:How the Dark Event Grazing Fire works exactly? The ufopaedia states that its chance is 33%. It means every third misses of the relevant enemy units become a graze? Its insane in that case.
As far as ai know the perk works exactly like the XCom perk turning 50% of misses into grazes. 33% is the chance a particular enemy unit will actually have the perk so 33% of advent gunners will have 50% of their misses being grazes.

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 3:09 pm
by Bluescreen
LordYanaek wrote:
Ithuriel wrote: Do you know anything about how PI is coded? I haven't modded XCOM2 before, but I'm a programmer by trade and if I delve into the code I should be able to modify it to work for Long War...
Unfortunately no. I'm not a programmer thought i dabbed into scripting languages at occasions and never modded XCom beyond simple ini editing. The sources are included with the mod if you want to have a look. Also the shotbar itself was first developed as an independent mod prior to it's inclusion and it's still available so if you don't want to deal with all of PI but only the shotbar that displays crit/hit/dodge/miss chances it might be easier. You'll probably want to contact GrimyBunyip if you plan to modify his mod for LW2 but i trust being a programmer you knew this :)
Bluescreen wrote:How the Dark Event Grazing Fire works exactly? The ufopaedia states that its chance is 33%. It means every third misses of the relevant enemy units become a graze? Its insane in that case.
As far as ai know the perk works exactly like the XCom perk turning 50% of misses into grazes. 33% is the chance a particular enemy unit will actually have the perk so 33% of advent gunners will have 50% of their misses being grazes.
Thank you, its a little better, its only 16.5 % (0.33X0.5) graze chance, not 33 %.

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 4:40 pm
by LordYanaek
You can use a mod such as "show me more buffs details" to actually see which trooper had a bonus perk added so you know who you should focus. Well, i tend to focus gunners due to their high damage anyway but it's good to know. Navigators in LW1 were easy to identify, this mod gives you the same ability in LW2

Re: Display Graze Chance

Posted: Mon Feb 20, 2017 5:50 pm
by Bluescreen
LordYanaek wrote:You can use a mod such as "show me more buffs details" to actually see which trooper had a bonus perk added so you know who you should focus. Well, i tend to focus gunners due to their high damage anyway but it's good to know. Navigators in LW1 were easy to identify, this mod gives you the same ability in LW2
Nice mod, but - I know there is a compatibility list - i'm a little worried to use any other mod beside long war before i finish my current campaign. Maybe next playthrough i make a heavily modded one.

Re: Display Graze Chance

Posted: Tue Feb 21, 2017 1:15 am
by Ithuriel
LordYanaek wrote:
Ithuriel wrote: Do you know anything about how PI is coded? I haven't modded XCOM2 before, but I'm a programmer by trade and if I delve into the code I should be able to modify it to work for Long War...
Unfortunately no. I'm not a programmer thought i dabbed into scripting languages at occasions and never modded XCom beyond simple ini editing. The sources are included with the mod if you want to have a look. Also the shotbar itself was first developed as an independent mod prior to it's inclusion and it's still available so if you don't want to deal with all of PI but only the shotbar that displays crit/hit/dodge/miss chances it might be easier. You'll probably want to contact GrimyBunyip if you plan to modify his mod for LW2 but i trust being a programmer you knew this :)
Thanks for the advice! And of course I'm well aware you need to contact the original developer ^^
Bluescreen wrote:
LordYanaek wrote:
Bluescreen wrote:How the Dark Event Grazing Fire works exactly? The ufopaedia states that its chance is 33%. It means every third misses of the relevant enemy units become a graze? Its insane in that case.
As far as ai know the perk works exactly like the XCom perk turning 50% of misses into grazes. 33% is the chance a particular enemy unit will actually have the perk so 33% of advent gunners will have 50% of their misses being grazes.
Thank you, its a little better, its only 16.5 % (0.33X0.5) graze chance, not 33 %.
This isn't quite correct, Bluescreen. For arguments sake, assume that only ADVENT Gunners are eligible for Grazing Fire. This means that 1 out of every 3 ADVENT Gunners will have the perk "Grazing Fire." That 1 gunner will graze you instead of miss you 50% of the time. Does that make sense?

Re: Display Graze Chance

Posted: Tue Feb 21, 2017 10:52 am
by sectoidfodder
As someone who made a rough hit chance display mod before PI, I can tell you what will probably work:

In the file

Code: Select all

XCom_Perfect_Information_UITacticalHUD_ShotHUD.uc
find both appearances of

Code: Select all

kBreakdown.FinalHitChance
and replace them with

Code: Select all

kBreakdown.ResultTable[eHit_Success] + kBreakdown.ResultTable[eHit_Crit] + kBreakdown.ResultTable[eHit_Graze]
FinalHitChance is only used by the UI and LW2 never updated it to include graze band, while the result table is actually used to roll the shot and is entirely correct, so just use that instead. This also shouldn't break anything for vanilla players.

The problem is that in order to make that change you'd have to make your own project, copy the entirely of PI's source code (available for reference in your steam workshop folder), make that change, then publish the new mod. Not something I want to do w/o getting in contact with PI's creator. Also there's the matter of the 40GB+ download that is the XCom 2 dev kit, which won't fit on my SSD so I'd have to deal with compiling and debugging off a HDD, going through multiple loading screens every time I want to test something... as wonderful as XCom 2's mod support is, there's just too much overhead for my level of casual tinkering.