Jump to content

R&D Aim Bonuses / Penalties


Amineri

Recommended Posts

I had an interesting thing happen in one of my recent playthroughs. I had a unit with Covering Fire get shot at by a unit in full cover and hit the attacker with the Covering Fire overwatch shot.

 

Under the usual assumptions, this would be at -60 to hit (-40 for full cover and -20 for reaction fire). The Covering Fire unit had 73 aim leading to an estimated 13% chance to hit, so perhaps it was just a lucky roll.

 

It got me thinking about the various assumptions that are made about some of the various to-hit modifiers, particularly with regard to overwatch fire.

 

I've thought of a way that these can be tested to determine exactly what is going on.

 

1) A hex replacement for XGTacticalGameCore.RollForHit is created so that it returns a fixed, known value. This value can be modified via a simple hex edit. (e.g. 50%)

2) A save game is developed where a to-hit roll of interest will occur just after the save game

3) The hex replacement fixing the to-hit roll is put in.

4) The save game is loaded, the event plays out and the result is noted.

5) Quit game, adjust to-hit value up or down, reload save game and repeat event

6) Continue until the break point of the required to-hit value is determined

 

Using this I think it would be possible to determine some things such as :

  • What is the overwatch aim penalty? Is it a fixed value or percent-based? How does dashing affect the to-hit chance?
  • Do units shot at with Covering Fire get their cover bonus?
  • Do Combat Drugs actually grant a +20 aim bonus to units in the cloud?
  • For my particular mod... does the squadsight aim penalty apply to units shot at with overwatch?

I imagine there are a few other things worth discovering/verifying that I can't think of off the top of my head.

 

------------------

 

Here is the hex replacement to XGTacticalGameCore.RollForHit. The comparison / roll is actually based on floats, although the required to-hit number is converted from an int to a float immediately before being passed to this function.

XGTacticalGameCore.RollForHit

original hex:
69 00 00 00 45 00 00 00 0F 48 E2 76 00 00 12 20 BC 4D 00 00 2A 00 6F 4D 00 00 00 1C 71 4D 00 00 A8 A8 38 57 01 04 FA FF FF 38 57 61 1C 16 16 38 57 1C B5 FC FF FF 16 16 16 04 B2 48 E2 76 00 00 00 E5 76 00 00 16 04 3A E1 76 00 00 53

new hex:
55 00 00 00 45 00 00 00 0F 48 E2 76 00 00 AC 38 3F 2C 64 38 3F 2C C8 16 04 B2 48 E2 76 00 00 00 E5 76 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 3A E1 76 00 00 53
The new decompiles function looks like :
    fRoll = float(100) / float(200);
    return fRoll <= fChance;

I set it up this way using ints so that the values would be pretty straightforward to edit. I used / 200 instead of 100 so that 1/2% values can be set, just in case it's necessary.

 

I figure that with a few people testing it will be a lot quicker to gather data than with just me, plus the results should be more reliable since they will be spread across different machines. I'll be doing some testing of my own in the days ahead, but thought I'd push out the hex change (and idea) so that more of us can be working on it at once.

Link to comment
Share on other sites

While playing with the Long War 1.9 beta (which includes my AI fix for how the AI scores Hunker Down), I've had an enemy Hunker Down while in Full Cover and while in Half Cover. In both cases the detailed shot breakdown reports a doubling of the cover bonus. The bonus is listed separately as "Hunkered Down", and it's value is the same as the cover bonus. For Full Cover this means two "-40" to hit penalties displayed.

 

However, I've also had two cases where an alien unit has shot and hit a unit that was Hunkered Down in Full Cover. Once by a sectoid and once by a floater. Based on DGC.ini setting the sectoid had a 65% base to hit and the floater had a 60% base to hit (50% base + 10 for LPR). In neither case was the alien at a height advantage, nor close enough to receive a close-range aim bonus. In neither case was the soldier hit flanked by any alien units at all.

 

I investigated, and determined that a fixed roll of 50% caused the shot to miss (unsurprisingly), but when trying to test lower I broke the sequence of events that lead to the shot against the Hunkered Unit (the shot was the 3rd one made by the pod).

Link to comment
Share on other sites

It's similar to situations I've had where a guy in full cover and under the protection of a smoke grenade has been hit and killed before (he wasn't hunkered too though).

 

Hm, perhaps, like many pen and paper systems, a roll of 1 or 100 will always hit?

 

If we could find out exactly what's what concerning these peculiar situations (if it's 'cheating' or simply 'lucky') then doing away with the displayed to-hit chance would be interesting (and probably greatly enhance the immersion). Until then though such a feature-removal should be left alone imo.

 

Ideally it'd be nice if there were three colours for the 'alien head' icons that dynamically updated to give a indicator of poor (red), good (yellow), flanked (green) likelihoods instead of the two currently (yellow for flanked and red for everything else). That'd require quite a bit of new code and the necessity of cracking the method for adding additional textures however.

 

Would be cool though.

Link to comment
Share on other sites

  • 2 weeks later...

Was finally able to verify something using this method.

 

Have experimentally verified that the listed +20 aim bonus from combat drugs does indeed have an in-game effect. The bonus does not affect the base Offense value of the unit (like a SCOPE does), but does increase the hit chances.

 

Verified this with a Support with Combat Drugs, with a base 79% chance to hit a cyberdisc.

 

Without Combat Drugs active:

  • Modded the roll to use a fixed 79.0, resulted in a hit
  • Modded the roll to use a fixed 80.0, resulted in a miss

 

With Combat Drugs active:

  • Modded the roll to use a fixed 80.0, resulted in a hit
  • Modded the roll to use a fixed 99.0, resulted in a hit
  • Modded the roll to use a fixed 100.0, resulted in a miss.

So it definitely affects hit-chance, and it's definitely +20 as advertised in the detailed view.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...