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

Add ailment threshold #628

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

OrderedSet86
Copy link
Contributor

@OrderedSet86 OrderedSet86 commented Jan 27, 2025

Old PR: #434 (not the same PR due to fork shenanigans)

No issue fixes yet, might help with #178 though. Pushed early to avoid work duplication conflicts with other devs.

Description of the problem being solved:

  • Previous elemental ailment calc would always give 0% for non-crit and 100% for crit to apply ailment. Seems to be just PoE1 calc and missing values in PoE2
  • Ignite and Shock calcs should use Enemy Ailment Threshold for % chance to apply, and were not
  • Order of ailment breakdown in Calcs tab was confusing, values referenced in one hover breakdown were not consistently coming from above data (you had to read back and forth)

Steps taken to verify a working solution:

  • Compare to in-game tooltips for implementation reference

Implementation notes / stuff to still be done in future patches

  • Add standardized terminology for types of ailments in PoE2:
"Flat chance ailments"
[Ailments that require chance and ignore threshold]
- Bleed (damaging)
- Poison (damaging)

"Scaling threshold ailments"
[Ailments that use enemy ailment threshold (1% chance per 4% ailment threshold dealt)]
- Ignite (damaging)
- Shock (non-damaging)

"Minimum threshold ailments"
[Ailments that "require a minimum threshold" (unknown number) but then always apply]
- Chill (non-damaging)

"Buildup ailments"
[Ailments that use buildup mechanic]
- Electrocute (non-damaging)
- Freeze (non-damaging)
- Stun (non-damaging - note that I think the game doesn't consider this an "ailment")
  • Bleed, Shock, Poison, and Ignite chance values should be computed correctly now. My chance values for Shock and Ignite use the average hit applied to the enemy ailment threshold. [In the future for maximum correctness, these should actually say the chance range (since now ignite/shock chance scales with the hit damage roll).]
  • Move damage functions above ailment chance code, as now this is required for Ignite and Shock.
  • Added Enemy Ailment Threshold to ailments it matters for (ignite and shock), and added to breakdown
  • For Chill threshold I just guessed 60% of Enemy Ailment Threshold, the tooltip is quite vague:
    image
  • Not sure how freeze/stun/electrocute (buildup ailments) should be implemented. I set freeze and electrocute chance on hit variables temporarily to 0, they are buildup ailments anyway so I'm not sure how much "chance on hit" would be meaningful
  • I sorted the calc tab ailments in "calculation order", ie which values have to be known in which order to compute the final value. This matches how damage calculations are sorted.
  • Removed logic for various legacy ailments, like PoE1 "alt" ailments (scorch, sap, brittle)
  • Update knockback calculation (there was some knockback calculation in ailment calc for some reason)
  • Fix logic error in canDoAilment causing calcAilmentSourceDamage to unconditionally return 0 damage.

Link to a build that showcases this PR:

I made an Ailment Demo project which applies the following effects:

  • Poison
  • Bleed
  • Ignite
  • Chill
  • Shock
eNqtW-tz2zgO_1z_FRrP3M3dnOPo_cglu-M4SZNeHl47abv7pcNYtK1GllyJyqM7_d8PICVZdkxZTrs7k8oifgAIAiAI2oe_P89D5ZEmaRBHR22tq7YVGo1jP4imR-2727M9t_37b63DAWGzm8lxFoQ4ov_WenfIPyghfaQhAFUAjkOSptdkTo_anwI2nrUVko5p5PeX74_DOPaVKzKlbYWRZErZx0K2-kUDFjOSkDGjySXy7WUsvop9wE1ImAJkToJoFI8fKHufxNkC5LaVx4A-CaKLq8HN8LYNyr07HITkhSYjRpiSwp-jdg8mCWJPyJwLfyRhBhBb87q2ZVi24anwp71fCz7OkpS9jcNoQalfgrSuZpsy0kFCTycTOmbBI-0nAevPSDReCrRkuF1pr7KQBYswoElJr8voz1-xxhWXEN_GjIQng1FJ6-haV3dsx3QN19bselzMSpxUwnEI1qxKMNSursMyGI50yuCSs1c4x9K6lmrorq4ZNZpdTKOA0SpQs7uO6ZmWZdfJe41zDLer6rauGl6dKQZxkMbRikCna3me7daJe41Cca5jm3ozy1ehttm1HMu2PUPuRVkYQjqooqRLNqQpTR4JC1YVlNL34_l9EK2tlmt1XUs3NcepW61eQsnNRMTQkPhBll5RltB06eZdafBdkYj045RVzFBHOqAJZDi2glC3AEZ0HENSrEIcs2t6dgNBm-FSiZfBhDacDZLuNJscsPNsKoJ2nM3pqCndzozfptAQNoJmlKM4CxtSsmU6tqX5-I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xCe6m4TVrZJy0nqphzSn-G92mZ7whGycGpxoOSffmsd7r_6re7_AU6W75c=

Before screenshot:

image
image

After screenshot:

image
image

- canDoAilment is currently unconditionally returning false - possible
  bug with calcAverageSourceDamage ?
1. Make effective DPS visible again
2. Make damage per stack visible again (renamed to "Dmg./<ailment>
   Stack" for clarity)
@OrderedSet86 OrderedSet86 force-pushed the add-ailment-threshold branch from 9a226b4 to ce2ce4d Compare January 27, 2025 03:42
{ label = "Ailment modifiers", modName = "AilmentChance", cfg = "skill" },
}, },
{ label = "Magnitude Effect", { format = "x {2:output:IgniteMagnitudeEffect}", { modName = "AilmentMagnitude", cfg = "ignite" }, }, },
{ label = "Enemy Ail. Thresh.", { format = "{0:output:EnemyAilmentThreshold}", { modname = "EnemyAilmentThreshold" }, }, },
Copy link
Contributor

Choose a reason for hiding this comment

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

modname -> modName

{ label = "Off hand modifiers", flag = "weapon2Attack", modName = { "EnemyShockMagnitude", "ShockAsThoughDealing" }, cfg = "weapon2" },
{ label = "Enemy modifiers", modName = "SelfShockEffect", enemy = true },
}, },
{ label = "Enemy Ail. Thresh.", bgCol = colorCodes.SHOCKBG, flag = "shock", { format = "{0:output:EnemyAilmentThreshold}", { modname = "EnemyAilmentThreshold" }, }, },
Copy link
Contributor

Choose a reason for hiding this comment

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

modname -> modName

@OrderedSet86
Copy link
Contributor Author

OrderedSet86 commented Jan 27, 2025

The functional part is done for now, should be mergeable as is. I removed the draft tag.

Changes I'd like to do later (all breakdown or non functionality source code improvements):
image

@OrderedSet86 OrderedSet86 marked this pull request as ready for review January 27, 2025 04:31
@OrderedSet86
Copy link
Contributor Author

Updated PR description to accurately reflect changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants