Andrewthe13th / Inventory_Kamera

Scans Genshin Impact characters, artifacts, and weapons from the game window into a JSON file.
MIT License
655 stars 113 forks source link

Inventory Kamera closes while scanning the Gladiator's artifact set feathers. #120

Closed Washaka closed 2 years ago

Washaka commented 2 years ago

Hi, I downloaded and followed the instructions correctly. Inventory Kamera automatically closes while scanning Gladiator's artifact set Feathers. I tried upgrading that feather, then the other. Now it crashes at the sands lol. Please help me.

It crashes after the same duration of the scan at the artifacts always. Even if I scanned the weapons before it would crash at the exact same point.

By the way, I don't have any error code because the app closed.

Ibrahimmushtaq98 commented 2 years ago

Although this doesn't happen for me on the gladiator set, it does happen to me with the Hour of Soothing Thunder artifact. In the code the setName in CatalogueFromBitmapsAsync liner 456 eturns null which breaks the conditional found in IsValidSetName within Scrapper.cs

There needs to be a check for checking if any of the name is null or not. I am assuming its the OCR returning null on this as well

Washaka commented 2 years ago

Hey thanks for your quick reply! So you are saying you got an error report not like me? and do what? I mean, do the developers need to do something or us? I'll be here waiting for your response. TY.

Cupcak3 commented 2 years ago

Does the entire application close or just the scan stops? If the entire application closes please try regenerating the lookup tables under options.

Ibrahimmushtaq98 commented 2 years ago

@Washaka I have some dev knowledge so I debugged it using the source code. Honestly I could provide a fix which adds a conditional but its up to the dev for this.

@Cupcak3 The entire application close because of a NullException occurring which isn't being handled. I did try regenerating the lookup table using the option and update everything, it just fails at the same spot

Ibrahimmushtaq98 commented 2 years ago

Here is an update from me. Currently it stopped here where the picture is at image

image

This is where it stopped in code. Here is the detail

System.ArgumentNullException
  HResult=0x80004003
  Message=Value cannot be null.
Parameter name: key
  Source=mscorlib
  StackTrace:
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains(TKey item)
   at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value)
   at InventoryKamera.Scraper.IsValidSetName(String setName) in C:\Users\Ibrahim\source\repos\Inventory_Kamera\InventoryKamera\Scraper.cs:line 202
   at InventoryKamera.Artifact.IsValid() in C:\Users\Ibrahim\source\repos\Inventory_Kamera\InventoryKamera\Artifact.cs:line 77
   at InventoryKamera.InventoryKamera.ImageProcessorWorker() in C:\Users\Ibrahim\source\repos\Inventory_Kamera\InventoryKamera\InventoryKamera.cs:line 193
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

  This exception was originally thrown at this call stack:
    System.Collections.Generic.Dictionary<TKey, TValue>.FindEntry(TKey)
    System.Collections.Generic.Dictionary<TKey, TValue>.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains(TKey)
    System.Linq.Enumerable.Contains<TSource>(System.Collections.Generic.IEnumerable<TSource>, TSource)
    InventoryKamera.Scraper.IsValidSetName(string) in Scraper.cs
    InventoryKamera.Artifact.IsValid() in Artifact.cs
    InventoryKamera.InventoryKamera.ImageProcessorWorker() in InventoryKamera.cs
    System.Threading.ThreadHelper.ThreadStart_Context(object)
    System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, object, bool)
    System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, object, bool)
    System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, object)
    ...
    [Call Stack Truncated]
Ibrahimmushtaq98 commented 2 years ago

Another update from me (I am extremely sorry for the comment spam). I added a code that just checks if there is a null for setName and just debugged ScanArtifactSubStats

When Scrapper.AnalyzeText happens, it returns for this particular artifact this value

var text = Scraper.AnalyzeText(n, Tesseract.PageSegMode.Auto).ToLower();
//text = "+ def+16\n\n+ def+6.6%\n\n+ atk+5.3%\nthundersoother:\n\n \n"

As you can see its missing quite some data including the primary modifier

here is the artifact that it stopped on for reference image

Cupcak3 commented 2 years ago

Thank you for the extra details.

The artifact that the scanner stops on is not related to the artifact that causes a crash. Finding the artifact with those corresponding text will be more helpful. However that line is what I expect as the substats and set name are determined together and independently from the other pieces of information about the artifact (main stat, level, and lock). The line is paresable and should not cause a crash should you step through it line by line.

Ibrahimmushtaq98 commented 2 years ago

@Cupcak3 Ok you are right on this. For the time being I just added another condition and it works

if (setName != null && (Artifacts.Keys.Contains(setName) || Artifacts.Values.Contains(setName)))
ShatteredGod commented 2 years ago

i have the same issue, the program stops and closes by itself when it tries to scan a gladiator artifact. unfortunately it doesn't show any errors, it just crashes. I did try to delete that specific artifact, but it didn't fix it, it just stopped on another artifact.

Washaka commented 2 years ago

No problem on the comment spamm as long as it brings help to my problem :P I read all the comments here and I dont find any solution yet :c

Please help, I'm at that same point, at the Gladiator's set.

bagusnl commented 2 years ago

For me, the app able to scan all the Gladiator's set that I have but it randomly crashes. Last time I tried, it crashed while processing Thundershooter set. Do we have a debug build that will output debug logs while the app running?

KaiFireborn commented 2 years ago

For me it crashes on a Noblesse Hydro% goblet with 4 substats equipped on XQ. MAkes the whole program useless, I wish it just skipped an erroneous artifact. The dev really needs to take a look at this

Cupcak3 commented 2 years ago

@bagusnl you can clone this repo or my fork and checkout the development branch. This repo has some things that Andrew is working on and may or may not be implemented. My latest development code has mostly fixes from the past week.

@KaiFireborn latest development branch (on this repo as well as my own fork) has possible crash mitigation for weapons and artifacts. I say possible because I've not been able to reproduce these crashes on my own since they've been reported.

KaiFireborn commented 2 years ago

@Cupcak3 as a developer myself, I know not being able to reproduce a common issue only too well. Still, didn't someone above suggest a possible fix (or at least a crash prevention method)? Would be appreciated if it were implemented. Another possibility could be writing the output JSON as the program goes, so if a crash occurs the progress isn't lost

Cupcak3 commented 2 years ago

Yes I implemented a version of that fix on the dev branch, which is done earlier than at the time of validation.

Writing the output repeatedly is not very efficient as it would involve loading, parsing, modifying, and then a write for every single item that were to be added. We're prioritizing squashing crashes over our writing inefficiencies for now.

bagusnl commented 2 years ago

@Cupcak3 tried the current development branch which from what I see, your fork is already merged. Both in debug and release it straight up won't scan at all and throw this error:

The type initializer for 'InventoryKamera.Scraper' threw an exception.
   at InventoryKamera.Scraper.RestartEngines()
   at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\InventoryKamera.cs:line 59
   at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\Form1.cs:line 207
Andrewthe13th commented 2 years ago

You need to rebuild the project in visual studio and make ur development set to ANY CPU.

bagusnl commented 2 years ago

Same error happened

KaiFireborn commented 2 years ago

I wasn't able to build the dev version, and too low on time right now to figure out and fix the errors. WHen are you planning to provide a build of that/update the app?

Ibrahimmushtaq98 commented 2 years ago

So I tried running the development branch, hold and behold another System.NullReferenceException occurs. This time on line 128 of Artififact.cs. In this case it was refering to 'stats' being 'null'

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=InventoryKamera
  StackTrace:
   at InventoryKamera.Artifact.SubStat.ToString() in C:\Users\Ibrahim\source\repos\Inventory_Kamera\InventoryKamera\Artifact.cs:line 128

Call Stack Below

    InventoryKamera.exe!InventoryKamera.Artifact.SubStat.ToString() Line 128    C#
    mscorlib.dll!System.Text.StringBuilder.AppendFormatHelper(System.IFormatProvider provider, string format, System.ParamsArray args)  Unknown
    mscorlib.dll!string.FormatHelper(System.IFormatProvider provider, string format, System.ParamsArray args)   Unknown
    mscorlib.dll!string.Format(string format, object arg0, object arg1) Unknown
>   InventoryKamera.exe!InventoryKamera.Artifact.ToString() Line 173    C#
    InventoryKamera.exe!InventoryKamera.InventoryKamera.ImageProcessorWorker() Line 238 C#
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state)    Unknown
    mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()    Unknown

What I have done was a clean build, updated the look up table.

Let me know if you need anything to further this investigation!

bagusnl commented 2 years ago

I decided to redo the clone and build the thing again. Now it does stop on Gladiator set in the Genshin screen while processing Shimenawa set. Below is the screenshot image

VS Debugger threw this

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=InventoryKamera
  StackTrace:
   at InventoryKamera.Artifact.SubStat.ToString() in E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\Artifact.cs:line 128

Call stack:

    InventoryKamera.exe!InventoryKamera.Artifact.SubStat.ToString() Line 128    C#
    mscorlib.dll!System.Text.StringBuilder.AppendFormatHelper(System.IFormatProvider provider, string format, System.ParamsArray args)  Unknown
    mscorlib.dll!string.FormatHelper(System.IFormatProvider provider, string format, System.ParamsArray args)   Unknown
    InventoryKamera.exe!InventoryKamera.Artifact.ToString() Line 173    C#
    InventoryKamera.exe!InventoryKamera.InventoryKamera.ImageProcessorWorker() Line 238 C#
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state)    Unknown
>   mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)   Unknown
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()    Unknown

Debugger output:

'InventoryKamera.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\InventoryKamera.exe'. Symbols loaded.
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\WindowsInput.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\Newtonsoft.Json.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'. 
The thread 0x175c has exited with code 0 (0x0).
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. 
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\NHotkey.WindowsForms.dll'. Symbols loaded.
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\NHotkey.dll'. Symbols loaded.
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\Tesseract.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'InteropRuntimeImplementer.LeptonicaApiSignaturesInstance'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'InteropRuntimeImplementer.TessApiSignaturesInstance'. 
The thread 0x1a14 has exited with code 0 (0x0).
The thread 0x1a60 has exited with code 0 (0x0).
The thread 0x1c74 has exited with code 0 (0x0).
The thread 0x2f50 has exited with code 0 (0x0).
Exception thrown: 'Newtonsoft.Json.JsonReaderException' in Newtonsoft.Json.dll
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\Accord.Imaging.dll'. 
'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'E:\GitHub\Andrewthe13th-Inventory_Kamera\Inventory_Kamera\InventoryKamera\bin\Release\Accord.dll'. 
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.Exception' in InventoryKamera.exe
Exception thrown: 'System.NullReferenceException' in InventoryKamera.exe
Object reference not set to an instance of an object.

'InventoryKamera.exe' (CLR v4.0.30319: InventoryKamera.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.Desktop.dll'. 

Basically the same errors as @Ibrahimmushtaq98 got.

There are also bunch of errors while scanning, I can't see much since its pretty fast but it looks like all the output went to error log. There is also weird behavior while scanning my weapons, the software only scans first 3 (all 5*) then spam scan those 3 repeatedly.

Cupcak3 commented 2 years ago

A couple things:

KaiFireborn commented 2 years ago

Although you striked the substat question through, it does seem to have something to do with it. After upgrading an artifact on XQ from +0 with 3 affixes and Hydro%, it went further and stalled on a different one. Again, at a transition between an artifact with 3 substats and one with four.

Cupcak3 commented 2 years ago

Thanks Kai. Stalling or hanging sounds like a different issue than this thread, but I believe I have an idea of what could be the cause. Please open a new issue for that.

bagusnl commented 2 years ago

@Cupcak3

If you see the JsonReaderException it's possible that your lists are malformed.

Which list is malformed? Is it the lookup table or the output ? If its the lookup table, I can try to use the release lookup table just to test it out.

The fast clicking is part of Andrew's work on automatically finding the lowest delay.

Ah I see. I don't mind the fast clicking if its for a useful feature. Was just quite confused why it only cycle on 3 of my weapon and gave up since IIRC weapon is the first one to scan, unless I missed an update on which the scan order has changed.

Edit: formatting fix

bagusnl commented 2 years ago

I saw a commit in the devel branch and decided to give it a try. Scanning works (-ish) now. The problem now is that its unable to validate (almost) all Weapon and Artifacts while Characters, Char Develop Items and Mats working just fine. What I did is rebuilt on Release - Any CPU, start app, then update lookup tables. You did mention about my lists being malformed and causing Exception thrown: 'Newtonsoft.Json.JsonReaderException' in Newtonsoft.Json.dll so I decided to try the inventorylists from v1.1 release and it still give the error unfortunately.

Attached in gist (to reduce spam) are app error log, debug output, and genshindata json output for both raw and parsed. https://gist.github.com/bagusnl/898481eefefbfa69d50fc0ff1b76c2e7

I just want to say good work on the devs for making this software in the first place and I hope it will work soon :)

Sirielia commented 2 years ago

I had the same issues as others in the thread (with Gladiator's in particular.) Today I tried Cupcak3's dev version (Debug - Any CPU), and that spit out an error, however when I tried it again with the v1.1 inventorylist, everything worked out fine.

It also solved the issue with Kokomi that I also saw posted, which was great.

Thank you guys for your hard work. It's so very much appreciated.

KaiFireborn commented 2 years ago

@Sirielia What's a v1.1 inventorylist, exactly?

Cupcak3 commented 2 years ago

@bagusnl it looks like I accidentally left in something that was used to output the images for weapons and artifacts if they failed to validate. In InventoryKamera.cs on lines 180 and 215 remove the ! inverter and it should be okay until I can get the fix out. Sorry about that. It slipped by while I was trying to sort out local branches.

bagusnl commented 2 years ago

In InventoryKamera.cs on lines 180 and 215 remove the ! inverter

This solved the validation error 👍

Washaka commented 2 years ago

So the current state is that we are all waiting for new versions of this software? I read the comments, @bagusnl do you think that would fix my problem or validation error is something else?

KaiFireborn commented 2 years ago

It seems so. I hope a V1.2 is released soon, sadly I'm currently unable to compile and test the dev branch myself. Still, my solution would probably be just skipping over an artifact that throws an exception and would cause a crash, and save its screenshot separately. I've done a few more attempts with the pre-compiled v1.1, and the error always happened between an artifact with two substats and one with three. Guess the reader didn't switch in time and attempted to read it differently?

Sirielia commented 2 years ago

@Sirielia What's a v1.1 inventorylist, exactly?

Sorry, I should have clarified! I had used the Cupcak3's dev branch, but copy/pasted the inventorylists folder from the pre-compiled v1.1, since the one that the dev branch created was causing an error. That allowed me to finally scan without errors or it shutting down on me.

Daxelman commented 2 years ago

Hello.

Might be a little late to this, but I also encountered one more error along these lines.

I moved over to the development branch and tried to run the scanner, but got an IndexOutOfBounds error in InventoryKamera.cs on line 276:

// Save card in directory to see what an issue might be
image.bm[7].Save($"./logging/artifacts/artifact{artifact.Id}.png"); // error here

Checking out the image.bm list, at this point it tries to save an image to an index that doesn't exist on this list. I just commented this line out and ran the scanner (since it seems to deal with logging, and it only stops on 4 star artifacts I don't use, tho randomly), and it works. I assume those artifacts that get errored out are just no in the resulting GOOD json, but it seems to capture all the 5 star ones I care about.

Cupcak3 commented 2 years ago

Oops. I changed how the rarity check is done so there's one less in that list. That 7 should be a 6. I'll talk to Andrew about possibly getting the dev branch out as an update.

Cupcak3 commented 2 years ago

Hi there, this issue is hopefully resolved in the v1.1.1 prerelease. If it has been, please let us know so we can close this issue.

Daxelman commented 2 years ago

Works for me at least!

Cupcak3 commented 2 years ago

I am going to close this issue as one user has reported it being fixed and the other users in the thread have not replied in a while. Please feel free to reopen this issue or to open a new issue should any problems come up.