Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Damage Bonuses  (Read 854 times)

Vanshilar

  • Admiral
  • *****
  • Posts: 605
    • View Profile
Damage Bonuses
« on: March 11, 2024, 12:38:52 AM »

Just wanted to make a note of this since I did some testing.

Damage bonuses generally modify the base damage. So if the weapon does 100 base damage, Tactical Drills gives 5% bonus damage, and 100% CR gives 10% bonus damage, then the damage will become 100 * (1 + 0.05 + 0.10) = 100 * 1.15 = 115 damage.

However, certain bonuses modify the whole thing instead of the base damage. For example, if you have the above, and then add Tactical Analysis, say against a capital ship (20% bonus damage), you might think it'd be 100 * (1 + 0.05 + 0.10 + 0.20) = 100 * 1.35 = 135 damage. But instead, it'll actually be 100 * (1 + 0.05 + 0.10) * (1 + 0.20) = 138 damage. It basically added +23% of the base damage since it's also multiplying with the other bonuses.

There are a couple of those types of modifiers, but thus far, they all multiply with each other. In other words, as far as I can tell, the damage boils down to (base damage) * (1 + X) * (1 + Y), where X are some modifiers like the CR damage bonus, and Y are some other modifiers like the Target Analysis bonus. Since X is easier to get, I'm going to call them the "regular" bonuses, while Y is more rare, so I'll call them the "special" bonuses. I could probably call them something more descriptive but this is just to organize it. The mathematically astute reader would notice that I could've defined it the other way too, but there are more in X than Y so I think it'll be easier to think of it this way.

Testing is done via the simulator in version 0.97a-RC10, by looking at the damage numbers of weapons against a target from the Practice Targets mod and against a sim Hyperion, and then calculating out what it needs to be for the given bonuses to match the observed damage numbers.

There's probably a way to just look in the code to see the list of all possible bonuses or something, but this is relying on empirical testing instead.

The "regular" bonuses:
CR (assuming CR > 70%)
Ballistic Mastery (regular and elite)
Tactical Drills
Energy Weapon Mastery
Cybernetic Augmentation
High Energy Focus
High Scatter Amplifier (regular and elite)

The "special" bonuses:
Target Analysis (regular and elite)
Wolfpack Tactics
Advanced Turret Gyros s-mod -- note that this also benefits missiles, not just ballistic and energy

Of particular note is that fighters are not affected by any of the "regular" or "special" bonuses above *except* for CR.

Targeting Feed (shipsystem on Heron) seems to be its own modifier, and thus multiplicatively stacks with everything else. Most damage modifiers don't apply to fighters, though.

Graviton Beam's effect is a damage taken modifier by the target ship, as opposed to the above which are damage dealt modifiers by the firing ship, and thus will multiplicatively stack with all of the above.

Since the "special" bonuses multiply all the other bonuses (except each other), and they're more rare, they are in some sense better than the "regular" bonuses. Note also that if the ship is a capital, then with elite Target Analysis and s-modded Advanced Turret Gyros, the ship is basically doing +20% against all targets, multiplying with the "regular" bonuses. On the other hand, frigates with elite Target Analysis and Wolfpack Tactics get +5%/+30%/+35%/+40%, multiplying with the "regular" bonuses.
« Last Edit: March 20, 2024, 10:23:49 AM by Vanshilar »
Logged

Cryovolcanic

  • Commander
  • ***
  • Posts: 193
    • View Profile
Re: Damage Bonuses
« Reply #1 on: March 11, 2024, 07:27:26 AM »

Interesting. It looks like the special bonuses are situational, i.e., they vary based on the type of target or on the type of ship.
Logged

float

  • Captain
  • ****
  • Posts: 275
    • View Profile
Re: Damage Bonuses
« Reply #2 on: March 11, 2024, 08:53:38 AM »

This is just a side effect of damage bonuses being partitioned two ways: by weapon type and by hull size.
Damage bonuses that use the first partition (increasing ballistic, energy, and/or missile damage) will stack additively with each other, as they add flat percentage bonuses to these stats.
Damage bonuses that use the second partition (increasing damage done to frigates, destroyers, cruisers, and/or capitals) will also stack additively with each other.
Damage bonuses across different partitions will stack multiplicatively.

Targeting Feed uses the first partition, so it should actually be a "regular" bonus under your classification, unless there's something else going on that I'm missing.
« Last Edit: March 11, 2024, 08:59:19 AM by float »
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1330
    • View Profile
Re: Damage Bonuses
« Reply #3 on: March 11, 2024, 09:36:33 AM »

I would expect there to be a third type as well - getDamageToTargetHullMult(), getDamageToTargetShieldsMult(), getDamageToTargetWeaponsMult(), etc.
So the "100% to engines and weapons" from elite TA would likely be (1 + Z). Willing to test for that?
Based on the code, Beam Scatterer would be in the (1 + X) group, while PD skills and terminator core in the (1 + Y) group.
Logged

float

  • Captain
  • ****
  • Posts: 275
    • View Profile
Re: Damage Bonuses
« Reply #4 on: March 11, 2024, 10:26:00 AM »

I would expect there to be a third type as well - getDamageToTargetHullMult(), getDamageToTargetShieldsMult(), getDamageToTargetWeaponsMult(), etc.
So the "100% to engines and weapons" from elite TA would likely be (1 + Z). Willing to test for that?
Based on the code, Beam Scatterer would be in the (1 + X) group, while PD skills and terminator core in the (1 + Y) group.

Looks like weapon type modifiers, beam damage dealt modifiers, and damage taken/dealt modifiers (from their respective listeners) all fall under the same category, as they're directly adjusting the DamageAPI components.

Then you have damage bonus by hull size as a second category.

And the getDamageToTargetHullMult() stuff is also its own category.

And then there are a bunch of categories for damage taken adjustments similar to the damage dealt ones.

All these categories stack multiplicatively, so yeah, there are a lot more than just 2 partitions, but I think the hull size and weapon type ones make up the majority of damage bonuses.
« Last Edit: March 11, 2024, 10:33:24 AM by float »
Logged

Vanshilar

  • Admiral
  • *****
  • Posts: 605
    • View Profile
Re: Damage Bonuses
« Reply #5 on: March 19, 2024, 11:01:28 PM »

This is just a side effect of damage bonuses being partitioned two ways: by weapon type and by hull size.

Oh huh, I didn't notice that. Thanks for pointing that out, it makes a lot of sense. I haven't looked at the code but it makes sense that the code would do something like "sum up all the weapon type bonuses and then apply them as a multiplicative modifier" followed by "sum up all the hull size type bonuses and then apply them as a multiplicative modifier" etc. for other modifier types.

Targeting Feed uses the first partition, so it should actually be a "regular" bonus under your classification, unless there's something else going on that I'm missing.

Well it's based on testing in the sim, using a Heron with Dagger against the mid-tech practice target. The Dagger's damage against the shields (shield efficiency of 1.4) was:

700 without any damage bonuses
770 with 100% CR
1050 with Targeting Feed
1155 with 100% CR and Targeting Feed

That only works out if the CR bonus multiplies rather than adds with the Targeting Feed bonus. So it's not in the "regular" category.

I should note: It's not necessarily the case that Targeting Feed is part of the "special" category, since there were no bonuses in that category that I could use it with to confirm that they add rather than multiply. So it's possible that it's part of a different category altogether. It stacks multiplicatively with Graviton Beam so it's not in that category either. So all I can really say is that it's not part of the "regular" category (which is where the CR bonus resides) and it's not in the same category as Graviton Beam. For right now there's nothing in the "special" category that works at the same time as Targeting Feed so functionally it doesn't matter if it's lumped in together with them or in its own category.

I would expect there to be a third type as well - getDamageToTargetHullMult(), getDamageToTargetShieldsMult(), getDamageToTargetWeaponsMult(), etc.
So the "100% to engines and weapons" from elite TA would likely be (1 + Z). Willing to test for that?
Based on the code, Beam Scatterer would be in the (1 + X) group, while PD skills and terminator core in the (1 + Y) group.

Sure, I don't know how to directly see damage numbers for weapons or engines (or fighters or missiles to test the PD bonus) though. I think there was a mod somewhere along the line that will show weapon/engine health, but I can't find it offhand.

Yes, High Scatter Amplifier is part of the same group as HEF, tested using Sunder on mid-tech practice target.

All these categories stack multiplicatively, so yeah, there are a lot more than just 2 partitions, but I think the hull size and weapon type ones make up the majority of damage bonuses.

Yeah would be nice to list out all the possible damage bonuses and sort them by category, to know just which ones stack additively (within same category) or multiplicatively (across different categories). Not sure what other damage bonuses are out there though, hmm.

One thing that I just checked is that the damage bonus to shields from Graviton Beam does multiply with both the "regular" and "special" categories. Tested using Executor with Graviton Beam and Gigacannon against the mid-tech practice target (keeping the beam location on the shield separated enough to have two different shield damage numbers). So I assume that would be an example of getDamageToTargetShieldsMult(). So it's actually quite powerful then. Tested that 1 Graviton gives +5% overall damage bonus, while 3 Gravitons give +10% overall damage bonus, just like it says "on the tin".
« Last Edit: March 20, 2024, 12:24:13 AM by Vanshilar »
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1330
    • View Profile
Re: Damage Bonuses
« Reply #6 on: March 20, 2024, 03:33:29 AM »

So I assume that would be an example of getDamageToTargetShieldsMult().
Graviton is a damage taken modifier, applied to the target ship. getDamageToTargetShieldsMult() is a damage dealt modifier, applied to the firing ship. Imagine a hypothetical "deal 10% more damage to shields" officer skill, that would be it. I think nothing in vanilla currently uses it, though.

As already explained by float, damage taken modifiers are never additive with damage dealt modifiers, and have several "partitions" among them as well.

EDIT: On top of that, there are also combat listeners that can modify damage. Vanilla uses them sparingly, mostly for "bonus X damage against X" effects found on Squall / Mining Blaster / Breach. Even these are all different. Squall is a modifyDamageDealt listener. Honestly not sure how it interacts with other bonuses, but my guess is that it's affected by damage taken modifiers, but not damage dealt ones.
Breach / Mining Blaster / Disintegrator have their own dealArmorDamage functions, with full-on spaghetty manual application of damage modifiers. Hull size based and armor taken modifiers are applied, all others are ignored. So bonus armor damage from mining blaster, for example, should be affected by TA skill, NOT affected by energy mastery, and affected by entropy amplifier.
« Last Edit: March 20, 2024, 04:07:53 AM by Amoebka »
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1330
    • View Profile
Re: Damage Bonuses
« Reply #7 on: March 20, 2024, 05:05:37 AM »

Targeting feed seems to indeed be multiplicative with everything, because of the way it's coded:
Code
fStats.getBallisticWeaponDamageMult().modifyMult(id, 1f + 0.01f * DAMAGE_INCREASE_PERCENT * effectLevel);
So it's not even in the "special" category, it's a tier of its own.
« Last Edit: March 20, 2024, 05:32:40 AM by Amoebka »
Logged

Vanshilar

  • Admiral
  • *****
  • Posts: 605
    • View Profile
Re: Damage Bonuses
« Reply #8 on: March 20, 2024, 10:18:05 AM »

Graviton is a damage taken modifier, applied to the target ship. getDamageToTargetShieldsMult() is a damage dealt modifier, applied to the firing ship. Imagine a hypothetical "deal 10% more damage to shields" officer skill, that would be it. I think nothing in vanilla currently uses it, though.

As already explained by float, damage taken modifiers are never additive with damage dealt modifiers, and have several "partitions" among them as well.

Ahh that's a good point, since every other ship that's hitting the same target ship also benefits from it, so it's affecting the target ship rather than the firing ship. So it's not just a different category but a different effect altogether. Hmm. Wonder if I have to test all the different damage taken modifiers as well (for example, how Graviton Beam stacks with Entropy Amplifier, etc.).

But at least this examination shows that some effects are more "powerful" than others. For example the fact that Graviton Beam's effect will multiply with everything on the firing ship (and on other firing ships) means that its 5% is better than the 5% from Tactical Drills.

EDIT: On top of that, there are also combat listeners that can modify damage.

Yeah I'd like to list out all the possible damage modifiers in vanilla and figure out how they interact with each other (add or multiply). I wonder if those will end up being special cases. Will take some effort to figure out, I guess.
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1330
    • View Profile
Re: Damage Bonuses
« Reply #9 on: March 20, 2024, 10:34:40 AM »

Wonder if I have to test all the different damage taken modifiers as well (for example, how Graviton Beam stacks with Entropy Amplifier, etc.).
I think pretty much all damage taken modifiers are multiplicative with everything. Even the ones that modify the same mutable stat (graviton and amplifier, for example), modify the multiplier of that stat, rather than the flat or the percentage.

Here's a list based on code digging, as opposed to testing:

Group A (everything inside is additive, the group itself is multiplicative with others):
CR (assuming CR > 70%)
Ballistic Mastery (regular and elite)
Tactical Drills
Energy Weapon Mastery
Cybernetic Augmentation
High Energy Focus
High Scatter Amplifier (regular and s-mod)
Missile Specialization (elite)

Group B (everything inside is additive, the group itself is multiplicative with others):
Target Analysis (regular and elite, part that scales with target size)
Wolfpack Tactics
Advanced Turret Gyros (s-mod)
Point Defense
IPDAI
Defensive Targeting Array
Terminator Core (hullmod on Tempest drones)

Special ones (multiplicative with each other and everything else):
Targeting Feed
Target Analysis (bonus damage to engines/weapons part, technically a flat bonus, but it's the only one in its group in vanilla)

Damage taken modifiers are all multiplicative with each other and everything else:
Graviton beam effect
Entropy Amplifier, Damper Field, Fortress Shield, etc
Impact Mitigation, Damage Control, Field Modulation
Resistant Flux Conducts, any other hullmod that modifies damage taken

Bonus damage from weapon listeners (Squall, Breach, etc). Despite being worded similarly, these are implemented dramatically different from one another and scale differently with multipliers above.

An interesing subgroup is Mining Blaster, Breach SRM, and Disintegrator. Bonus armor damage of these is implemented similarly: they scale with bonuses that are based on target size (group B from above), and damage taken modifiers that affect armor damage (Damper Field, Amplifier, etc). Everything else has no effect on their bonus damage part.
Logged

Vanshilar

  • Admiral
  • *****
  • Posts: 605
    • View Profile
Re: Damage Bonuses
« Reply #10 on: March 20, 2024, 11:07:18 AM »

Here's a list based on code digging, as opposed to testing:

Ahh very cool! That's exactly what I was looking for!

I started looking into this based on the observation that Target Analysis seemed to do "more" than what its numbers would suggest, as I mentioned here, and testing showed that it was behaving multiplicatively as opposed to additively with other damage modifiers. Having a complete list is going to be very helpful in figuring out how to build a fleet. Thanks!

It seems like then the only remaining thing to worry about are the "special cases" weapons, i.e. Squall, Breach, certain [REDACTED] weapons, etc., which are much more case-by-case rather than general. Likely a lot more straightforward to test and/or look into code since those are basically known exceptions.

Is there a specific function in the code that lists this out, or is the list based on searching through the code for all instances of a particular modifier function/variable?
« Last Edit: March 20, 2024, 11:20:22 AM by Vanshilar »
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1330
    • View Profile
Re: Damage Bonuses
« Reply #11 on: March 20, 2024, 11:16:28 AM »

Is there a specific function in the code that lists this out, or is the list based on searching through the code for all instances of a particular modifier function/variable?
Sorry, don't quite understand the question. Could you rephrase it?
What I did was basically manually view classes for skills/hullmods/systems, check which mutable stat they modify, and then check if they use modifyPercentage (in which case they are additive with the group of other bonuses that modify the percentage of the same stat), or modifyMult (in which case they are always multiplicative with everything, like Targeting Feed).
For bonus damage on weapons like Squalls, you need to search for them in api/impl/combat, and just read what they do on a case-by-case basis. Some implement OnFireEffectPlugin, some OnHitEffectPlugin, some DamageDealtModifier.

EDIT: Just to give an example of how counter-intuitive these get. Void explosions from Cascade Emitter are improved by bonuses that improve energy weapons. Void explosions from Rift Beam and Rift Lance are improved by bonuses that improve missile weapons. They look pretty much the same in-game.
« Last Edit: March 20, 2024, 11:42:54 AM by Amoebka »
Logged

Vanshilar

  • Admiral
  • *****
  • Posts: 605
    • View Profile
Re: Damage Bonuses
« Reply #12 on: March 22, 2024, 05:04:30 PM »

Sorry, don't quite understand the question. Could you rephrase it?

Oh, I just meant if the code is such that there's a specific function that says "if X1 effect then modify stat by Y1, if X2 effect then modify stat by Y2", etc., or if you're having to look through each effect function to see how it modifies a stat. It looks like it's the latter, so you'd have to look through them one by one.

EDIT: Just to give an example of how counter-intuitive these get. Void explosions from Cascade Emitter are improved by bonuses that improve energy weapons. Void explosions from Rift Beam and Rift Lance are improved by bonuses that improve missile weapons. They look pretty much the same in-game.

Hmm wonder if that's a bug then. I mean there's no reason why they should be missile-based, unless it says so somewhere in the description. Or if it's one of those "hidden" effects.
Logged