Andrewthe13th / Inventory_Kamera

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

Scanner skips rows and only scans when resolution is set at 1440x900 #525

Open Elipsaa opened 3 months ago

Elipsaa commented 3 months ago

Current Behavior

Scanner sometimes skips some rows when scanning weapons and artifacts. It always skips the same rows (checked only when scanning weapons since it was the fastest to check but I can assume it will also skip the same rows when checking artifacts). Changing the resolution (to 1280x720) fixed the issue. When checking the character it only checks the one selected, checks his constelation but when checking talents it throws an error and stops scanning:

Parameter is not valid.

   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)

   at InventoryKamera.Navigation.CaptureRegion(RECT region, PixelFormat format)

   at InventoryKamera.CharacterScraper.ScanTalents(Character character)

   at InventoryKamera.CharacterScraper.ScanCharacter(String firstCharacter)

   at InventoryKamera.CharacterScraper.ScanCharacters(List`1& Characters)

   at InventoryKamera.InventoryKamera.GatherData()

Expected Behavior

The scanner to not skip rows or items

Reproducing a Behavior

Set the resolution to 1440x900 and scan weapons/artifacts/character. For weapons/artifacts it will sometimes skip a row and when it skips that row it will always skip it when reproducing. For the character it will give an error when checking characters talent (in my case it was xingqiu. I don't know if it's possible to reproduce it or force it to skip a row

Device OS

Windows 10

Genshin Impact Version

4.7

Inventory Kamera Version

1.3.16

Screen resolution, screen mode, and UI scale

1440x900 windowed

Additional notes and remarks

Issue #520 has the same problem with characters not being scanned but his resolution is 1920x1200

Evidence

The row in the red is skipped obraz_2024-06-11_212116074 Zrzut ekranu (28) ||| On page 2 it only locates 32 possible item locations (it misses one row aka 8 items)

2024-06-11 21:30:09.468|INFO|InventoryKamera|Kamera initialized
2024-06-11 21:30:10.152|INFO|GenshinProcesor|Scraper initialized
2024-06-11 21:30:10.166|INFO|MainForm|Inventory Kamera version 1.3.16
2024-06-11 21:30:10.364|INFO|DatabaseManager|Checking for newer game data...
2024-06-11 21:30:11.465|INFO|MainForm|Current game data is up to date with data for 4.7
2024-06-11 21:30:21.870|INFO|MainForm|Starting scan
2024-06-11 21:30:21.870|INFO|MainForm|Hotkey registered
2024-06-11 21:30:21.870|INFO|MainForm|Scan settings: 
    Game Version Data:           4.7
    Weapons:                 True
    Artifacts:               False
    Characters:              False
    Dev Items:               False
    Materials:               False
    Min Weapon Rarity:       3
    Min Weapon Level:        1
    Equip Weapons:           True
    Min Artifact Rarity:     5
    Min Artifact Level:      0
    Equip Artifacts:         True
    Delay:                   0
2024-06-11 21:30:21.884|DEBUG|Navigation|Checking for GenshinImpact.exe
2024-06-11 21:30:21.884|DEBUG|Navigation|Found GenshinImpact.exe
2024-06-11 21:30:21.884|DEBUG|Navigation|Window location (1440x900): x=240, y=101
2024-06-11 21:30:21.921|INFO|InventoryKamera|Kamera initialized
2024-06-11 21:30:21.921|INFO|MainForm|Resolution: 1440x900
2024-06-11 21:30:21.925|INFO|InventoryKamera|Logging directory reset
2024-06-11 21:30:21.941|DEBUG|InventoryKamera|Added 3 workers
2024-06-11 21:30:21.941|DEBUG|InventoryKamera|Thread #13 priority: Normal
2024-06-11 21:30:21.941|DEBUG|InventoryKamera|Thread #15 priority: Normal
2024-06-11 21:30:21.941|DEBUG|InventoryKamera|Thread #14 priority: Normal
2024-06-11 21:30:22.280|DEBUG|GenshinProcesor|8 Engines restarted
2024-06-11 21:30:22.280|INFO|GenshinProcesor|Internally set traveler custom name to nohopeforme
2024-06-11 21:30:22.284|INFO|InventoryKamera|Scanning weapons...
2024-06-11 21:30:26.005|INFO|UserInterface|Parsed 202 weapons to scan
2024-06-11 21:30:26.005|INFO|WeaponScraper|Found 202 for weapon count.
2024-06-11 21:30:26.005|DEBUG|WeaponScraper|Sorting by quality to optimize scan time.
2024-06-11 21:30:26.005|DEBUG|WeaponScraper|Inventory is sorted by quality
2024-06-11 21:30:26.005|DEBUG|WeaponScraper|Scanning weapon page 0
2024-06-11 21:30:26.005|DEBUG|WeaponScraper|Located 40 possible item locations on page.
2024-06-11 21:30:31.753|DEBUG|WeaponScraper|Finished queuing page of weapons. Scrolling...
2024-06-11 21:30:33.141|DEBUG|WeaponScraper|Scanning weapon page 1
2024-06-11 21:30:33.141|DEBUG|WeaponScraper|Located 40 possible item locations on page.
2024-06-11 21:30:38.823|DEBUG|WeaponScraper|Finished queuing page of weapons. Scrolling...
2024-06-11 21:30:40.225|DEBUG|WeaponScraper|Scanning weapon page 2
2024-06-11 21:30:40.225|DEBUG|WeaponScraper|Located 32 possible item locations on page.
2024-06-11 21:30:44.744|DEBUG|WeaponScraper|Finished queuing page of weapons. Scrolling...
2024-06-11 21:30:45.974|DEBUG|WeaponScraper|Scanning weapon page 3
2024-06-11 21:30:45.974|DEBUG|WeaponScraper|Located 32 possible item locations on page.
2024-06-11 21:30:46.666|INFO|WeaponScraper|Stopping weapon scan based on filtering
2024-06-11 21:30:48.686|INFO|InventoryKamera|Done scanning weapons
2024-06-11 21:30:48.717|DEBUG|InventoryKamera|Thread 15 exit
2024-06-11 21:30:48.733|DEBUG|InventoryKamera|Thread 13 exit
2024-06-11 21:30:48.748|DEBUG|InventoryKamera|Thread 14 exit
2024-06-11 21:30:48.753|INFO|MainForm|Data converted to GOOD
2024-06-11 21:30:48.795|INFO|MainForm|Exported data
2024-06-11 21:30:52.887|INFO|MainForm|Hotkey removed

Preflight Checklist