import affix data from d4data#755
Conversation
validated with uv run python -m src.tools.gen_data d4data gen_data.py still depended on D4Companion/Data/Affixes.*.json; AffixManager.cs only consumes that data, while the real string-building logic is in D4DataParser/Parsers/AffixParser.cs. Code change: Ported the relevant Companion affix parsing/localisation logic into src/tools/gen_data.py, starting from json/base/meta/Affix/*.json, while keeping the generated assets/lang/enUS/affixes.json format unchanged. Added a few existing fallback keys to custom_affixes_enUS.json. Impact: Existing affix keys/values are preserved. The generated enUS affix output matches the current file exactly.
| return json.load(file) | ||
|
|
||
|
|
||
| def unsigned_int(value: int) -> int: |
There was a problem hiding this comment.
If a method is only one line long let's remove it please, we can just repeat this code where necessary
There was a problem hiding this comment.
update2
unsigned_int() was a one-line wrapper around value % (2**32) and only used inside src/tools/gen_data.py
| "c_mythic": "Mythic", | ||
| } | ||
|
|
||
| CROWD_CONTROL_TYPES = { |
There was a problem hiding this comment.
I knew a lot of these maps would be necessary and expected them, but do you think we could move them to a different file at least? Maybe a gen_data_helpers.py?
|
Noticed this PR when looking through the repo. |
|
Thank you @josdemmers! So it is a real affix, it's just a temper. One struggle I've had is I can't find an authoritative list of every affix in the game to compare against our list. I don't know if you know this but we used to just get our affixes from your data. Which has worked fine of course, but I didn't like having a reliance on two different repos (yours and d4data) for ours to function. I asked @chrizzocb here to unleash his AI to break that dependency, but in a way I also wanted to keep it how it was because it meant you had to handle missing affixes instead of me. Oh well. |
|
In the past there was this list: https://www.d4craft.com/affixes But feel free to use my parsed data when needed. That's why it's open source. Like you, I also wanted to look into the affixes/aspects to check if they are actually being used in game. But haven't found a good solution for that yet. |

validated with uv run python -m src.tools.gen_data d4data
gen_data.py still depended on D4Companion/Data/Affixes.*.json; AffixManager.cs only consumes that data, while the real string-building logic is in D4DataParser/Parsers/AffixParser.cs.
Code change: Ported the relevant Companion affix parsing/localisation logic into src/tools/gen_data.py, starting from json/base/meta/Affix/*.json, while keeping the generated assets/lang/enUS/affixes.json format unchanged. Added a few existing fallback keys to custom_affixes_enUS.json.
Impact: Existing affix keys/values are preserved. The generated enUS affix output matches the current file exactly.