[Edit: Oops, this should've gone into the OSRS forum]
This is a more obvious case of a general bugbear about how interpolation works across OSRS, and not having seen the dev tools I can't say how easy any of this is to change, but:
The current metal score calculation does a lot of flooring at intermediate steps in the calculation, and the final score curve can get very distorted as a result. Here's a Desmos page exploring it: https://www.desmos.com/calculator/d9vu8vbkgp
At present, it's very lossy. I'll (try to) include a screencap showing the behaviour for iron/mithril combinations below.
You can see for the total score (black) that the integer function has two peaks with a trough between them, unlike the continuous function, and the value has a habit of unexpectedly decreasing when it should intuitively increase.
It's possible to get around this without doing any real-valued arithmetic, just by rearranging the existing formula to do all the multiplication and summation first followed by one final division step. I've made another Desmos page for that here: https://www.desmos.com/calculator/2ewy4ytefx
Which gives the following iron/mithril graph:
The equation is written in the Desmos page, but is a little hard to parse. Here's the pseudocode:
v1 := 28*tier(1)*amount(1)*10;
v2 := 28*tier(2)*amount(2)*10;
vAlloy := tier(1)*amount(1)*tier(2)*amount(2)*10;
total := (v1 + v2 + vAlloy) / (28 * 28);
The maximum possible intermediate value before division is for 14 adamant/14 rune, which comes out to 101,920 - this fits into 17 bits, but not 16. If it needs to be 16-bit, you can remove the *10 from v1, v2, and vAlloy and do it later:
v1 := 28*tier(1)*amount(1);
[ . . . ]
inter := (v1+v2+vAlloy)/28
total := (10*inter)/28
This is slightly lossier, but still preserves the gradient.
This is a more obvious case of a general bugbear about how interpolation works across OSRS, and not having seen the dev tools I can't say how easy any of this is to change, but:
The current metal score calculation does a lot of flooring at intermediate steps in the calculation, and the final score curve can get very distorted as a result. Here's a Desmos page exploring it: https://www.desmos.com/calculator/d9vu8vbkgp
At present, it's very lossy. I'll (try to) include a screencap showing the behaviour for iron/mithril combinations below.
You can see for the total score (black) that the integer function has two peaks with a trough between them, unlike the continuous function, and the value has a habit of unexpectedly decreasing when it should intuitively increase.
It's possible to get around this without doing any real-valued arithmetic, just by rearranging the existing formula to do all the multiplication and summation first followed by one final division step. I've made another Desmos page for that here: https://www.desmos.com/calculator/2ewy4ytefx
Which gives the following iron/mithril graph:
The equation is written in the Desmos page, but is a little hard to parse. Here's the pseudocode:
v1 := 28*tier(1)*amount(1)*10;
v2 := 28*tier(2)*amount(2)*10;
vAlloy := tier(1)*amount(1)*tier(2)*amount(2)*10;
total := (v1 + v2 + vAlloy) / (28 * 28);
The maximum possible intermediate value before division is for 14 adamant/14 rune, which comes out to 101,920 - this fits into 17 bits, but not 16. If it needs to be 16-bit, you can remove the *10 from v1, v2, and vAlloy and do it later:
v1 := 28*tier(1)*amount(1);
[ . . . ]
inter := (v1+v2+vAlloy)/28
total := (10*inter)/28
This is slightly lossier, but still preserves the gradient.
18-Jul-2023 13:56:50 - Last edited on 18-Jul-2023 14:13:41 by midi trumpet