-
First Dev On The Internet
Item perfection discussion
Hi all,
So I saw we can get Item perfection and started a little plugin to show it (not released).
I also saw in the changelog that displaying item perfection was default but was removed from Turbohud, maybe because that stat is pointless in many cases.
I don't know how item perfection is calculated but I think it's probably a percentage average of each primary, secondary stat percentage of each max stats available from the item. (not sure if I'm clear here).
I think that it can become useful if we calculate it another way (yes I know I don't know yet how it's really calculated at first ) :
- Maybe the max stats can be taken from the max ancient legendaries stats, that way it will be easier to compare different ancient ranks of a same item.
(how it is calculated now it looks like you can have a legendary with a very good item perfection percentage but not as good as the same item version ranked ancient with a lower item perfection percentage)
Edit : After some research Legendaries & ancient legendaries versions of the same item don't roll exactly the same affixes so It will be difficult to compare..
- Maybe we can calculate a more useful "damage perfection" or "toughness perfection" percentage depending of the type of stats that rolled.
(e.g : an item with more rolled stats like, Critical hit chance, attack speed, critical hit damage will have a good offense perfection and an item with rolled stats like armor, life, life on hit, any resist type will have a good defense perfection).
I'm just sharing some ideas here and waiting for game experts ideas and opinions.
Last edited by User5981; 09-21-2017 at 07:33 AM.
-
Post Thanks / Like - 1 Thanks
cherouvim13 (1 members gave Thanks to User5981 for this useful post)
-
First Dev On The Internet
So I am currently working on that plugin :
It displays :
check mark : % item perfection
crossed swords : % item offense orientation
Shield : % item defense orientation
Globe : % item resource orientation
Heart : % item life orientation
Boot : % item adventure orientation
-
Member
This is really nice. Might I suggest below Jacks WeaponDamageRerollCalculatorPlugin?
-
HUD uses the min-max range of the currently rolled affix. Since ancient attributes are different affixes, those can not be considered in the item's perfection calculation (there is no 1:1 mapping between the 2 sets of affixes).
Do not send me private messages unless it is absolutely necessary or the content is sensitive or when I ask you to do that...
-
Post Thanks / Like - 1 Thanks
User5981 (1 members gave Thanks to KillerJohn for this useful post)
-
Contributor
I have following code to calculate attribute (perfection) rank:
Please correct if my formula has errors or is flawed!
Code:
public class RankFormula : IRankFormula
{
public int calculateRank(IItemPerfection perfection)
{
double cur = perfection.Cur;
double min = perfection.Min;
double max = perfection.Max;
if (perfection.Attribute.ValueType == AttributeValueType._float)
{
// Current value can have rounding errors which can affect min/max comparision, fix it here.
if (Math.Abs(max - cur) < 0.0001) cur = max; else if (Math.Abs(cur - min) < 0.0001) cur = min;
}
return (int)calculate(cur, min, max);
}
public int calculateWeaponDamageRank(IItemPerfection pmin, IItemPerfection pdelta)
{
// Baseline (min) damage values.
double cur = pmin.Cur;
double min = pmin.Min;
double max = pmin.Max;
double dmgMin = calculate(cur, min, max);
// Maximum (delta) damage values added to baseline.
cur += pdelta.Cur;
min += pdelta.Min;
max += pdelta.Max;
double dmgMax = calculate(cur, min, max);
return (int)((dmgMin + dmgMax) / 2.0); // Average min/max damage.
}
double calculate(double cur, double min, double max)
{
double value;
if (cur > min && cur < max)
{
// Current value relative distance % from Min to Max (0-100).
value = (((cur - min) / (max - min)) * 100);
}
else
{
// For example: "Sockets [1-1]=1" or "Crossbow [1-1]=2"
value = !(cur < max) ? 100 : 0;
}
return value;
}
}
Sample image, you get the idea!
[Edit] JackCeparou suggested to use this to fix rounding errors:
Code:
double cur = Math.Round(pmin.Cur, 2);
Last edited by JarJarD3; 10-11-2017 at 01:21 AM.