loot / loot.github.io

The website and meta issue tracker.
https://loot.github.io
GNU General Public License v3.0
12 stars 9 forks source link

Revisit merger tags for WB v310 #92

Open sibir-ine opened 2 years ago

sibir-ine commented 2 years ago

As discussed in https://github.com/loot/oblivion/pull/691#pullrequestreview-808165053 & in the Wrye Bash Discord (see here, here, & here), merger patchers don't currently import changes from tagged mods if they are inactive & not merged. This means that if you have a plugin tagged with Deactivate (& NoMerge if mergeable), any changes imported by a merger (e.g., Import Inventory, Import Races: Relations) won't get imported into your Bashed Patch. However, in https://github.com/wrye-bash/wrye-bash/commit/9192290f007aa17ac94d15c4f7ddd22881349ea7, this behavior was changed to match that of preservers.

For us, this means that, when Wrye Bash v310 is released, we would benefit from reevaluating every instance of a merger tag to see if the plugin in question can be tagged with Deactivate (& NoMerge if mergeable). Note that for games without merge support (i.e., Skyrim SE & Fallout 4), this behavior can still be achieved through the Deactivate tag alone. The NoMerge tag is just needed in addition to Deactivate in games with merging to tell your BP to only import changes demarcated by a plugin's import tags without merging any other changes.

There are approximately 1700 instances across the masterlists, but, due to the fact that each patcher is split into up to 3 tags that can be & often are used in combination, the actual number of cases to be evaluated is likely considerably less.

The tags we would need to look for are Actors.Perks.*, Invent.*, Outfits.*, R.Relations.*, Relations.*, where * is a wildcard representing Add, Remove, or Change, & any deprecated counterparts (i.e., Invent, Derel). These can all be searched for through the regex [\[\-:] *(Actors\.Perks|Invent|Outfits|(R\.)?Relations|Derel). This regex accounts for tag lists written in either block or flow style, tags in either map or scalar form, & any amount of whitespace preceding the tag. It also only catches a few false positives (~10).

Discord messages > In summary, there's a mod named [Reworked Race Relations](https://www.nexusmods.com/oblivion/mods/50006/) that's mergeable & only* makes Race relations edits (additions, changes, & removals). I would expect that if I give it all of the R.Relations.* tags, NoMerge, & Deactivate, only it's Race relations changes would be imported into the Bashed Patch so that mods that load earlier & make other edits to Race records (e.g., OCO edits race subrecords for which there aren't currently tags) won't have these edits overwritten. I've observed this behavior with Graphics, NoMerge, & Deactivate in a similar situation, so I assume it's intended behavior. However, this tag combination causes the Race relations edits to be completely ignored. > > \* It also makes some small changes to other Race subrecords, but those are just CK noise & don't need to be merged. > This appears to be... intentional? It's due to some weird code in mergers that I've never understood but carried forward just in case from the pre-refactoring version that seems to filter out all inactive, non-merged plugins. A NoMerge-tagged, deactivated plugin certainly qualifies. I'm going to remove that code (preservers don't do this, so I don't see what the point is) and we'll see if something breaks. > It's working now, but the change is quite... invasive and could have all sorts of unintended consequences. Basically, the BP was skipping inactive, non-merged plugins as sources for patchers during certain phases entirely. That was probably not intended (considering it works for some patchers but not for others), but we'll have to see if something breaks. ![image](https://user-images.githubusercontent.com/69141501/142570353-dd9292f1-4a94-4819-94c4-d8cbf929026f.png)