Skip to content

Cap hit rate of hitTimeOverride skills at their effect's uptime - #2590

Open
Pyiner wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Pyiner:fix/hit-time-override-uptime
Open

Pyiner wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
Pyiner:fix/hit-time-override-uptime

Conversation

@Pyiner

@Pyiner Pyiner commented Nov 11, 2026

Copy link
Copy Markdown

For a skill whose damage comes from an effect that hits every N seconds (skillData.hitTimeOverride: Firestorm, Thunderstorm, Icestorm, Galvanic Field, Solar Orb, Storm Lance's lodged spear, Elemental Storm, a per-enemy hit limit, ...), CalcOffence sets

output.HitTime = skillData.hitTimeOverride
output.HitSpeed = 1 / output.HitTime

in two places: the per-pass block and the attack block after the passes are combined. TotalDPS is then AverageDamage * HitSpeed * DpsMultiplier. The use rate (Speed) never enters, so the calculation assumes one effect is up all the time.

That holds while the skill is cast at least once per effect duration. It fails when the skill is used less often than its effect lasts. The clearest case is a cooldown support such as Hourglass ("Supported Skills have a Cooldown of 10 seconds", 30% more damage). Example: Firestorm 20 with Hourglass.

  • Speed is 0.0997/s (one cast per ~10 s), Duration is 6.0 s, and there is one impact every 0.2 s.
  • PoB computes HitSpeed = 5/s, i.e. 50.2 hits per cast for a storm that can hit at most 30 times.
  • The DPS is 257,027 with Hourglass against 198,730 without it, so Hourglass shows as +29%. With the storm's uptime accounted for it is 153,883, i.e. −23%.

The other branch (hitTimeMultiplier) already accounts for a cooldown (1 / (HitTime + Cooldown)); only the override branch does not.

Change

After HitSpeed = 1 / HitTime, in both places, cap the hit rate at the effect's uptime when the skill's duration is known:

local effectDuration = globalOutput and globalOutput.Duration
if effectDuration and effectDuration > 0 and (output.Speed or 0) > 0 and not skillModList:Flag(nil, "HasSeals") then
	output.HitSpeed = m_min(output.HitSpeed, output.Speed * effectDuration / output.HitTime)
end

The following are unchanged:

  • a skill cast at least once per duration (Speed * Duration >= 1);
  • a skill with no duration;
  • seals, whose hitTimeOverride is the time to gather the seals, not a hit interval.

Tests

Two specs are added in spec/System/TestOffence_spec.lua:

  • Firestorm + Hourglass: HitSpeed == Speed * Duration / HitTime. This spec fails on dev without the change.
  • Firestorm alone: HitSpeed == 1 / HitTime, unchanged.

Full suite in the pathofbuilding-tests image: 905 successes / 0 failures (dev without the change: 903 / 0).

Open point (not addressed here)

Ball Lightning's projectile has no duration in the skill data. Its stat sets give the hit frequency; the 4 s in its third stat set belongs to the Ignited Ground. With Hourglass it shows the same 50.2 hits per cast. How long one ball keeps hitting a target depends on projectile speed and range, which PoB does not model, so this change leaves it as is.

This is a separate bug from #2588 (conversion order); the two PRs are independent.

🤖 Generated with Claude Code

A skill whose effect hits every N seconds got HitSpeed = 1 / N regardless of
how often it is used, so a cooldown support such as Hourglass made PoB count
hits for the whole cooldown (Firestorm + Hourglass: 50.2 hits per cast for a
6 s storm). Cap HitSpeed at Speed * Duration / HitTime when the duration is
known, in both places hitTimeOverride is applied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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