XCOM 2
60 ratings
[WOTC] LWoTC Aim Rolls
2
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
201.151 KB
4 Feb @ 2:48pm
20 Jul @ 1:24pm
2 Change Notes ( view )

Subscribe to download
[WOTC] LWoTC Aim Rolls

Description
What Is This?
This is an alternative implementation of EU Aim Rolls with similar goals of making the hit results more logical. This version uses the implementation currently used by Long War of The Chosen, made standalone. The implementation used by EU Aim Rolls is very intrusive and bad for compatibility, such as not working with XModBase, including mods such as LW2 Classes and Perks, Shadow Ops classes, Extended Perk Pack, and more. This version uses a newer Highlander hook to maintain compatibility. It is not a 1:1 replacement for EU Aim Rolls as it doesn't have the configurable height adjustments, those cannot be implemented without additional CHL changes

Features:
  • Hit/Crit/Dodge merged together so no more "all hits are crits" for lower percentage shots.
  • Implements LW's Graze Band. Can be adjusted or turned off via Mod Config Menu.
  • Better compatibility with other mods by being less intrusive.
  • Debug logging available if you want to see behind the scenes in your own game.
  • Config toggles for Negative Dodge behavior and whether Dodge can convert grazes to misses (more in the next section).
How Does It Work?
Instead of overriding the X2AbilityToHitCalc_StandardAim class, instead this uses a newer OverideFinalHitChance hook added by Highlander, allowing for this to work with more things. There are some differences from EU Aim Rolls, so here's how the calculations work:
  1. Graze Band: Graze band takes equally from the hit chance and miss chances. With the default parameters, that means 10% from each side, so net +10% chance to deal damage. Extremely high or extremely low hit chances can negate the graze band.
  2. Crit (and negative Dodge) provide a chance for normal hits to be upgraded into crits, and grazes upgraded into normal hits. E.G. 10% crit chance equals 10% of the normal hit bar becoming crit and 10% of the graze section becoming normal hit.
  3. Positive Dodge demotes hits by one roll based on its value. E.G, with 10 dodge, 10% of the crit bar gets turned back into normal hit, 10% of normal hit gets turned into graze, and 10% of graze gets turned into a miss. Whether dodge can demote grazes into misses is open to configuration. Basically, LW's implementation forces the HYBRID_CRIT_DODGE config option of EU aim rolls on.
  4. The result of this is the hit chances you see.

Copyrite has implemented a calculator[copyrite.github.io] that implements the hit chance calculation and provides a good visual explanation of how the system works.

Compatibility:
This should work fine with most other mods, don't use this with EU Aim Rolls for obvious reasons. Also not needed with LWoTC itself.

Credits:
RustyDios for the preview image, Iridar, Zelfana, and SwfDelicious for helping out with my questions on MCM and various other things.


21 Comments
Haywire 23 Jul @ 4:32pm 
Cool. Thank you for the quick reply! Enjoy the day! 😊
Tedster  [author] 23 Jul @ 3:54pm 
It likely is, I'd just need to look into the implementation, as this started as a port of LWOTC's functionality itself.
Haywire 23 Jul @ 3:33pm 
Will it be possible to implement Absolutely Critical back into the Second Wave options? The old EU Aim Rolls included it. Just wondering. 🙂
Vaultwulf 19 Jul @ 8:13pm 
@Tedster Nice job! Awesome mod! :steamthumbsup: :steamthis:
Tedster  [author] 6 Feb @ 9:10am 
LWoTC already uses this look, I pulled the code straight from LWoTC. LWoTC incorporates XModBase, which swaps out the X2AbilityToHitCalc_StandardAim which is a separate issue. I'd probably have to incorporate configurable aiming angles into XModBase.
MrMister 6 Feb @ 1:06am 
Huh; shame this can't be used to hook in aiming angles then.

On another note - @Tedster , will you be switchng LWOTC's to this hook instead of overriding X2AbilityToHitCalc_StandardAim ? Or do you need to keep it as is for now for stuff like disabling Good Angle bonuses?
Zelfana 5 Feb @ 12:26pm 
You can't reuse your EUAR config for this mod, they're completely different. You'll have to open the config and check if there is anything you want to tweak manually.
LeyShade 5 Feb @ 10:41am 
@Tedster and @Zelfana - thank you for your detailed explainations from the code side.
LeyShade 5 Feb @ 10:39am 
@MrMister - What we mean is does it use the same [headerslike.thisone], or is it necessary to go through all other mods looking for the others and replace their headers with these.
Zelfana 5 Feb @ 9:14am 
@MrMister

That isn't possible to implement with this hook due to the same reason that height modifiers are not possible; the hook does not actually provide attacker and target information to use for calculating extra things.