Skip to content

Add expected burn damage to DPS#836

Open
jmyaeger wants to merge 3 commits intoweirdgloop:mainfrom
jmyaeger:expected-burn
Open

Add expected burn damage to DPS#836
jmyaeger wants to merge 3 commits intoweirdgloop:mainfrom
jmyaeger:expected-burn

Conversation

@jmyaeger
Copy link
Copy Markdown
Contributor

This adds the expected burn damage from the eclipse moon set effect and the fire spell burn pact to the DPS calculation. The burn cap of 5 stacks is accounted for here by using a Markov chain model to determine the steady-state probability of being at 5 stacks on an attack tick, and then using that to reduce the burn proc chance by accounting for wasted procs. All of the cases I've tested line up well with simulation results.

Note that this does not add burn to either of the TTK calculations, as that is significantly more challenging. I changed the warning on the eclipse moon set to specify that the set effect is included in DPS but not TTK. I didn't add a similar message for the fire spell pact, but I can add that if desired.

@orlp
Copy link
Copy Markdown
Contributor

orlp commented Apr 12, 2026

I made another PR for this which doesn't account for the losses burns at max stacks, simply capping stacks at max 5 after averaging: #825. That may be too simplistic.

This approach seems rather expensive. Could you compare your numbers for capProb with the expected loss probability calculated by the Erlang B function from queuing theory?

def erlang_b(E: float, m: int) -> float:
    """Calculate the probability of call losses."""
    inv_b = 1.0
    for j in range(1, m + 1):
        inv_b = 1.0 + inv_b * j / E
    return 1.0 / inv_b

def burn_loss_prob(burn_chance: float, speed: float):
    return erlang_b(burn_chance * 40 / speed, 5)

@orlp
Copy link
Copy Markdown
Contributor

orlp commented Apr 12, 2026

I have implemented the Erlang B loss formula in my PR: #825.

@jmyaeger
Copy link
Copy Markdown
Contributor Author

This approach is indeed more expensive than the Erlang B formula, but it is very accurate. For example, in the case of an eclipse moon set with 100% accuracy, capProb is 0.0475076, which yields an expected burn per hit of 1.9049 and therefore a marginal DPS of 1.0583 - exactly what I was getting with simulations. By comparison, the Erlang B formula you provided predicts a burn loss of 0.0825457, which would lead to an expected burn of 1.8349 and a marginal DPS of 1.0194. The results are similar for the fire spells pact - for example, capProb = 0.625 for 3-tick fire spells with 100% accuracy, whereas the Erlang B loss is 0.65924.

The performance seems fine for the most part, with the exception of generating a plot of monster magic level vs. DPS for a monster with a high magic level for the fire spell pact - there's a noticeable delay in that because it takes longer to converge for very high proc chances. But the eclipse moon set performs pretty well even when plotting, and both perform well when just calculating results in the table. Given that the fire spell pact is a temporary effect and that the majority of people just use the table values anyway, I think the performance issues for plotting fire spells are acceptable, but I will leave that up to Llemonduck to decide.

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