xanthics / PoE_Weighted_Search

Code to generate pathofexile.com/trade searches based on dps weights
MIT License
34 stars 2 forks source link

Comparing different quantities? #18

Closed Nightblade closed 5 years ago

Nightblade commented 5 years ago

(Apologies if this is hard to follow, I'm not well and I'm fighting a heap of brain-fog atm.)

Is this code is comparing different quantities of some stats? For example, here's 3 lines from mods.json :

"12% increased Cold Damage"
"Adds 14 to 31 Cold Damage"
"Damage Penetrates 8% Cold Resistance"

This is going to calculate incorrect weightings unless I'm missing something, which is quite possible.

This could be easily fixed by changing mods.json so that each mod is normalized to 1 unit. Using the example above:

"1% increased Cold Damage"
"Adds 1 to 1 Cold Damage"
"Damage Penetrates 1% Cold Resistance"
Nightblade commented 5 years ago

Upon further investigation, I think the web page does something to normalize the stats. If this is the case please close this issue! :)

coldino commented 5 years ago

Covered in https://github.com/VolatilePulse/PoB-Item-Tester/issues/10.

xanthics commented 5 years ago

From mods.json {"name": "pdot", "desc": "12% increased Damage over Time", "count": 12},

From index.html

for elt in doc.get(selector='input[type="number"]'):
     dps[elt.name] = float(elt.value)/float(elt.getAttribute("data-normal"))

data-normal == count