pa001024 / riven-mirror

极镜 - the impressive warframe tool site
https://riven-im.vercel.app
MIT License
107 stars 20 forks source link

Gas DPS not calculated correctly #22

Closed ProfHugo closed 5 years ago

ProfHugo commented 5 years ago

Describe the bug Kind of a continuation of #20. Simply copying the formula from toxin to gas is incorrect.

Toxin proc's damaging effect only consist of a DoT, which does base damage * (toxin mod multi / 2) per tick for 9 ticks over 8 seconds.

Gas, however, does the following: when the effect procs, it immediately does toxin damage equal to base damage (toxin mod multi / 2) to everything in a 3m radius, then applies a DoT effect to all enemies hit (similar to toxin, but a bit different), which does base damage (toxin mod multi / 2)^2 per tick for 9 ticks over 8 seconds (the toxin portion of the DoT is squared).

In addition, while DoTs like slash and toxin procs gets double dipped (1.55^2 with a maxed primed bane mod) with faction mods (this appears to work correctly in the builder), gas proc gets affected like this: the 3m initial burst gets double dipped, and the DoT gets triple dipped (1.55^3 with a maxed primed bane mod).

To fix this, the initial burst of damage needs to be added to the net proc DPS, the toxin portion of the DoT formula needs to be squared, and if there is a faction mod, the burst needs to account for the double dip, and the DoT needs to account for the triple dip.

Wikia links: https://warframe.fandom.com/wiki/Damage/Toxin_Damage https://warframe.fandom.com/wiki/Damage/Gas_Damage

pa001024 commented 5 years ago

it's a typo in https://github.com/pa001024/riven-mirror/blob/5c264a954cd7f590420c1de89aa38575a2899664/src/warframe/modbuild.ts#L720 should be gasBaseDamage.

pa001024 commented 5 years ago

now it should be correctly

ProfHugo commented 5 years ago

Gas dps is still calculated incorrectly. Generally, with the same toxin multiplier, gas should do more significantly more damage than toxin, since toxin only applies a DoT everytime it procs, while gas not only applies a stronger DoT if enough toxin mods are stacked (base damage (toxin mod multi / 2)^2 is greater than base damage (toxin mod multi / 2) when the toxin multiplier is greater 2), but there's also the additional burst of damage gas applies when it procs. However, it is clearly not the case for pretty much all weapons I've tested the builder with.

Example: Boltor Prime (Crit chance and IPS removed, fire rate reduced to 1 round per sec, and status chance increased to 100% for simplicity sake; the targeted status effect will proc exactly once per second)

Conclusion: Something is terribly off about the gas calculation (and the toxin proc calc isn't very accurate either), because a gas proc should not do less damage than a toxin proc with the same toxin multiplier.

ProfHugo commented 5 years ago

Possible location of error: the function gasBaseDamage() in modbuild.ts is returning the wrong value.

get gasBaseDamage() {
    return hAccMul(this.baseDamage, (1 + this.toxinMul) ** 2 / 2);
}

The correct formula is baseDmg (1 + toxMulti / 2)^2, while this function returns baseDmg ((1 + toxMulti)^2 / 2), which results in incorrect DPS values. In math, exponentiation has priority over multiplication and division, and those operations cannot be done in different order. This applies here aswell. In this case, the correct function should be

get gasBaseDamage() {
    return hAccMul(this.baseDamage, ((1 + this.toxinMul) / 2) ** 2);
}

Addentum: Unless I misinterpreted your code, I'm certain line 720 needs to be fixed aswell, since unlike the other elemental calculations, where dividing by 2 is done last, since we already did this here, to make it correct we have to go back to line 720 and remove that duplicate operation.

Before:

 return [vn, this.toxinBaseDamage * this.procDamageMul * 0.5];

After:

 return [vn, this.toxinBaseDamage * this.procDamageMul];

Addentum 2: The initial burst double dips into faction mods, and the DoT triple dips into faction mods. I'm not familiar enough with that part of the program to propose a fix, but just a heads up that this should be implemented to make it consistent with ingame mechanics.

pa001024 commented 5 years ago
  • Expected Result:

    • Instant Proc Damage per Hit/Second: 46 * (1.9 / 2) = 43.7 dmg
    • Latent Proc DPS: 43.7 * 9 = 393.3 dps
  • Actual Result:

    • 48.94 dmg per hit/tick (slightly off from expected value)
    • 440.5 latent proc dps (which is 48.94 * 9)

image

DoT is affect by crit multiplier. so you need remove crit chance btw

pa001024 commented 5 years ago

This part has been rewrite. should be ok right now.

ProfHugo commented 5 years ago

Ok the DoT part of the gas proc seems to be calculated correctly now. However, right now

Same Boltor (stripped away cc this time):

pa001024 commented 5 years ago
  • The DoT of gas should be triple dipped with faction mods, but right now it's only double dipped.

nop, Instant is double.

ProfHugo commented 5 years ago

I don't think it has twice DoT damage at one time. (like 46 (1.9 / 2) + (46 (1.9 / 2)^2) )

  • Instant Proc per Hit/sec: Initial + DoT = 46 (1.9 / 2) + (46 (1.9 / 2)^2) = 43.7 + 41.515 = 85.215
  • Latent proc DPS: Initial + DoT maxProcStack = 43.7 + 41.515 9 = 417.335 dps

just as follow : Instant Proc per Hit/sec: 46 (1.9 / 2) Latent proc DPS: Initial + DoT (maxProcStack-1)

When gas procs, it does do one tick of its DoT (damage over time) at the same time as the cloud does its instant burst of damage.

Here I used a Prisma Grinlok modded with only 2x 60/60 for gas and 90% toxin mod against an ancient disrupter. image When the bullet (598 dmg) procs gas , it spawns the toxin cloud which dealt 118 toxin damage and procs the toxin DoT, which dealt 146 damage the second it procs, then 146 damage 8 more times over the next 9 seconds. All three damage instance: the damage the bullet deals, the toxin cloud, and the first tick of the DoT, happens at the same time, when the bullet procs gas.

  • The DoT of gas should be triple dipped with faction mods, but right now it's only double dipped.

nop, Instant is double.

The burst of damage the toxin cloud does is double dipped. (1.55^2 with primed bane), and the toxin proc DoT is triple dipped (1.55^3 with primed bane). The wiki demostrates this with their damage calc example.

Here's the exact same test case as the one above, except I added bane of infested in addition to the other mods (don't have primed bane of infested) image Here the bullet does 778 damage (approx. 598 1.3), which spawns a toxin cloud that deals 199 toxin damage (approx. 118 1.3 1.3) and proccing toxin, and the first tick of that toxin proc (which happens at the same time as the other 2), deals 322 toxin damage (approx. 146 1.3 1.3 1.3) damage, then 322 damage 8 more times over the next 9 seconds.

pa001024 commented 5 years ago

image

image

about 8 times

ProfHugo commented 5 years ago

Actually, why not just seperate and create a new section for the gas's toxin DoT. Instead of combining it under "Gas," have "Gas (Cloud Burst Damage)" which only has the DPS values for the cloud, and "Gas (Toxin DoT)," which contains the DPS values of the DoT (what "Gas" has now). Both would share the same proc % chance per hit and such, but calculates their DPS values seperately.

ProfHugo commented 5 years ago

Right now the only issue left (I think) is that the instant burst of damage that gas does when it proc is not accounted for. It seems like the status calc is displaying the toxin DoT portion of the gas proc correctly.

pa001024 commented 5 years ago

Actually, why not just seperate and create a new section for the gas's toxin DoT. Instead of combining it under "Gas," have "Gas (Cloud Burst Damage)" which only has the DPS values for the cloud, and "Gas (Toxin DoT)," which contains the DPS values of the DoT (what "Gas" has now). Both would share the same proc % chance per hit and such, but calculates their DPS values seperately.

maybe a good idea