loot / libloot

A C++ library for accessing LOOT's metadata and sorting functionality.
GNU General Public License v3.0
32 stars 12 forks source link

Non Master Plugins Group Affecting Master Sorting Order #51

Closed MacSplody closed 5 years ago

MacSplody commented 5 years ago

LOOTDebugLog.txt

Sorting with a non ESM plugin in a group before ESM's.

Dragonborn.esm (DLC Group) RSkyrimChildren.esm (Early Group) BSAssets.esm (Default Group) BSHeartland.esm (Default Group) Lanterns Of Skyrim - All In One - Main.esm (Early Group) Unofficial Skyrim Special Edition Patch.esp (Fixes Group) Skyrim Project Optimization - Full Version.esm (Fixes Group) UnlimitedBookshelves.esp (CC Group) non ESM plugin

DLC -> CC -> (Pre-)Early -> (Pre-)Fixes -> Default

What I expected

Dragonborn.esm (DLC Group) RSkyrimChildren.esm (Early Group) Lanterns Of Skyrim - All In One - Main.esm (Early Group) Unofficial Skyrim Special Edition Patch.esp (Fixes Group) Skyrim Project Optimization - Full Version.esm (Fixes Group) BSAssets.esm (Default Group) BSHeartland.esm (Default Group) UnlimitedBookshelves.esp (CC Group)

Ortham commented 5 years ago

I had a look a couple of days ago, and can confirm that something odd is going on. Even if it's working by design, it's hard enough to see that I'm going to call this a bug anyway.

Also, can you remember what the difference between the metadata for the first and second sorts is in that log file? I think I worked it out from what was logged, but forgot to write it down...

MacSplody commented 5 years ago

I think it was a case of making sure no masters were in a group after .esp plugins.

MacSplody commented 5 years ago

Groups Before

BSAssets.esm (default)
BSHeartland.esm (default)
Dawnguard.esm (DLC)
Dragonborn.esm (DLC)
HearthFires.esm (DLC)
Lanterns Of Skyrim - All In One - Main.esm (Early Loaders)
RSkyrimChildren.esm (Early Loaders)
Skyrim Project Optimization - Full Version.esm (Fixes & Resources)
Skyrim.esm (default)
UnlimitedBookshelves.esp (Creation Club)
Unofficial Skyrim Special Edition Patch.esp (Fixes & Resources)
Update.esm (DLC)

After with correct sorting

BSAssets.esm (default)
BSHeartland.esm (default)
Dawnguard.esm (DLC)
Dragonborn.esm (DLC)
HearthFires.esm (DLC)
Lanterns Of Skyrim - All In One - Main.esm (Early Loaders)
RSkyrimChildren.esm (Early Loaders)
Skyrim Project Optimization - Full Version.esm (Fixes & Resources)
Skyrim.esm (default)
UnlimitedBookshelves.esp (Pre Fixes (Patches/Add-ons))
Unofficial Skyrim Special Edition Patch.esp (Fixes & Resources)
Update.esm (DLC)

UnlimitedBookshelves.esp (Creation Club) UnlimitedBookshelves.esp (Pre Fixes (Patches/Add-ons)) was the only change.

image

MacSplody commented 5 years ago

Okay came across this again.

image

  0  0     Oblivion.esm
  1  1     Mart's Monster Mod.esm
  2  2     Oscuro's_Oblivion_Overhaul.esm
  3  3     Cobl Main.esm
  4  4     Better Cities Resources.esm
  5  5     Unofficial Oblivion Patch.esp
  6  6     UOP Vampire Aging & Face Fix.esp
  7  7     Oblivion Citadel Door Fix.esp
  8  8     DLCShiveringIsles.esp
  9  9     Unofficial Shivering Isles Patch.esp

Debug log for default sorting: LOOTDebugLog - Control.zip


I was changing Cobl Main.esm's group from default to underrides. To sort it before both Mart's Monster Mod.esm and Oscuro's_Oblivion_Overhaul.esm. Both of those mods are in the default group. But the group change had no effect and the order remained the same as above.

Debug log - Group change for Cobl Main.esm, no sorting change: LOOTDebugLog - COBL Underrides.zip

[16:45:04.909270] [trace]: Skipping group edge from "Cobl Main.esm" to "Better Cities Resources.esm" as it would create a multi-group cycle.
[16:45:04.929044] [trace]: Skipping group edge from "Cobl Main.esm" to "Mart's Monster Mod.esm" as it would create a multi-group cycle.
[16:45:04.933240] [trace]: Skipping group edge from "Cobl Main.esm" to "Oscuro's_Oblivion_Overhaul.esm" as it would create a multi-group cycle.

So to test things out I changed the groups locally. From

  - name: &gameMasterGroup Main Game Master

  - name: &unofficialPatchesGroup Unofficial Patches
    after: [ *gameMasterGroup ]

  - name: &dlcGroup DLC
    after: [ *unofficialPatchesGroup ]

  - name: &newLandsGroup New Lands
    after: [ *dlcGroup ]

  - name: &underridesGroup Underrides
    after: [ *newLandsGroup ]

  - name: default
    after: [ *underridesGroup ]

To

  - name: &gameMasterGroup Main Game Master

  - name: &unofficialPatchesGroup Unofficial Patches

  - name: &dlcGroup DLC
    after: [ *unofficialPatchesGroup ]

  - name: &newLandsGroup New Lands
    after: [ *gameMasterGroup ]

  - name: &underridesGroup Underrides
    after: [ *newLandsGroup ]

  - name: default
    after: [ *underridesGroup ]

image

Which produced the expected sorting for Cobl Main.esm, Mart's Monster Mod.esm and Oscuro's_Oblivion_Overhaul.esm.

  0  0     Oblivion.esm
  1  1     Cobl Main.esm
  2  2     Mart's Monster Mod.esm
  3  3     Oscuro's_Oblivion_Overhaul.esm
  4  4     Better Cities Resources.esm
  5  5     Unofficial Oblivion Patch.esp
  6  6     UOP Vampire Aging & Face Fix.esp
  7  7     Oblivion Citadel Door Fix.esp
  8  8     DLCShiveringIsles.esp
  9  9     Unofficial Shivering Isles Patch.esp

LOOTDebugLog - Edited Masterlist.zip

MacSplody commented 5 years ago

Just out of curiosity but would it be possible for Masters to use the full range of groups? I haven't encountered a Master with a requirement to load after all other Masters yet. But currently if I place a MASTER in a late group, it will affect sorting for non-master plugins.

Ortham commented 5 years ago

But currently if I place a MASTER in a late group, it will affect sorting for non-master plugins.

It shouldn't, LOOT should see that one plugin is a master and the other isn't, and ignore the group difference between them. I think you're just describing the inverse of this issue though.

MacSplody commented 5 years ago

But currently if I place a MASTER in a late group, it will affect sorting for non-master plugins.

It shouldn't, LOOT should see that one plugin is a master and the other isn't, and ignore the group difference between them. I think you're just describing the inverse of this issue though.

Well I assumed they were related. This issue came up a few weeks ago, I thought nothing of it at the time.

The gist of it is I added DynDoLOD.esm to late loaders, so that it would load after all other ESM by default. However this caused LOOT to sort plugins incorrectly.

The conversation was on discord, it starts here.

LOOTDebugLog.txt

Ortham commented 5 years ago

I think I see what's happening for the Cobl Main.esm / Better Cities Resources.esm example. Cobl Main.esm is in Underrides, and Better Cities Resources.esm is in default. Cobl Races TNR.esp is also in Underrides and LOOT sees that respecting that group difference would cause a cycle, and because Better Cities Resources.esm is in default, its group is ignored for all plugins in groups between Underrides and default inclusive. This then causes Better Cities Resources.esm's group to be ignored for Cobl Main.esm, and the same reasoning explains the MMM and OOO esms getting ignored.

In this case, the logic is assuming that if one plugin in a group can't load before another plugin in another group, no plugins in the former group or in any intermediate groups can load before the latter plugin. I added this to fix #22, but obviously it goes too far to avoid cycles...

MacSplody commented 5 years ago

I could mitigate it happening with load afters, and avoiding certain group arrangments. But if #22 needs to be revisited, then I'd be happy enough to do testing for it.

Ortham commented 5 years ago

There's got to be a proper solution, I've added a test for this case, now I just need to come up with a solution that doesn't break any other tests... Once that's done, it would be good to check that it also fixes the other cases you've reported.

MacSplody commented 5 years ago

Yeah no problem, I still have those mods ready for testing.

Ortham commented 5 years ago

OK, try with this loot.dll - use it with one of the LOOT builds that have Morrowind support, it might not work with other builds.

MacSplody commented 5 years ago

First Case looks fine now.

Dragonborn.esm (DLC Group)
Lanterns Of Skyrim - All In One - Main.esm (Early Group)
RSkyrimChildren.esm (Early Group)
Unofficial Skyrim Special Edition Patch.esp (Fixes Group)
Skyrim Project Optimization - Full Version.esm (Fixes Group)
BSAssets.esm (Default Group)
BSHeartland.esm (Default Group)
UnlimitedBookshelves.esp (CC Group)

LOOTDebugLog.zip

MacSplody commented 5 years ago

And the Oblivion one is correct as well. LOOTDebugLog.zip

  0  0     Oblivion.esm
  1  1     Cobl Main.esm
  2  2     Mart's Monster Mod.esm
  3  3     Oscuro's_Oblivion_Overhaul.esm
  4  4     Better Cities Resources.esm
  5  5     Mart's Monster Mod for OOO.esm
  6  6     Unofficial Oblivion Patch.esp
  7  7     Oblivion Citadel Door Fix.esp
  8  8     UOP Vampire Aging & Face Fix.esp
  9  9     DLCShiveringIsles.esp
 10  a     Unofficial Shivering Isles Patch.esp
 11  b     DLCHorseArmor.esp
 12  c     DLCHorseArmor - Unofficial Patch.esp
 13  d     DLCOrrery.esp
 14  e     DLCOrrery - Unofficial Patch.esp
 15  f     DLCVileLair.esp
 16 10     DLCVileLair - Unofficial Patch.esp
 17 11     DLCMehrunesRazor.esp
 18 12     DLCMehrunesRazor - Unofficial Patch.esp
 19 13     DLCSpellTomes.esp
 20 14     DLCSpellTomes - Unofficial Patch.esp
 21 15     DLCThievesDen.esp
 22 16     DLCThievesDen - Unofficial Patch.esp
 23 17     DLCThievesDen - Unofficial Patch - SSSB.esp
 24 18     DLCBattlehornCastle.esp
 25 19     DLCBattlehornCastle - Unofficial Patch.esp
 26 1a     DLCFrostcrag.esp
 27 1b     DLCFrostcrag - Unofficial Patch.esp
 28 1c     Knights.esp
 29 1d     Knights - Unofficial Patch.esp
 30 1e     Cobl Si.esp
 31 1f     Oscuro's_Oblivion_Overhaul.esp
 32 20     Mart's Monster Mod for OOO.esp
 33 21     Cobl Tweaks.esp
 34 22     Cobl Races.esp
 35 23     Cobl Glue.esp
           Cobl Filter Late MERGE ONLY.esp
MacSplody commented 5 years ago

DynDOLOD.esm placed in dynamicLODGroup looks fine as well. Bashed Patch, 0.esp no longer tries to sort before it.

This last one is 400+ plugins. I can't spot anything out of place at the moment. I'll see if there's anything else I can test.

LOOTDebugLog.zip

Ortham commented 5 years ago

OK, great. If you notice anything else odd going on with groups, let me know. Closing this as the fix is merged in fb7ac05e1e582526978c26fc4e1306f2342727a6.

MacSplody commented 5 years ago

@Ortham Thanks