xenesty / AkashaScanner

A Genshin Impact tool to export achievements, characters, artifacts, and weapons.
MIT License
89 stars 12 forks source link

Few "Invalid" main stat in artifacts #10

Open starrynte opened 1 year ago

starrynte commented 1 year ago

Describe the bug

  1. I scanned 984 artifacts, 5 of them had "Invalid" main stat in the ScannedData/artifacts json. All the "Invalid" artifacts were Clam pieces, 4 were HP% and 1 was DEF%.
  2. Trying to export to GOOD with "Invalid" main stat causes a crash. Was able to work around by manually fixing the "Invalid" pieces and restarting.
    System.Collections.Generic.KeyNotFoundException: The given key 'Invalid' was not present in the dictionary.
    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    at AkashaScanner.Core.Exporters.GoodExporter.Export(String& output, IDataFile`1 weaponFile, IDataFile`1 artifactFile, IDataFile`1 characterFile) in C:\Users\Kith\workspace\AkashaScanner\AkashaScanner\Core\Exporters\GoodExporter.cs:line 110
    at AkashaScanner.Ui.Pages.Exports.GoodExports.HandleSubmit()
    at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    at Microsoft.AspNetCore.Components.WebView.IpcSender.<>c__DisplayClass9_0.<NotifyUnhandledException>b__1()
    at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.InvokeAsync(Action workItem)
    at Microsoft.AspNetCore.Components.WebView.WindowsForms.WindowsFormsDispatcher.<>c.<.cctor>b__8_0(Exception exception)

Expected behavior No "Invalid" scans / app shouldn't crash when exporting

Screenshots Couple of the problematic pieces a2 a1

Additional context Didn't see any errors in the log

2023-01-21T04:36:46.9844665-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:46.9845306-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = CritRate, Level = 0, Substats = [{ Type = HpPercent, Value = 5.3 }, { Type = AtkPercent, Value = 4.1 }, { Type = AtkFlat, Value = 19 }], EquippedCharacter =  }" (0e5b8177)
2023-01-21T04:36:47.1591323-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:47.1591865-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = Invalid, Level = 0, Substats = [{ Type = CritDmg, Value = 5.4 }, { Type = CritRate, Value = 3.1 }, { Type = HpFlat, Value = 239 }], EquippedCharacter =  }" (0e5b8177)
2023-01-21T04:36:47.3744723-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:47.3745249-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = CritRate, Level = 0, Substats = [{ Type = DefFlat, Value = 23 }, { Type = CritDmg, Value = 7.0 }, { Type = AtkPercent, Value = 5.3 }], EquippedCharacter =  }" (0e5b8177)
2023-01-21T04:36:47.6638706-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:47.6639425-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = HealingBonus, Level = 0, Substats = [{ Type = CritRate, Value = 3.5 }, { Type = EnergyRecharge, Value = 6.5 }, { Type = AtkFlat, Value = 18 }], EquippedCharacter =  }" (0e5b8177)
2023-01-21T04:36:47.7645527-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:47.7645971-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = Invalid, Level = 0, Substats = [{ Type = ElementalMastery, Value = 21 }, { Type = EnergyRecharge, Value = 4.5 }, { Type = DefFlat, Value = 19 }], EquippedCharacter =  }" (0e5b8177)
2023-01-21T04:36:47.8603466-08:00  [WRN] Fail to identify `"Sma Dved Foam"` (c1e5f424)
2023-01-21T04:36:47.8603887-08:00  [INF] Artifact: "Artifact { SetName = Ocean-Hued Clam, Slot = Circlet, Rarity = 5, MainStat = HealingBonus, Level = 0, Substats = [{ Type = ElementalMastery, Value = 16 }, { Type = HpPercent, Value = 4.1 }, { Type = DefFlat, Value = 21 }], EquippedCharacter =  }" (0e5b8177)

I did have Windows night light on, maybe that could have affected the scan?

xenesty commented 1 year ago

I am currently working on improving accuracy and reducing CPU usage of the weapons/artifacts scan. I do notice sometimes the scanner gives incorrect results, but mostly on substats/equipped characters and never on the main stats. Thanks for letting me know and I will look into it.