Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WorldObjectDamageWorker.cs #2751

Merged
merged 5 commits into from
Oct 26, 2023
Merged

Conversation

CMDR-Bill-Doors
Copy link
Contributor

@CMDR-Bill-Doors CMDR-Bill-Doors commented Sep 12, 2023

Changes

Makes damage field in shellingproperties replace evaluated damage instead of multiply it

Reasoning

Imagine, now we have a nuclear LGIS missile dealing 1.145 x E^-14 damage to a tribe tent, which isn't much. I wrote 1000, expecting damage to be 1000, but it's not. It's 1.145 x E^-11.
If someone wanted to code a projectile's damage, one have to know how many damage it does before coding, and for those without the few hardcoded damage types, usually none.
Changing it from result *= damage to result = damage makes it more sensible for anyone who intend to change a projectile's shelling damage, especially those that doesn't do any damage before.

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • (For compatibility patches) ...with and without patched mod loaded
  • Playtested a colony (specify how long)

@CMDR-Bill-Doors CMDR-Bill-Doors requested review from a team as code owners September 12, 2023 19:13
@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6163867794.zip

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Sep 12, 2023
@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6172297507.zip

@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6240076582.zip

@MaxDorob
Copy link
Contributor

Originally this damage property was used as a mulitplier for damage.
Check 155mm howtizer

Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this turns only the damage tag into a flat overwrite rather than a factor? I'm onboard with the change--it's more straightforward for cases where we want fine control over a shell's properties, and the existing auto calculations for damage generally have us covered for most cases.

However, it doesn't appear to be working (if I'm understanding the override damage correctly). If I add an overwrite value of 15 to a shell and fire it at a settlement, it should do 15 damage to the settlement's HP, is that correct?

Because, at present shells with a custom damage value of about 70 are only doing 0.003 damage to the settlement. Setting the value to 200 increased the damage done to 0.005. Is it intended for the overwrite to work that way?

@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6467018100.zip

@N7Huntsman
Copy link
Contributor

No issues in testing, but I think there's some damage value scaling that might still need to be done in the xml?

Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied remarks from Discord:
From a bit more testing of #2751, the xml value of damage set for shells is not translating to the HP damage dealt to settlements. I'm testing values of 10 and it's dealing 500+ damage, wiping out Empire settlements in one hit.

@@ -37,12 +37,13 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction)
var result = FragmentsPotentialDamage(projectile) + ExplosionPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier);
//Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained
result /= 3500f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we actually dividing the xml-defined damage by the factor of 3500? Or is it only being applied to the damage being automatically calculated from the shell properties?

@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-6625575775.zip

Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues in testing, and the change from a multiplier to a flat override is easier to wrangle from a balancing perspective.

@N7Huntsman N7Huntsman merged commit 9f6588a into Development Oct 26, 2023
2 checks passed
@N7Huntsman N7Huntsman deleted the world-tile-damage-change branch October 26, 2023 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Download in Comments This PR has a zipfile download available.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants