Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong match of affix and itemtype in chinese #97

Closed
deepdarkssj opened this issue May 17, 2024 · 12 comments
Closed

Wrong match of affix and itemtype in chinese #97

deepdarkssj opened this issue May 17, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@deepdarkssj
Copy link

With my own system presets, the OCR can get texts exactly, but these texts of affix and itemtype can't be matched with affixdata.

image

Like this, OCR can get the first affix which is "+79 Intelligence", but in debug result, the affix is matched with "Resource with Two-Handed Bludgeoning Weapons", all of the matches are wrong, including affix aspect itemtype......

I'm worried that maybe FuzzierSharp can't work with chinese?

@josdemmers
Copy link
Owner

Thanks for the report, I added all languages supported by Diablo but Chinese is difficult to test for me.
The text used for comparison with FuzzierSharp looks fine for Intelligence.
"IdSno": 1829566, "IdName": "S04_CoreStat_Intelligence", "Description": "# 点智力", "DescriptionClean": "点智力",

The DescriptionClean entry is used when finding a match for OCR results.

Looks like the problem is with the FuzzierSharp implementation. It's created for the English language and the default preprocessor removes all non alphanumeric characters. So instead of +79 点智力 [76-90] only 79 76 90 remains. Causing it to match with a complete different affix.

With some changes I have got it working for

  • S04_CoreStats_All
  • S04_CoreStat_Intelligence
  • Tempered_Generic_LuckyHit_Freeze_Tier3

I'll try to create a beta/test version for you later today.

@josdemmers
Copy link
Owner

Ready for testing, you can download it here:
https://upload.disroot.org/r/UV2ZB6bx#GAg6EQjxY33SSfOPm7PoZ4rV+Ts2eEYUOo4I+5ThDHw=

@deepdarkssj
Copy link
Author

Ready for testing, you can download it here: https://upload.disroot.org/r/UV2ZB6bx#GAg6EQjxY33SSfOPm7PoZ4rV+Ts2eEYUOo4I+5ThDHw=

Thanks a lot. I have tested this version, FuzzierSharp works very well, but I still have some problems.

First, most of equipment can be identified well, but some equipment (about 20%) can't be identified. In debug result, the affixes areas are all correct, but OCR results are empty.
image
image

Like this, my helm can't be identified, meanwhile my chest can.
Strangely, if I'm testing the chest, and I move my mouse to helm quickly (when the red and green circles not disappear), the helm can be identified now.
There's no error in logs, so I don't know what happen.

Secondly, when the affixes language setting is chinese, I can't import preset from Maxroll, and there are a lot of warnings.

2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829560) S04_CD_Reduction
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829566) S04_CoreStat_Intelligence
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829592) S04_Life
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1934897) Tempered_CDR_Skill_Sorc_FrostNova_Tier3
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1862312) Tempered_Generic_LuckyHit_Freeze_Tier3
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829566) S04_CoreStat_Intelligence
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1924662) S04_Resource_Per_Second_Mana
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1834296) S04_Resistance_All
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1934903) Tempered_Generic_LuckyHit_HealLife_Tier3
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1862307) Tempered_Generic_LuckyHit_Immobilize_Tier3
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829556) S04_AttackSpeed
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829566) S04_CoreStat_Intelligence
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1924627) S04_LifePerHit
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1935001) Tempered_Damage_Sorc_DoT_Burn_Tier3
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829556) S04_AttackSpeed
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1829566) S04_CoreStat_Intelligence
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown affix: (1926983) S04_SkillRankBonus_Sorc_Core_5
2024-05-19 02:56:24.9324|WARN|D4Companion.Services.BuildsManagerMaxroll|CreatePresetFromMaxrollBuild: Unknown tempered affix: (1935001) Tempered_Damage_Sorc_DoT_Burn_Tier3

I must change the affixes language setting to English and change back after import complete.

Thank you again. Now this tool is usable for me, it helps me a lot.

@josdemmers
Copy link
Owner

Like this, my helm can't be identified, meanwhile my chest can.
Strangely, if I'm testing the chest, and I move my mouse to helm quickly (when the red and green circles not disappear), the helm can be identified now.

When you quickly move from chest to helm the app still thinks it's a chest. So it only looks like it's working but it uses the wrong affixes (chest instead of helm).
Noticed this problem with some items yesterday for the first time with English. Sometimes the OCR seems to have problems to read the item type.
Doesn't happen very often for me so I haven't been able to debug this yet.

Secondly, when the affixes language setting is chinese, I can't import preset from Maxroll, and there are a lot of warnings.

Will look into that tomorrow.

Thank you again. Now this tool is usable for me, it helps me a lot.

That's great to hear, have fun with season 4.

With my own system presets...

You mentioned you created your own preset. Do you want to share that so I can add it to the app? Will make it easier for others that want to use Chinese as well.

@josdemmers
Copy link
Owner

Like this, my helm can't be identified, meanwhile my chest can.
Strangely, if I'm testing the chest, and I move my mouse to helm quickly (when the red and green circles not disappear), the helm can be identified now

Probably fixed with the v3.4.2.0 release.

Secondly, when the affixes language setting is chinese, I can't import preset from Maxroll, and there are a lot of warnings.

Fixed in v3.4.2.0

@josdemmers josdemmers added the bug Something isn't working label May 22, 2024
@deepdarkssj
Copy link
Author

Like this, my helm can't be identified, meanwhile my chest can.
Strangely, if I'm testing the chest, and I move my mouse to helm quickly (when the red and green circles not disappear), the helm can be identified now

I have tested v3.4.2.0, and this problem still exists. Looks like nothing changes, its performance is the same as before.

Secondly, when the affixes language setting is chinese, I can't import preset from Maxroll, and there are a lot of warnings.

Thank you, this problem has been fixed.

I'm glad to share my preset, it looks working good in debug result.
1440p_SMF_zh-CN.zip

@josdemmers
Copy link
Owner

I have tested v3.4.2.0, and this problem still exists. Looks like nothing changes, its performance is the same as before.

That's too bad, maybe the problem is slightly different than the one I fixed for English.
Could you send me an ingame screenshot (with the overlay turned off) with one item that is working and one item that is not working? Then I can use those screenshots for debugging.

Thank you, this problem has been fixed.

You're welcome

I'm glad to share my preset, it looks working good in debug result.

Thanks, will add it later this week so it's available in the app.

@deepdarkssj
Copy link
Author

Ok, these screenshots are created from 1440pSMF
image
This helm can't be identified. Its affixes as follows:
+99 点智力 +[99 - 117]
+99 Intelligence
+8 资源上限 [7- 17]
+8 Maximum Resource
18.4% 冷却时间缩减
18.4% Cooldown Reduction
+15.6% 火盾的持续时间 [13.6 - 19.5]%(仅限巫师)
+15.6 Flame Shield Duration
幸运一击:最多有 +19.5% 几率击昏,持续 2 秒 [13.6 - 19.5]%
Lucky Hit: Up to a +19.5% Chance to Stun for 2 Seconds

image
This chest can be identified, to compare.

@josdemmers
Copy link
Owner

I'm glad to share my preset, it looks working good in debug result.
1440p_SMF_zh-CN.zip

The 1440p_SMF_zh-CN.zip preset is now available in the app.

@josdemmers
Copy link
Owner

josdemmers commented May 25, 2024

It's working now.
Problem was with the type localisation in ItemTypes.zhCN.json
I used spaces in each variant, e.g, 神圣 普通 头盔 instead of 神圣普通头盔
image

Also OCR is having problems with the helm, it works, but just barely. Only a 83% match.
image

@josdemmers
Copy link
Owner

Fixed in v3.4.5.0
To play it safe you might want to change the following setting from 80 --> 75.
image

@deepdarkssj
Copy link
Author

It works well! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants