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

Incorrect calculations for certain input #13

Closed
ThePharros opened this issue Jul 3, 2021 · 6 comments
Closed

Incorrect calculations for certain input #13

ThePharros opened this issue Jul 3, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@ThePharros
Copy link

The below input results in incorrect output:

Input:
image
image
image
image

Output:
image

@ThePharros
Copy link
Author

And these are the values I got in a custom DPS calculator for the above input:

image

@LlemonDuck
Copy link
Owner

LlemonDuck commented Jul 3, 2021

Crystal armour strength multiplier was being derived incorrectly from the attack bonus (was 2 * attBonus instead of 2 * (attBonus - 1) + 1, to double 30% => 60% instead of 130% => 260%).

Fixed in 512046b. Will push out immediately as a quick fix.

We still had some discrepancies in our calculations, but I didn't see anything else that would be incorrect. Here are the new values I got:

image

@ThePharros
Copy link
Author

Ah that would do it lol, thanks for the quick fix. Yeah I'm not sure where the discrepancies arise. Seems like mine is calculating higher accuracy with lower damage by comparison. Would you mind sharing some behind the scenes calculations? Since the Max Hit gets calculated early we could start from there. calculation I'm getting:

Effective Ranged Strength:
ERS = ⌊(⌊(RangedLvl + Boost) * PrayBonus⌋ + AttStyle + 8) * VoidModifier⌋
= ⌊(⌊(99 + 13) * 1.23⌋ + 0 + 8) * 1⌋
= ⌊(⌊137.76⌋ + 8)⌋
= ⌊137 + 8⌋
= 145

Max Hit:
Gear Ranged Strength = 113
Gear Bonus = 1.275
Max = ⌊0.5 + (ERS * (GRS + 64) * GB) / 640⌋
= ⌊0.5 + (145 * (113 + 64) * 1.275) / 640⌋
= ⌊0.5 + (145 * (113 + 64) * 1.275) / 640⌋
= ⌊0.5 + 32,722.85 / 640⌋
= ⌊51.6294921875⌋
= 51

Let me know if I made any mistakes.

@LlemonDuck
Copy link
Owner

Well I just realized I got strength and attack backwards so I have to push out another update 😞. Fixed in ac3c693.

You do have the order a little off there: I apply the gear and crystal bonuses after the +320 /640, which matches the wiki page here:
https://oldschool.runescape.wiki/w/Damage_per_second/Ranged#Step_two:_Calculate_the_maximum_hit

The only part I'm not sure about is whether the two gear bonuses should be applied multiplicatively then rounded, or rounded separately. I wasn't able to find good resources on this aspect.

@ThePharros
Copy link
Author

lol no worries.

and that order shouldn't matter as it's just associative property of multiplication; the calculation will come out the same.

According to the ranged rebalance blog, the crystal armor and slayer helm bonuses stack together additively:

For example, we expect using an imbued Slayer Helmet with the Crystal Body and Legs to be popular, as it’ll grant a total bonus of 40% Ranged accuracy and 27.5% Ranged damage while on any Slayer task.

In order of default, slayer helmet(i), crystal body, and crystal legs:

Gear Bonus Damage = (1 + 0.15 + 0.075 + 0.05) = 1.275
Gear Bonus Accuracy = (1 + 0.15 + 0.15 + 0.1) = 1.4

which matches the blog's values.

@LlemonDuck
Copy link
Owner

Closing for now, since the original crystal armour bonuses were resolved.

Residual changes needed for gear bonus additivity can be tracked in #17.

@LlemonDuck LlemonDuck added the bug Something isn't working label Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants