Skip to content

Fix dual wield skills with "both weapons hit..." combining into a single hit#2006

Open
majochem wants to merge 13 commits into
PathOfBuildingCommunity:devfrom
majochem:fix/dualWield
Open

Fix dual wield skills with "both weapons hit..." combining into a single hit#2006
majochem wants to merge 13 commits into
PathOfBuildingCommunity:devfrom
majochem:fix/dualWield

Conversation

@majochem
Copy link
Copy Markdown
Contributor

@majochem majochem commented May 29, 2026

Description of the problem being solved:

PoB2 until now assumed that the doubleHitsWhenDualWielding behaved similar to PoE1, where both weapons do a single combined hit. However, as confirmed by Viperesque from GGG and in-game testing, the skills actually perform two separate near simultaneous hits. As a result, Average Damage, Attack Rate and the Effective Crit Chance are all currently wrong (combined hit makes the hit count as critical, as long as one of the weapons crits)

This PR:

  • Adjusts interpretation of doubleHitsWhenDualWielding to instead perform two hits
  • Changes the existing logic for combined hits to look for combinesHitsWhenDualWielding. *(Note: There's currently no skill in the game that has such behavior, but it is likely to be included with future weapon types, so we will still need the logic)

Steps taken to verify a working solution:

  • Hit rate correctly gets doubled
  • Hit damage no longer gets combined
  • Doesn't apply to "Armour Breaker" skill which alternates weapons
  • Doesn't double mana costs or other "per use" mechanics
  • TotalDPS values are correct for all dual wield variations
  • Full DPS calculation still works
  • Added automatic tests for Dual Wield DPS and Crit Chance

Link to a build that showcases this PR:

Build with test maces

Limitations:

  • The doubling of the attack rate is not technically accurate because there is a slight delay between first and second hit, which would screw up any trigger calculations that rely on precise timing. Those values likely depend on animation length though, so we don't have any data yet and we don't support triggers so far anyways 🤷
  • We don't have a great breakdown for "DPS" i.e. hit rate multiplier mods. The current one shows that it's multiplying the "Average Damage", but it's not very visible imo. Changing DPS breakdown should be a separate PR though.

Before screenshot:

Average hit wrongly combines damage
image

No DPS Multiplier
image

After screenshot:

Average hit corrected
image

New DPS Multiplier
image

majochem added 4 commits May 29, 2026 11:06
In PoE2 `doubleHitsWhenDualWielding` does not actually cause a combined
hit from both weapons, but instead causes two separate near simultaneous
hits.

In order to still be able to reuse the old logic, I changed all checks
for `doublenHitsWhenDualWielding` to `combinesHitsWhenDualWielding`
instead. Support for the old flag will be in separate commit.
Now correctly reflects behavior of the three possible dual wield hitRate
scenarios:
1. One combined hit from both weapons (Harmonic Mean)
2. Two separate simultaneous hits from each weapon (2x Harmonic Mean)
3. Alternating between Mainhand and Offhand (Harmonic Mean)
This is still not ideal imo, but it's mostly due to the fact that
we don't have a good breakdown for "DPS" mods
@majochem majochem marked this pull request as ready for review May 29, 2026 15:53
majochem added 3 commits June 1, 2026 10:25
Found this bug when expanding `PasteSocketGroup()`, which probably
wasn't a problem until now because it could only occur with `testInput`
Also added emmylua annotations for easier understanding of the
`testInput` structure
@majochem majochem marked this pull request as draft June 2, 2026 11:33
majochem added 6 commits June 2, 2026 14:22
Since `skillData.dpsMultiplier` was multiplied with itself in each pass,
any modifiers would be applied twice for dual wield skills. Instead it
is now added to `output.DpsMultiplier` and combined with `combineStat()`
Previously got a failed test because DPS value were not equal after 10
decimals ...
@majochem majochem marked this pull request as ready for review June 2, 2026 16:49
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.

1 participant