Jump to content

R&D Damage Mods


Amineri

Recommended Posts

I'm not sure if you all are aware of it, but critical damage is bugged.

 

An LPR critical hits for 7 damage 1/3 of the time and 9 damage 2/3 of the time, with no possibility of 8 damage.

 

Similarly, an Assault Rifle crits for 4 damage 1/3 of the time and 6 damage 2/3 of the time, with no possibility of 5 damage.

 

And this is ABSOLUTELY NOT because the damage randomization is rolled first and then the +50% damage is applied.

 

Here are the steps that are taken for critical damage:

1) Add 1 to base damage

2) Multiple result by 1.5 (drop any fractions)

3) Randomize by Rand(3) -1

 

For an LPR, with 5 base damage, this results in:

1) 5+1 = 6

2) 6 * 1.5 = 9

3) 9 + Rand(3) -1 = [8, 9, 10]

 

So why does it come out as [7, 9, 9]? (or [4, 6, 6] for Assault Rifles)

 

After the basic damage is computed there is a native function CalcOverallDamageModFromPerk that adjusts damage for perks. Gunslinger, Mayhem, Bring Em On, etc must be getting applied here.

 

I did a test and removed the call to this function, and here's what happened:

 

A 5 base damage LPR generated crits of 8, 9, or 10

A 3 base damage Assault Rifle generated crits of 5, 6, or 7

 

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

 

Just because the function is acting buggy doesn't necessarily mean that the above values are good. 8-10 damage for an LPR crit probably hurts the player more than the AI, as the early Floaters and Thin Men would completely annihilate an XCOM soldier with an LPR crit. Ouch!

 

I've been working on a new helper function that will modifiy the base damage going into the CalcOverallDamage (that randomizes damage and applies extra critical damage).

 

This new helper function could be used to take over the extra damage being added by the CalcOverallDamageModFromPerk function, allowing it to be removed and criticals to have a proper range of values.

 

This would allow modification of these damage-increasing perks (e.g. Gunslinger could be adjusted to add +1 damage, or +3).

 

This would also allow creation of new perks or conditions under which extra damage could be applied. It's going to be like the Ammo mod all over again :P

 

Here is the list of existing perks that I see that modify damage:

  • Flush -- reduces damage by 50% -- VERIFIED (applied in native function)
  • Bring Em On -- Adds +1 critical damage per visible enemy (max +5)
  • Killer Instinct -- adds +50% Critical Damage if Run N Gun is active
  • Will To Survive -- probably applied here, since I haven't found where else it could be
  • Mayhem -- Adds +1, 2, or 3 (?) damage to AoE and Suppression based on tech level
  • HeadShot -- Adds +1, 2, or 3 (?) damage to criticals based on tech level
  • Gunslinger -- Adds +2 damage to pistols
  • Disabling Shot -- reduced damage (how much?)

Existing perks that are not applied here:

  • HEAT Ammo
  • Shredder Rocket

Other conditions that might alter damage, that I don't know where are applied:

  • Foundry bonus damage to pistols
  • Resilience -- not sure where the immunity to crits is handled

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

 

The other big question is what people would like to see for the default crit values for various weapons. The way the crit damage is coded up currently:

 

1 damage weapon -- 2-4 damage on crit (average 3 -- 3x damage)

2 damage weapon -- 3-5 damage on crit (average 4 -- 2x damage)

3 damage weapon -- 5-7 damage on crit (average 6 -- 2x damage)

4 damage weapon -- 6-8 damage on crit (average 7 -- 1.75x damage)

5 damage weapon -- 8-10 damage on crit (average 9 -- 1.8x damage)

6 damage weapon -- 9-11 damage on crit (average 10 -- 1.67x damage)

7 damage weapon -- 11-13 damage on crit (average 12 -- 1.71x damage)

8 damage weapon -- 12-14 damage on crit (average 13 -- 1.625x damage)

9 damage weapon -- 14-16 damage on crit (average 15 -- 1.67x damage)

10 damage weapon -- 15-17 damage on crit (average 16 -- 1.6x damage)

11 damage weapon -- 17-19 damage on crit (average 18 -- 1.63x damage)

etc

 

Because of the initial +1 damage, lower damage weapons have a higher effective crit multiplier. Because of rounding effects, weapons with odd damage tend to do a little bit more critical damage than weapons with even damage.

 

My initial thought it to remove the extra +1 applied before multiplying by 1.5. This results in:

1 damage - unchanged by crit (1x damage)

2 damage - 2-4 damage (1.5x damage)

3 damage - 3-5 damage (1.33x damage)

4 damage - 5-7 damage (1.5x damage)

 

This results in odd damage shots doing less than 1.5x extra damage (the amount gets closer to 1.5 as the damage goes up), while even damage shots always do exactly 1.5x extra damage. This is likely why the extra +1 was added, but this has significant impact on the early stages of the game.

 

The integer-based damage and fixed +/- 1 damage variation makes applying +50% critical damage in a consistent manner fairly difficult. It also makes for almost zero effective damage variation at the high levels, even not taking crits into account.

 

Damage variation of +/- 1 on a 9 damage shot is effectively less than the same +/- 1 on a 3 damage shot. Three hits with a 3 damage shot will have total damage that varies from 6 to 12 (average 9), while the same damage applied with a single 9 damage shot only varies from 8 to 10. Since variation typically makes it harder for the player, this is another way in which the early game is made harder and the late game made easier.

 

The only remedy for this that pops to mind is to completely alter the damage variation formula to something not (internally) integer-based. My inclination would be to use a Normally distributed (bell-curve) damage, where the mean and variance can be float values, and are converted to integers only at the end.

 

The difference between 2.8 damage and 2.2 damage is that 2.8 is more likely to generate a 3 than a 2, while 2.2 is more likely to generate a 2 than a 3. I might elaborate on this more in a follow-up post :smile:

 

I'm open to suggestions as to how to adjust the critical damage, if anyone has any ideas or suggestions.

Edited by Amineri
Link to comment
Share on other sites

Well, if you don't want to do that much math, you could do something like

 

Critical Damage = Round ( (Base Damage + Base Damage Perk and Item Adders) * (1.33 + RandFloat (0 to 0.34)) + Crit Damage Adders

 

Then clamp it at a minimum (base damage + 2), so it is meaningfully more than a regular hit in all cases.

 

Because the baseline damage for a critical hit is somewhat arbitrary in nature (at 1.5), I'm not sure a normally distributed curve is particularly called for (although there's nothing really against it, either), so I'd be fine with a simple randomizer that sets the extra damage multiplier between 1.33 and 1.67. We're really only talking about a point or two of damage variance even at the high end of weapons.

 

This is unlike your rocket-miss mod, in that you want misses that are a little off to be significantly more common than those that are way off.

 

HOWEVER, thinking further, if you wanted to use a larger random range of critical hits (say, from 1 to 2), then a normal distribution becomes more meaningful. You could probably even do something like 1.25 to 3, with the curve centered at 1.5, and simply clamp the lower end to 1.25, if that makes sense. (This is probably far easier than calculating skewness of such a curve). This means you'll rarely see super 3x criticals, although that may drive players nuts when their colonel gets one-shotted.

Edited by johnnylump
Link to comment
Share on other sites

A relatively simple way to adjust crit damage to 150% base damage could be to change the dice size used for randomization. That way, we could keep the Rand(3) currently used for even numbers, and use Rand(2) for odd numbers. The crit damage would be as follows, with base damage on the left, and possible crit damage values on the right.


1 - 1,2

2 - 2,3,4

3 - 4,5

4 - 5,6,7

5 - 7,8

6 - 8,9,10

7 - 10-11

8 - 11,12,13

9 - 14,15

10 - 14,15,16


This leaves the problem of adjusting damage variation to be proportional to the damage, rather than a flat +1/-1. We could also use varying dice sizes for that:


# d1

1 - 2

2 - 3

#d2/3

3 - 4,5

4 - 5,6,7

5 - 7,8

6 - 8,9,10

#d4/5

7 - 9,10,11,12

8 - 10,11,12,13,14

9 - 12,13,14,15

10 - 13,14,15,16,17

#d6/7

11 - 14,15,16,17,18,19

12 - 15,16,17,18,19,20,21

Link to comment
Share on other sites

Some excellent suggestions :smile:

 

The thing I like about using discrete math instead of normal variables is that it is easier for the player to understand the rules of the game.

 

I played around a little with coming up with a damage formula for non-crits, and eventually settled on the idea of using discrete numbers, but playing around with numbers 4x larger for calculations and then dividing by 4 at the end for the final value.

 

The final formula ended up being

rand_damage = (3*base_damage) + Rand(2*base_damage + 4) / 4

 

This was originally :

rand_damage = ((4*base_damage) - base_damage + Rand(2*base_damage +4)) / 4

in which you can see the application of the 4x stuff.

 

What this does is gradually extend the chances of getting a broader damage range, so that most times there is a smaller chance of getting the end values.

 

The "base" case is a 4 damage weapon, which can have 3, 4, or 5 damage, with each value equally likely.

 

base_damage : damage range : prob of min/max damage (for each individually)

1 : 1-2 : 1/6 (chance of 2)

2 : 1-3 : 2/8 = 1/4

3 : 2-4 : 3/10

4 : 3-5 : 4/12 = 1/3 (all are equally likely)

5 : 3-7 : 1/14

6 : 4-8 : 2/16 = 1/8

7 : 5-9 : 3/18 = 1/6

8 : 6-10 : 4/20 = 1/5 (all are equally likely)

9 : 6-12 : 1/22

10 : 7-13 : 2/24 = 1/12

11 : 8-14 : 3/26

12 : 9-15 : 4/28 = 1/7 (all are equally likely)

 

To pick out an example, a 9 base damage shot would have:

6 damage : 1/22 chance

7 damage : 4/22 = 2/11 chance

8 damage : 4/22 = 2/11 chance

9 damage : 4/22 = 2/11 chance

10 damage : 4/22 = 2/11 chance

11 damage : 4/22 = 2/11 chance

12 damage : 1/22 chance

----------------
For crits, the modification would be to the base formula, increasing damage by 50%, but keeping the randomized amount the same.
rand_crit_damage = ((6*base_damage) - base_damage + Rand(2*base_damage - 4)) / 4
or
rand_crit_damage = ((5*base_damage) + Rand(2*base_damage - 4)) / 4
It is basically adding 2*base_damage / 4 = 0.5*base_damage, but the randomization takes place in the "expanded" numbers
base damage : crit damage range : probability of each
1 : 1-2 : (1/2, 1/2)

2 : 2-4 : (1/4, 1/2, 1/4)

3 : 3-6 : (1/10, 2/5, 2/5, 1/10)

4 : 5-7 : (1/3, 1/3, 1/3) (all equally likely)

5 : 6-9 : (3/14, 2/7, 2/7, 3/14)

6 : 7-11 : (1/8, 1/4, 1/4, 1/4, 1/8)

7 : 8-13 : (1/9, 2/9, 2/9, 2/9, 2/9, 1/9)

8 : 10-14 : (1/5, 1/5, 1/5, 1/5, 1/5) (all equally likely)

9 : 11-16 : (3/22, 2/11, 2/11, 2/11, 2/11, 3/22)

10 : 12-18 : 2/24 (1/12, 1/6, 1/6, 1/6, 1/6, 1/6, 1/12)

11 : 13-20 : 3/26 (1/26, 2/13, 2/13, 2/13, 2/13, 2/13, 2/13, 1/26)

12 : 15-21 :(1/7, 1/7, 1/7, 1/7, 1/7, 1/7, 1/7) (all are equally likely)

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

 

Essentially this boils down to +/- 25% of the base damage (so +/- 1 for 4, +/- 2 for 8, and +/- 3 for 12). Fractional random damage increases the range but with lower probability of getting the extremes. Crit damage always averages exactly +50% of the base damage.

 

The primary oddity here is a 3 damage weapon, because of the desire to center the damage at 4.5, but with a variation of +/- 0.75.

This results in a 3 damage weapon having:

non-crit: 30% 2 damage, 40% 3 damage, 30% 4 damage

crit : 10% 3 damage, 40% 4 damage, 40% 5 damage, 10% 6 damage.

This means it is possible to get a crit that does lower damage than a non-crit shot.

 

Prob crit is lower than non-crit : 3%

Prob crit is equal to non-crit : 4% + 12% = 16%

Prob crit is greater than non-crit = 81%

 

A similar case is true for a 1 damage weapon:

non-crit : 83% 1 damage, 17% 2 damage

crit : 50% 1 damage, 50% 2 damage

 

Prob crit is lower than non-crit : 8.3%

Prob crit is equal to non-crit : 50%

Prob crit is greater than non-crit : 42.7%

 

In both cases the crit is probabilitistically greater damage, but the distributions overlap a bit. It's hard to avoid this since damage has to be an integer, crit damage is +50%, and the base damage number is a small integer.

 

For larger numbers there is a bit of overlap, and occasionally a small chance of getting a lower crit value (e.g. a 7 base damage non-crit has a 1/6 chance of being 9, while a crit hit has a 1/9 chance of being an 8, so there is a 1/54 chance that a crit hit would be lower).

 

The only way that I see to avoid this is to either make the damage variation smaller or the critical hit amount greater.

Link to comment
Share on other sites

Looks good; I do suggest some kind of minimum damage bonus above baseline for a critical hit (at least +1 or +2 greater than the "base" damage); otherwise I suspect we'll get complaints that it's broken.

 

EDIT (corrected): A simple "Max" function to catch sub-base criticals should suffice, ie Critical Damage = Max of Base Damage + 1 or Calculated Critical damage

Edited by johnnylump
Link to comment
Share on other sites

Just tossing out an observation rather than a concrete suggestion, as I doubt it is feasible to implement. I recognize that we have two different functions in play here and do not have free reign in design. But on the off-chance someone gets inspired ...

 

Aside from "luck", damage is primarily correlated with accuracy. The tighter the aim (especially with multiple shots such as bursts) the more 'on target' and the higher the damage. This is why snipers are so devastating: they take the time to ensure much better aim and targeting of critical areas. So it would be preferable to tie damage, especially critical damage, to how close to 100% the final adjusted aim is. Only then roll "luck". And autopsies should then be necessary to provide the insights as to where the critical target areas are located on alien lifeforms. "Luck" is always nice to have, but very unreliable. Consistent aim and knowing where to hit is much more deadly in the long run.

 

-Dubious-

Link to comment
Share on other sites

Looks good; I do suggest some kind of minimum damage bonus above baseline for a critical hit (at least +1 or +2 greater than the "base" damage); otherwise I suspect we'll get complaints that it's broken.

 

EDIT (corrected): A simple "Max" function to catch sub-base criticals should suffice, ie Critical Damage = Max of Base Damage + 1 or Calculated Critical damage

 

I thought about that. The only (very slight) problem is that it shifts up the average damage on crits for some weapons, resulting in some weapons critting for more (on average) than other weapons.

 

It's a fairly minor effect, and certainly less pronounced then the current codes sometimes-extreme crit multiples for weapons (e.g. a 3 damage weapon can crit for 6, so double damage)

 

Pistols are already getting a slight boost to average non-crit damage because of the Minimum damage of 1 (so average pistol damage is actually 1.16). Could clamp pistol crits to be 2 (so no randomization at all, but it's all at the low damage end so it's not so game-breaking).

 

If 3 damage weapons are clamped to be not less than 4 on a crit, , then the average crit damage would be 50%*4 + 40%*5 + 10% * 6 = 4.6 damage instead of 4.5, so effectively assault crits would be +53% instead of +50%. I suppose that isn't such a huge deal ^_^.

 

This could be implemented by clamping the rand_crit_damage to be no lower than the maximum possible non-crit damage of (5*base_damage + 3)/4

 

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

 

One other issue to consider is what to do regarding the Damage Roulette Second Wave option.

 

The current code randomizes damage via 1+ Rand(int(1.5*base_damage)) for non-crits. Crits get an additional base_damage added on (so that Damage Roulette crits always do more than the base_damage).

 

For a 4 damage weapon, this results in 1+ Rand(6) = 1-6 damage for a non-crit, which has average damage of 3.5 (slightly lower than stated)

A crit is 1 + Rand(6) + 4 = 5-10, which has average damage of 7.5. This is +87.5% over the stated base_damage and +214% over the actual average damage.

 

Effectively this option slightly reduces non-crit damage but significantly improves crit damage. When paired with absolutely critical it makes flanking much more destructive.

 

With the revamped system, any additional increase in the damage variance (that doesn't shift the average damage) will definitely result in more overlap with crits. The damage variation could be increased to +/- 50% instead of the 25% described above. To prevent any overlap the critical bonus amount would have to be shifted from +50% to +100%. This would probably hurt the player more than the aliens, as an unlucky crit shot by an alien is going to hurt really bad.

 

The formula for Damage Roulette would be

rand_damage = (2*base_damage + Rand(4*base_damage + 4)) / 4 for non-crits

and

rand_crit_damage = (6*base_damage + Rand(4*base_damage+4)) / 4 for crits

This is +/- 50% of base damage in variation, with crits doing double damage.

A 4 damage weapon would have non-crit damage from 2-6, and crit damage from 6-10. Destructive!

An 8 damage weapon would have non-crit damage from 4-12, and crit damage from 12-20. Super destructive!

 

Any other thoughts on how to adjust this?

 

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

 

Just a reminder :

All of this is predicated on removing the CalcOverallDamageModFromPerk function (as it appears to be doing some clamping and other odd behaviors of its own) and replacing all of its functionality.

Link to comment
Share on other sites

I have some early (I'd judge it be around alpha) code that removes the CalcOverallDamageModFromPerk call, with a newly re-built damage modifier helper function (I used TShotInfo_ToString as the taken-over helper).

 

So far I haven't messed with the damage variation calculations yet -- first I want to try and get a baseline working with all of the perks working as intended.

 

There are three separate parts:

 

1) Add in call to TShotInfo_ToString helper to modify damage going into CalcOverallDamage. This change occurs in XGAbility_Targets.CalcDamage

 

 

original hex:
07 AC 02 9A 1B 1E 35 00 00 00 00 00 00 16 2C 48 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 02 00 F0 2C 00 00 00 2C 05 06 85 03 07 85 03 9B 1B 1E 35 00 00 00 00 00 00 16 2C 43 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 60 00 EF 76 00 00 00 1B CF 0E 00 00 00 00 00 00 38 3A 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 1A 2C 0C 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 2D 01 25 BC 00 00 2D 01 24 BC 00 00 16 


new hex: 
07 4E 02 9A 1B 1E 35 00 00 00 00 00 00 16 2C 48 16 0F 01 16 BC 00 00 2C 05 06 85 03 07 85 03 9B 1B 1E 35 00 00 00 00 00 00 16 2C 43 16 0F 01 16 BC 00 00 19 19 2E FE 2C 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 F0 2C 00 00 00 01 F0 2C 00 00 54 00 EF 76 00 00 00 1B CF 0E 00 00 00 00 00 00 38 3A 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 38 4A 1C 75 7C 00 00 00 BF 29 00 00 16 2D 01 25 BC 00 00 2D 01 24 BC 00 00 16 0B 0B 0B 0B 0B 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 01 16 BC 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B  

 

 

 

2) Entirely replace contents of XGAbility_Targeted.TShotInfo_ToString with code to compute altered damage based on perks, etc

 

 

original hex:
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 15 06 00 00 3D 04 00 00 

body:
0F 00 72 7C 00 00 70 70 1F 54 53 68 6F 74 49 6E 66 6F 3A 20 54 69 74 6C 65 3D 00 35 D7 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 F6 00 96 00 71 7C 00 00 36 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D6 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 74 00 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 AD 01 96 00 71 7C 00 00 36 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D5 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 29 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 65 02 96 00 71 7C 00 00 36 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D4 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 E3 01 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 48 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 1E 03 96 00 71 7C 00 00 36 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D3 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 9A 02 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 D5 03 96 00 71 7C 00 00 36 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D2 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 53 03 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 42 6F 6E 75 73 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 8D 04 96 00 71 7C 00 00 36 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 D1 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 09 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 53 74 72 69 6E 67 73 0A 00 16 0F 00 71 7C 00 00 25 07 46 05 96 00 71 7C 00 00 36 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 10 00 71 7C 00 00 35 D0 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 C4 04 0E 1B F9 FF FF 61 42 00 72 7C 00 00 1F 43 72 69 74 20 50 65 6E 61 6C 74 79 20 56 61 6C 75 65 73 0A 00 16 0F 00 71 7C 00 00 25 07 00 06 96 00 71 7C 00 00 36 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 0E 1B F9 FF FF 61 42 00 72 7C 00 00 70 70 1F 20 20 20 20 20 00 38 53 10 00 71 7C 00 00 35 CF 25 00 00 D8 25 00 00 00 00 48 74 7C 00 00 16 1F 0A 00 16 16 A5 00 71 7C 00 00 16 06 7C 05 04 00 72 7C 00 00 04 3A 73 7C 00 00 53 


new hex: (virtual 0x529)
header:
89 7C 00 00 50 55 00 00 00 00 00 00 70 7C 00 00 00 00 00 00 00 00 00 00 74 7C 00 00 00 00 00 00 18 01 00 00 1E 27 00 00 29 05 00 00 3D 04 00 00 

body:
0F 00 71 7C 00 00 1A 2C 0C 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 0B 0B 07 0F 02 77 01 E8 BB 00 00 2A 16 05 E8 9B 00 00 00 19 01 E8 BB 00 00 0A 00 E8 9B 00 00 00 1B 92 30 00 00 00 00 00 00 16 0A 6A 00 24 02 0A 6F 00 24 03 0A 74 00 24 04 0A 79 00 24 05 0A B5 00 24 06 07 B2 00 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 4A 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A BA 00 24 08 0A BF 00 24 09 0A C4 00 24 0A 0A C9 00 24 0B 0A 05 01 24 0C 07 02 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 4B 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A 0A 01 24 0D 0A 0F 01 24 0E 0A 14 01 24 0F 0A 19 01 24 10 0A 1E 01 24 11 0A 5A 01 24 12 07 57 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 54 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A 5F 01 24 07 0A 09 02 24 13 07 9B 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 54 16 A1 00 71 7C 00 00 2C 03 16 06 06 02 07 D2 01 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 4B 16 A1 00 71 7C 00 00 2C 02 16 06 06 02 07 06 02 19 01 E6 7B 00 00 0F 00 99 3D 00 00 00 1B 99 3D 00 00 00 00 00 00 2A 38 3F 2C 4A 16 A1 00 71 7C 00 00 2C 01 16 06 0F 02 0A FF FF 06 0F 02 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 28 02 24 16 0A 76 02 24 18 07 73 02 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 2D 16 A1 00 71 7C 00 00 2C 01 16 06 7C 02 0A FF FF 06 7C 02 05 1C 7C 00 00 00 1B 1E 35 00 00 00 00 00 00 16 0A 95 02 24 11 0A 9A 02 24 19 0A B4 02 24 42 A1 00 71 7C 00 00 1B 3A 33 00 00 00 00 00 00 16 16 0A FF FF 06 BA 02 07 EF 02 82 9A 1B 1E 35 00 00 00 00 00 00 16 2C 3D 16 18 0B 00 2D 01 25 BC 00 00 16 A1 00 71 7C 00 00 1B 2F 34 00 00 00 00 00 00 16 16 07 65 03 82 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 20 16 18 0B 00 2D 01 25 BC 00 00 16 A1 00 71 7C 00 00 FA 2C 04 36 19 01 E6 7B 00 00 09 00 9C 30 00 00 00 01 9C 30 00 00 16 16 07 DF 03 82 19 19 01 E6 7B 00 00 09 00 0A 31 00 00 00 01 0A 31 00 00 0C 00 EA A2 00 00 00 1B B8 36 00 00 00 00 00 00 2C 29 16 18 0B 00 2D 01 25 BC 00 00 16 07 DF 03 19 01 E6 7B 00 00 0A 00 2F 34 00 00 00 1B BD 5E 00 00 00 00 00 00 16 9F 00 71 7C 00 00 1E 1F 85 AB 3F 16 07 00 04 9A 1B 1E 35 00 00 00 00 00 00 16 2C 0C 16 9F 00 71 7C 00 00 1E 00 00 00 3F 16 07 21 04 9A 1B 1E 35 00 00 00 00 00 00 16 2C 3E 16 9F 00 71 7C 00 00 1E 00 00 40 3F 16 0F 00 71 7C 00 00 FA 00 71 7C 00 00 25 16 04 38 53 00 71 7C 00 00 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 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 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 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 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 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 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 3A 73 7C 00 00 53  

 

 

 

 

3) Remove call to CalcOverallDamageModFromPerk

 

 

change:
m_iActualDamage = CalcOverallDamageModFromPerk(float(m_iActualDamage))
0F 01 16 BC 00 00 1B D0 0E 00 00 00 00 00 00 38 3F 01 16 BC 00 00 16

to:
m_iActualDamage m_iActualDamage
0B 01 16 BC 00 00 01 16 BC 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B  

 

 

 

 

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

 

The new damage modifier function replicates functionality of:

  • Adds BalanceMod damage modifier (typically used for aliens)
  • Mayhem : if ability used is RocketLauncher, ShredderRocket, or Suppression, adds native function GetMayhemPerkBonusDamage to damage
  • HeadShot : if ability used is eAbility_PrecisionShot, and shot is critical, adds native function GetPrecisionShotPerkDamageDamageAdd to damage
  • If soldier has ePerk_BringEmOn, and shot is critical, adds Max(4, m_kUnit.m_arrVisibleEnemies.Length) damage to shot
  • If soldier has ePerk_KillerInstinct, and shot is critical, and RunAndGun is active, adds +34% to damage
  • If ability is eAbility_ShotFlush, then reduces damage to 50% of usual
  • If ability is eAbility_DisablingShot, then reduces damage to 75% of usual

You may notice I altered some of the values. The new helper function modifies the damage prior to the +50% crit bonus and damage randomization, whereas the old function modified the damage after the +50% crit bonus and damage randomization. For Killer Instinct, the total crit bonus changes from +50% to +100%. This is because 1.34 * 1.50 ~= 2.00.

 

I also added in a few new trinkets:

  • Added in a new perk (based on perk ID 45 ePerk_BlueWire) that adds +1 damage to grenades
  • Added in capability for new damage booster items:
  • Item 74 adds +1 to ballistic weapons, Rocket Launcher, and Blaster Launcher
  • Item 75 adds +1 to laser weapons, or +2 to Rocket Launcher and Blaster Launcher
  • Item 84 adds +1 to plasma weapons, or +3 to Rocket Launcher and Blaster Launcher

This needs a bit of testing. I've verified that the game doesn't crash on aliens taking damage, stunning still works (aliens can be stunned and can resist stuns), and that Flush does not crash the game.

 

Flush does not appear to have the damage reduction applied properly, however.

 

All other functionality is still untested.

Link to comment
Share on other sites

Ooh looks snazzy, especially the extra damage items:

 

Possible Names:

Explosive Rounds

Hot-Shot Energy Pack

Overcharged Plasma Pack

 

The Rocket Launcher buffs really necessary? They could easily be granted by different items themselves instead of an all purpose OP item (unless the code is stuck like this)

 

No Gunslinger? Personally i'd love the option to reduce it down to 1 damage bonus as the way i've buffed all pistols it's now unfortunately OP.

Link to comment
Share on other sites

The Rocket Launcher buffs don't have to be applied necessarily by the same items. However, with 3 tiers of regular weapons + 3 damage booster items for them, the Rocket Launcher progression starts to seem a bit anemic in comparison. The specifics can be played with, of course.

 

I'm not quite sure where Gunslinger is applied, but I realized that this function doesn't preview the damage. For example, when you start to use the Flush ability it doesn't show what the possible damage is. That makes me think that Gunslinger bonus is applied somewhere else. It's possible to subtract 1 damage for Gunslinger here, but the possible damage preview in the UI will be incorrect (I think).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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