frzyc / genshin-optimizer

An Artifact optimizer for Genshin Impact.
https://frzyc.github.io/genshin-optimizer/
MIT License
784 stars 233 forks source link

Nilou's Dreamy Dance of Aeons's Bloom DMG Bonus condition is not working correctly. #800

Closed gendoh closed 1 year ago

gendoh commented 1 year ago

When "Dreamy Dance of Aeons's Bloom DMG Bonus" is set to 400% for build constrains, any build is not generated.

Version : 8.28.1

Party : Nahida, Kokomi, Collei - all are just created aka. level 1, default weapon, no aritifacts.

Nilou : C6 Lvl 90. 9/12/12

Build target : Transformative Reactions Bloom DMG

Without any constrains, build with HP 75K is generated image

When set Bloom DMG bonus to 400% for build constraints, no build is generated. image

When set to 399.9,% it's working.

Below code is a database backup for testing.

{"format":"GOOD","dbVersion":22,"source":"Genshin Optimizer","version":1,"characters":[{"key":"Nilou","level":90,"ascension":6,"hitMode":"avgHit","conditional":{"KeyOfKhajNisut":{"afterSkill":"3"},"Nilou":{"c4AfterPirHit":"on","a1AfterSkill":"on","a1AfterHit":"on","c2Dendro":"dendro","c2Hydro":"hydro"}},"bonusStats":{},"enemyOverride":{},"talent":{"auto":9,"skill":9,"burst":9},"infusionAura":"","constellation":6,"team":["Nahida","SangonomiyaKokomi","Collei"],"teamConditional":{},"compareData":false,"customMultiTarget":[],"id":"Nilou"},{"key":"SangonomiyaKokomi","level":1,"ascension":0,"hitMode":"avgHit","conditional":{},"bonusStats":{},"enemyOverride":{},"talent":{"auto":1,"skill":1,"burst":1},"infusionAura":"","constellation":0,"team":["","",""],"teamConditional":{},"compareData":false,"customMultiTarget":[],"id":"SangonomiyaKokomi"},{"key":"Nahida","level":1,"ascension":0,"hitMode":"avgHit","conditional":{},"bonusStats":{},"enemyOverride":{},"talent":{"auto":1,"skill":1,"burst":1},"infusionAura":"","constellation":0,"team":["","",""],"teamConditional":{},"compareData":false,"customMultiTarget":[],"id":"Nahida"},{"key":"Collei","level":1,"ascension":0,"hitMode":"avgHit","conditional":{},"bonusStats":{},"enemyOverride":{},"talent":{"auto":1,"skill":1,"burst":1},"infusionAura":"","constellation":0,"team":["","",""],"teamConditional":{},"compareData":false,"customMultiTarget":[],"id":"Collei"}],"weapons":[{"key":"KeyOfKhajNisut","level":90,"ascension":6,"refinement":5,"location":"Nilou","lock":false,"id":"weapon_0"},{"key":"ApprenticesNotes","level":1,"ascension":0,"refinement":1,"location":"SangonomiyaKokomi","lock":false,"id":"weapon_1"},{"key":"ApprenticesNotes","level":1,"ascension":0,"refinement":1,"location":"Nahida","lock":false,"id":"weapon_2"},{"key":"HuntersBow","level":1,"ascension":0,"refinement":1,"location":"Collei","lock":false,"id":"weapon_3"}],"artifacts":[{"setKey":"TenacityOfTheMillelith","rarity":5,"level":20,"slotKey":"flower","mainStatKey":"hp","substats":[{"key":"enerRech_","value":5.8},{"key":"critRate_","value":7.4},{"key":"hp_","value":23.3},{"key":"atk","value":14}],"location":"Nilou","exclude":false,"lock":false,"id":"artifact_0"},{"setKey":"EmblemOfSeveredFate","rarity":5,"level":20,"slotKey":"plume","mainStatKey":"atk","substats":[{"key":"critDMG_","value":19.4},{"key":"enerRech_","value":10.4},{"key":"hp_","value":16.3},{"key":"def","value":21}],"location":"Nilou","exclude":false,"lock":false,"id":"artifact_1"},{"setKey":"TenacityOfTheMillelith","rarity":5,"level":20,"slotKey":"sands","mainStatKey":"hp_","substats":[{"key":"critRate_","value":7.4},{"key":"hp","value":807},{"key":"eleMas","value":19},{"key":"critDMG_","value":21}],"location":"Nilou","exclude":false,"lock":false,"id":"artifact_2"},{"setKey":"EmblemOfSeveredFate","rarity":5,"level":20,"slotKey":"goblet","mainStatKey":"hp_","substats":[{"key":"enerRech_","value":5.2},{"key":"critDMG_","value":12.4},{"key":"eleMas","value":40},{"key":"critRate_","value":9.3}],"location":"Nilou","exclude":false,"lock":false,"id":"artifact_3"},{"setKey":"MaidenBeloved","rarity":5,"level":20,"slotKey":"circlet","mainStatKey":"hp_","substats":[{"key":"critRate_","value":6.6},{"key":"critDMG_","value":14},{"key":"enerRech_","value":11.7},{"key":"eleMas","value":40}],"location":"Nilou","exclude":false,"lock":false,"id":"artifact_4"}],"buildSettings":[{"artSetExclusion":{},"statFilters":{"[\"passive2\",\"bountifulBloom_dmg_\"]":[{"value":399.9,"disabled":false}]},"mainStatKeys":{"sands":[],"goblet":[],"circlet":[]},"optimizationTarget":["reaction","bloom"],"mainStatAssumptionLevel":0,"useExcludedArts":false,"useEquippedArts":false,"allowPartial":false,"maxBuildsToShow":5,"compareBuild":true,"levelLow":0,"levelHigh":20,"id":"Nilou"}],"buildResults":[{"builds":[["artifact_0","artifact_1","artifact_2","artifact_3","artifact_4"]],"buildDate":1670219420149,"id":"Nilou"}],"charMetas":[],"dbMeta":{"name":"Database 4","lastEdit":1670218873132,"gender":"F"},"display_weapon":{"editWeaponId":"","sortType":"level","ascending":false,"rarity":[5,4,3,2,1],"weaponType":["sword","claymore","polearm","bow","catalyst"]},"display_artifact":{"filterOption":{"artSetKeys":[],"rarity":[5,4,3],"levelLow":0,"levelHigh":20,"slotKeys":["flower","plume","sands","goblet","circlet"],"mainStatKeys":[],"substats":[],"location":"","exclusion":["excluded","included"],"locked":["locked","unlocked"],"rvLow":0,"rvHigh":900,"lines":[1,2,3,4]},"ascending":false,"sortType":"rarity","effFilter":["hp","hp_","atk","atk_","def","def_","eleMas","enerRech_","critRate_","critDMG_"],"probabilityFilter":{}},"display_optimize":{"equipmentPriority":[],"threads":12},"display_character":{"sortType":"level","ascending":false,"weaponType":["sword","claymore","polearm","bow","catalyst"],"element":["hydro"],"pageIndex":0},"display_tool":{"resin":160,"resinDate":1670218129952,"timeZoneKey":"America"}}
StainAE86 commented 1 year ago

That's because the constraints are strickly greater than the value you enter. not equal to or greater than

Since 400% is the maximum dmg bonus - you can never achieve more than 400

nguyentvan7 commented 1 year ago

Think this is some floating point shenanigans. Balakin tested setting an ER min of 100, and builds would still appear just fine. could add some epsilon/fuzzy checking. But I also havent looked into this really, so could be something else

gendoh commented 1 year ago

FYI, with complex data & condition, sometimes 400% is working and sometimes not.

image

When I set all of 1,2 and 3, no build. but when I set 2&3 or 1&3, build is generated.

image

Of course, current equipment is met with all conditions.

gendoh commented 1 year ago

@StainAE86 If "constraints" does not include "equal", working case in my previous comment will be a bug.

I think that constraints are minimum values for builds. So, I expect "equal" is included.

If "equal" is really not included and constraints means just "greater", I think tooltip should be changed. Also, I should fix the Korean translation for it - Korean has explicit words for each "gt" and "eq or gt" case, and I used a word for the later case.

Could you confirm it?

StainAE86 commented 1 year ago

I can't 100% confirm it because I don't know the code. It could infact be greater than or equal to. But I'm pretty confident it's because the "400%" you're seeing in your build isn't actually 400% due to rounding. So because of that you can't trust a whole number and have to always consider that its strictly "greater than".

Like this case from your database file: image You can increase the HP constraint on your build to 75345.22 before the build is not returned. Since the "75345" is rounded down in thise case.

And if I remove 917 HP from your build to drop your DMG Bonus to 399.9%: image

I then have to set the constraint to 399.85% to make the build appear since even tho it's "displaying" at 399.9%, its probably 399.86% rounded up behind the scenes: image

It would seem that the constraint of "400%" is actually considered a higher number than the maximum possible DMG Bonus of "400%" if that makes sense.

So even tho your build has more than 400% - because it's being limited to a maximum "400%" that is below the constraint of "400%". That's why it works if you put the constraint as "399.9%" because the maximum "400%" is larger than that.