Why does disabling and re-enabling mods fix anything?

Post Reply
Sharur
Posts: 6
Joined: Thu May 11, 2017 11:03 am

Why does disabling and re-enabling mods fix anything?

Post by Sharur »

I don't know if anyone else has had this experience, but I've twice now run into major issues that I've been able to fix by disabling and then re-enabling mods. First, when 1.3 came out, I started a new campaign, and there was a graphical issue that caused a combination of flashing and inverted colors. Now, with 1.4 just having come out, I started getting the "pure virtual function" error when loading my save.

In both cases, I tried to identify a mod causing the problem, as that seemed the most likely culprit. And in both cases, I thought I'd identified the offending mod, only to discover that once I turned it back on (and had all my other mods on as well) that the problem disappeared.

This makes no sense to me, but maybe someone can explain why this would be expected?
Jacke
Posts: 623
Joined: Sat Jan 28, 2017 1:10 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Jacke »

Sharur wrote:This makes no sense to me, but maybe someone can explain why this would be expected?
That can change the order of mods loading. That would put the mod changed to load last, which may work better.

Highly suggest you switch to the Alternate Mod Launcher as it usually will fix these things up automatically. And it will tell you if there are any potential conflicts between mods.
Sharur
Posts: 6
Joined: Thu May 11, 2017 11:03 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Sharur »

Thank you for the suggestion! I just spent some time playing around with the Alternative Mod Launcher to see what it can do. Unfortunately, I'm pretty confused.

It's certainly possible that I'm missing something, but using the Launcher to control the mod load order seems like a complete disaster. I'd expect a drag-and-drop interface so that I can place a mod in a position relative to others, rather than hand-editing individual values. However, not only do I need to hand edit the values, but they don't actually respect what I put in, and since it seems to auto-fill gaps if I create them, I can't really control the order in a consistent manner.

To illustrate: suppose I have 4 mods, A, B, C, and D. Currently they're in reverse alphabetical order (D - 0, C - 1, B - 2, A - 3). I'd like them to be in alphabetical order (ABCD). Reversing A and D is easy enough - I can set D to 4 and A to -1. At this point, the launcher will modify the values The way it does this is not entirely consistent, but roughly it will condense the values I entered back to 0 through 3, so I'll have A - 0, C - 1, B - 2, D - 3. But how do I switch C and B? If I set C to 2, or B to 1, how would the launcher even know how I wanted to break that tie? In this case, if it broke the tie randomly I'd eventually get what I wanted, but with over 100 mods I certainly don't want to just keep trying and hope it does what I want.

I'd also expect that, since you can create groups, you could use them to, e.g., load all the voice packs last (since I likely don't care about the order they're loaded in relative to each other, just that they're loaded after LW2, or whatever). But the groups completely disappear if you sort by Order.

I don't see a readme on the github or anything... are there instructions for using it somewhere? It seems like a lot of people are happy with this tool, so I must be missing something, right?
Jacke
Posts: 623
Joined: Sat Jan 28, 2017 1:10 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Jacke »

As far as I can tell, the Alternate Mod Launcher doesn't allow you to control the load order. It instead picks the most likely correct load order itself. It also points out possible conflicts, although some of those aren't a problem; you can check out the mod comments by right-clicking and selecting "Show in Browser" and see what the other users and the mod author says. It also allows you to enable and disable mods with just a single click.
deaconivory
Long War 2 Crew
Posts: 167
Joined: Tue Dec 29, 2015 1:12 am

Re: Why does disabling and re-enabling mods fix anything?

Post by deaconivory »

Steam loads mods in date order, so the most recently added mod is loaded last. Generally speaking, UI mods like to be loaded after overhaul mods (like LW2) but it is best to read the mod descriptions on Steam/nexus to make sure.

I have found only a handful of mods that seemed to work better if they are loaded after LW2 (off the top of my head they are; Customize UIEventNotice, LW2 Information Display, and Show Infiltration percentage in Squad Select). Unless a mod specifically states that it needs to be loaded after LW2 you probably don't need to do anything about oad order.

I've run 200+ mods simultaneously without having to worry about load order. Currently, I have about 70 mods running with LW2 and other than the ones I just mentioned I've not spent any time on load order. I guess my point is to not over think it.

The best practice is to move, or copy & delete your \My Documents\My Games\XCOM2\XComGame\Config folder if you make any changes to your mod list.
Zyrrashijn
Posts: 188
Joined: Mon Aug 01, 2016 6:02 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Zyrrashijn »

Jacke wrote:As far as I can tell, the Alternate Mod Launcher doesn't allow you to control the load order. It instead picks the most likely correct load order itself. It also points out possible conflicts, although some of those aren't a problem; you can check out the mod comments by right-clicking and selecting "Show in Browser" and see what the other users and the mod author says. It also allows you to enable and disable mods with just a single click.

I'm pretty sure you can control the load order. That's where the order tab is for.
Jacke
Posts: 623
Joined: Sat Jan 28, 2017 1:10 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Jacke »

Zyrrashijn wrote:I'm pretty sure you can control the load order. That's where the order tab is for.
That tab tells you the order that the Alternate Mod Launcher loads the mods in. You can sort to display mods by it, but I don't believe you can change it. AML will switch some mods in that order sometimes, as I removed LW2 and reinstalled it and it's still relatively early in my load order. However, most mods will load in the order they're subscribed to.
Sacred Sakura
Posts: 15
Joined: Mon Jan 04, 2016 11:32 pm

Re: Why does disabling and re-enabling mods fix anything?

Post by Sacred Sakura »

Jacke wrote:
Zyrrashijn wrote:I'm pretty sure you can control the load order. That's where the order tab is for.
That tab tells you the order that the Alternate Mod Launcher loads the mods in. You can sort to display mods by it, but I don't believe you can change it. AML will switch some mods in that order sometimes, as I removed LW2 and reinstalled it and it's still relatively early in my load order. However, most mods will load in the order they're subscribed to.
If you double click the number of the mod in the order row, you can actually change it, if that changes the actual order though... I dont know
Izmir Stinger
Posts: 7
Joined: Sat May 13, 2017 5:28 pm

Re: Why does disabling and re-enabling mods fix anything?

Post by Izmir Stinger »

Sharur wrote:I don't know if anyone else has had this experience, but I've twice now run into major issues that I've been able to fix by disabling and then re-enabling mods. First, when 1.3 came out, I started a new campaign, and there was a graphical issue that caused a combination of flashing and inverted colors. Now, with 1.4 just having come out, I started getting the "pure virtual function" error when loading my save.
That was a long war bug?! HA! What a hilarious coincidence. Yes, both have happened to me since 1.3, but I came to a very different conclusion about the color thing.

I built my rig a little over 3 years ago and it is showing it's age, but I got a calendar pop-up last week that I forgot making that said "All the warranties for your hardware are now expired. OC Time Baby!" After achieving a stable (and now much snappier) overclocked system I decided to play a game with *cough* noticeable performance issues to see how much it had improved. I was underwhelmed by the effect it had on Long War but got sucked in all the same. When the flashing and miscoloration started I panicked that my video card was overheating and did an immediate hard power down, booted to BIOS configuration and scaled back my video card OC settings. Guess I can go put them back to the higher values.

The "pure virtual function" error is definatly mod related and specifically caused by improper load order:
deaconivory wrote:I have found only a handful of mods that seemed to work better if they are loaded after LW2 (off the top of my head they are; Customize UIEventNotice, LW2 Information Display, and Show Infiltration percentage in Squad Select). Unless a mod specifically states that it needs to be loaded after LW2 you probably don't need to do anything about oad order.
Load order doesn't matter for mods under the Steam Workshop system because each Class can only be overridden by one mod, so it doesn't matter what order they are in because none of them will ever overwrite each other's changes. The current inability to load both Gotcha Again and Perfect Information is an example of this being enforced. Both try to change the code of a Class called "XComPathingPawn" and that is not kosher under the Steam Workshop system. This is why there is no official support for changing load order and the default behavior - sort by subscribe date - is effectively an arbitrary load order.

What this otherwise well implemented system fails to take into account is ModMods, which describe what is on Deacon Ivory's list. These mods override Classes in Long War. ModMods like these may override Classes that don't exist in the base game, but only in a mod. If the ModMod loads before the Mod it is modding then the override is invalid and ignored, causing unexpected behavior - best case: the mod does nothing, worst case, unhandled Exceptions during play - which is what the "pure virtual function" crash was.

Here is what is going on under the hood with that error. This "Class" thing I keep mentioning is one of the basic building blocks of modern "Object Oriented" programming. Classes have two main features, Properties and Functions. Functions are code that can be invoked elsewhere in code, usually requiring some input and then returning output in predefined ways...

Except when it is not defined at all. Calling Functions of Classes within your program or project is one thing, calling the Functions of OTHER people's code is another thing altogether. A "virtual function" is a Function that doesn't exist anywhere in the code you are compiling, but you expect it will exist at run-time because another Class that does have the Function will override or inherit the Class you are working with. The unhandled Exception you saw was a case of that assumption not panning out. Because this is a case of a Class not having all the Functions expected, ModMod load order is almost certainly the culprit.

You can deliberately trigger this if you want to see it. RoboJumper's Squad Select is a great example (and a great mod). It is a mod for the base game with an extra mod you can load alongside it for Long War compatibility. The Long War version of his mod obviously makes calls to his code for the original mod. These are calls to Virtual Functions. If you disable the original but leave the Long War version of this mod, any visit to the squad select screen will crash your game with the same error you saw.
deaconivory
Long War 2 Crew
Posts: 167
Joined: Tue Dec 29, 2015 1:12 am

Re: Why does disabling and re-enabling mods fix anything?

Post by deaconivory »

Excellent explanation from Izmir, thank you for that.

I also noticed after re-reading OP's initial post, this line: "First, when 1.3 came out, I started a new campaign, and there was a graphical issue that caused a combination of flashing and inverted colors."

That bug is actually caused by one of the additional map mods, and is specific to a city center map parcel. Save and reload fixes it.
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Why does disabling and re-enabling mods fix anything?

Post by Zyxpsilon »

@Izmir..

Strangely, with my personal development "restrictions" to maintain a single valid copy of my own MODs (auto-copied by ModBuddy compiling process in the core game XCom2 folders) the whole Load-Order + Steam-Hooks concerns are basicly collapsing at runtime.

For example.. while qUIck_LW2 (some fancy HUD/UI assets are driven by stock Localization files which use various custom HTML instructions, etc) does load-up "correctly" on my system after LW2 updates whenever (IF i replace their INT with mine locally!) -- my subscribers must effectively use new copies (via updates or through re-subscribing steps) of it AFTER LW2 changes anything with updates to whatever.

Amineri from Pavonis confirmed these assumptions awhile back in the early days of LW2.. since i was (rightfully) worried my type of alterations to "ModMod" filing elements would NOT be able to transit properly between old & new content -- be it in their structure or mine.

To me.. Load-Order is a mysterious consequence of wacky conditions created by either Firaxis or Steam design slack(s) to offer a different but more stable way to handle the predictable Workshop chaos (that HAD to occur naturally, btw) as proven by such things like unique "Community Highlander" scripting.
There was --indeed-- some logical limits with the SDK as delivered.

Thanks to sharp-minded modders though (Namely, InfectedM and his/our somewhat cool SwappIMG procress/solution which i had to beg for to find an alternate method to "TexMod" GFX stuff again like we were able to within XC1) -- most of it got solved, with time! ;)
Izmir Stinger
Posts: 7
Joined: Sat May 13, 2017 5:28 pm

Re: Why does disabling and re-enabling mods fix anything?

Post by Izmir Stinger »

Zyxpsilon wrote:To me.. Load-Order is a mysterious consequence of wacky conditions created by either Firaxis or Steam design slack(s) to offer a different but more stable way to handle the predictable Workshop chaos (that HAD to occur naturally, btw) as proven by such things like unique "Community Highlander" scripting.
There was --indeed-- some logical limits with the SDK as delivered.
I've been wanting to check out this Community Highlander project in more detail at some point. It seems to expand the possible design space for mods considerably. One Highlander mod that I really want in my games but cannot load alongside LW2 is called "idle suppression." Instead of just pressing their backs against cover and glowering at each other while you are considering your options, that mod makes random soldiers do the suppression animation against random targets at random intervals, so "idle" time on the tactical map looks like a heated gun battle.

Everything is cosmetic of course. No one is actually suppressed, no ammo is consumed and no one gets hurt. Just looks awesome.
Post Reply