Skip to content

Add scripts to automatically sync unique mods with their text#2662

Closed
Wires77 wants to merge 19 commits into
PathOfBuildingCommunity:devfrom
Wires77:unique_autoupdater
Closed

Add scripts to automatically sync unique mods with their text#2662
Wires77 wants to merge 19 commits into
PathOfBuildingCommunity:devfrom
Wires77:unique_autoupdater

Conversation

@Wires77
Copy link
Copy Markdown
Member

@Wires77 Wires77 commented Apr 23, 2021

  • Running uniqueMods.lua translates unique text into an actual mod (Run when adding new uniques)
  • Running uniqueText.lua translates those mods back into text (Run when the GGPK is updated, updating mod text on uniques)
  • This updates a lot of small text changes, not all of which I'm a fan of (GGG is pretty inconsistent with capitalization, it seems), but comes as a side effect of the mod text matching
  • This also updates all catalyst tags where a matching mod was found, fixing Prismatic Catalyst (Resistance) should affect unique amulet Tavukai #2521 (actually, looking at it, we have a typo for Tavukai specifically, which means the mod wasn't recognized by these scripts)

Future plans are to fix typos we have currently that are out-of-sync with the GGPK, add entries to ModParser.lua to support those differences where necessary, and improve performance.

- Running uniqueMods.lua translates unique text into an actual mod (Run when adding new uniques)
- Running uniqueText.lua translates those mods back into text (Run when the GGPK is updated, updating mod text on uniques)
- This updates a lot of small text changes, and updates all catalyst tags where a matching mod was found
@Wires77 Wires77 added enhancement New feature, calculation, or mod wip Unfinished and commited for discussion labels Apr 23, 2021
Copy link
Copy Markdown
Contributor

@PJacek PJacek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I glanced over the changes and there seem to be a few typos in the original data. Some of them get fixed by the export but some seem to cause issues.

Comment thread src/Data/Uniques/shield.lua
Comment thread src/Data/Uniques/body.lua
Comment thread src/Data/Uniques/body.lua Outdated
Comment thread src/Export/Scripts/uniqueText.lua Outdated
local out = io.open("../Data/Uniques/"..name..".lua", "w")
for line in io.lines("../Data/Uniques/Special/"..name..".lua") do
local specName, specVal = line:match("^([%a ]+): (.+)$")
if not specName and line ~= "]],[[" then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cleaner to read in the whole file as a Lua table, so you don't have to split by text anymore. This would also allow for simpler surrounding code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't know if this saves anything, after looking at it. I have to parse each line of each item anyway, and the items would be all out of order if I parsed it as a table, meaning the diffs would be impossible to double-check for errors.

Comment thread src/Export/Scripts/uniqueText.lua Outdated
Comment thread src/Export/Scripts/uniqueText.lua Outdated
Comment thread src/Export/statdesc.lua Outdated
Comment thread src/Export/Scripts/uniqueMods.lua Outdated
@Wires77
Copy link
Copy Markdown
Member Author

Wires77 commented Oct 8, 2021

Created another branch for this next change: Wires77/PathOfBuilding@unique_autoupdater...Wires77:unique_autoupdater_improvements

Didn't commit it to this branch, since it simply makes an assumption that the item type will be in the mod name and that still isn't accurate in all cases.

@Wires77 Wires77 removed the wip Unfinished and commited for discussion label Oct 8, 2021
@LocalIdentity LocalIdentity added the technical Hidden from release notes label Oct 21, 2021
@QuickStick123
Copy link
Copy Markdown
Contributor

The tags it generates seem to be inaccurate in several instances like it doesn't correctly fix x mod on low life applying from fertile catalyst and physical and chaos damage tags will need to be added to properly handle noxious catalyst.

@Wires77
Copy link
Copy Markdown
Member Author

Wires77 commented Jul 10, 2022

The tags it generates seem to be inaccurate in several instances like it doesn't correctly fix x mod on low life applying from fertile catalyst and physical and chaos damage tags will need to be added to properly handle noxious catalyst.

Can you point out some that you noticed so I can investigate them further? The new tags should be fixed by running the scripts again. I'll try to do that again soon since so much has changed since I last updated this PR

@QuickStick123
Copy link
Copy Markdown
Contributor

QuickStick123 commented Jul 10, 2022

physical -> physical damage
{tags:physical}(15-25)% increased Physical Damage
{tags:physical}{variant:1}Reflects 200 to 250 Physical Damage to Attackers on Block
{tags:attack,physical}-4 Physical Damage taken from Attacks
{variant:1,5}{tags:physical}(20-30)% increased Physical Damage
{tags:physical}(12-24)% increased Physical Damage
{tags:physical}(12-24)% increased Physical Damage
{tags:physical}−(50-40) Physical Damage taken from Attacks
{tags:physical}(25-40)% increased Physical Damage
{variant:1}{tags:attack,physical}20% more Maximum Physical Attack Damage
{variant:1}{tags:attack,physical}20% less Minimum Physical Attack Damage

remove tag: https://www.pathofexile.com/trade/search/Standard/a2GOkw7ue
{variant:1,2}{tags:physical}Right ring slot: 30% reduced Reflected Physical Damage taken
{variant:3}{tags:physical}Right ring slot: 40% reduced Reflected Physical Damage taken
{variant:4}{tags:physical}Right ring slot: 80% reduced Reflected Physical Damage taken

add physical damage
{tags:resource,life,attack}0.4% of Physical Attack Damage Leeched as Life
{tags:resource,mana,attack}0.4% of Physical Attack Damage Leeched as Mana

chaos -> chaos damage
{tags:chaos,life}200% of Life Leech applies to enemies as Chaos Damage
remove life
{tags:chaos,jewellery_defense,life}+(20-25)% Chaos Resistance when on Low Life
{tags:jewellery_defense,life}You gain 100 Evasion Rating when on Low Life
remove cast attack
{variant:1}{tags:caster,attack}5% chance to gain Onslaught for 10 seconds on Kill
remove attack
{variant:1}{tags:attack}14-20% chance to gain Fortify when you Stun an Enemy with Melee Damage
add life
{tags:defences}Gain (4-6)% of Maximum Life as Extra Maximum Energy Shield

Socketed Golem Skills is unscalable so remove all
{variant:2}{tags:resource,life,defences}Socketed Golem Skills gain 20% of Maximum Life as Extra Maximum Energy Shield
{variant:2,3}{tags:attack,caster,speed}Socketed Golem Skills have 20% increased Attack and Cast Speed

@Wires77
Copy link
Copy Markdown
Member Author

Wires77 commented Jul 10, 2022

These differences fall into several categories:

  1. Mods that changed wording, but are effectively the same, didn't get updated in PoB and thus their text didn't get recognized as a mod. E.g. Physical Damage taken from attacks is now "...taken from Attack Hits" instead
  2. Legacy mods whose values changed, so the old values didn't get recognized E.g. "Reflects 200 to 250 Physical Damage to Attackers on Block" is now "Reflects 240 to 300 Physical Damage to Attackers on Block"
  3. Don't have tags in the data, either on purpose or on accident. These would have to be tested to be sure of the behavior E.g. "0.6% of Physical Damage Leeched as Life" only has a physical tag, not physical_damage, so wouldn't get affected by that catalyst
  4. This last one is actually fixable via scripting vs. manual changes, and that's because we're ignoring the IsScalable values on Stats.dat E.g. golem mods and ring slot mods

@QuickStick123
Copy link
Copy Markdown
Contributor

You are correct I incorrectly assumed since attack life work physical damage scaling would also work on the leech mod but It doesn't work from my testing.

@Wires77
Copy link
Copy Markdown
Member Author

Wires77 commented Apr 15, 2026

Superceded by #9480

@Wires77 Wires77 closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, calculation, or mod technical Hidden from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants