XCOM 2
[WOTC] Too Many Mods
19 Comments
Papistman 11 Jul @ 3:02pm 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
XpanD 11 Jul @ 1:35pm 
I created a new mod project in the SDK with a short name, and then (co-)wrote a Powershell script to clone it thousands of times, giving each clone its own number. Great for testing, but unfortunately not something that would scale up to actual mods that do things. Recompiling those is technically possible, but would be way too much work to do for a large mod set. (and would mess with things like automatic updates and load order)

The closest thing you /can/ realistically do is probably to merge simple mods like config tweaks into one big local mod. I've also seen people merge asset mods like voice packs, but that's a bit more involved.
Papistman 11 Jul @ 12:38pm 
@XpanD
You mention doing this earlier:

"I successfully had the game saving and loading over 2000 testing mods, with a limit somewhere around the 2160 mod mark. This was purely due to it overflowing the data block responsible for storing mod names and save metadata, and I could shift that point around by just making my mod names (or even just the save name itself) shorter or longer."

How did you make the mod names shorter? Was it by editing the mod names in the Alternative Mod Launcher?
XpanD 14 Jun @ 2:16am 
@LightenedDark: If you're curious enough, I added details on what to look for to the modding wiki: https://www.reddit.com/r/xcom2mods/wiki/mod_troubleshooting/#wiki_what_is_the_maximum_number_of_mods_i_can_play_with.3F
LightenedDark 13 Jun @ 8:29pm 
I wonder what an normal/average amount of mods would have to be added to a modlist before this issue pops up. I've run about a thousand and not seen it, but that doesn't mean I'm not right around the limit...
N.C.V.  [author] 27 May @ 2:37pm 
Note: It did not fix the Old War Hero bug. I guess just dismiss the extra one you get on load in, since I'm not quite sure why it's not counting as added.
N.C.V.  [author] 22 May @ 11:14am 
Alright there we go, should stop giving you an Old War Hero every time you load in now.
N.C.V.  [author] 21 May @ 5:05pm 
New bug I found. Since this technically removes Resistance Warrior Pack, it'll keep giving you a new Old War Hero every time you load in, so I'll add all the XCOM 2 DLCs to the list in the next update. They won't actually do anything if you don't have them installed, but it should fix that problem.
XpanD 21 May @ 8:42am 
Yep, some mods behave poorly in some situations (MOCX was a recent big find with its Geoscape bloat), and doing a tactical <> strategy transition cleans up a bunch of old stuff from the history.

I've done some limited digging into saves affected by various bloat issues, but I don't /think/ the data blocks that are getting bloated have the same hard character limits. (saw blocks with >80k characters on working saves, though I'm not sure if my search filters were set up properly -- big files are awkward to work with!)
Zedonova Nova 21 May @ 8:36am 
@XpanD I noticed that when I loaded a save after opening the barracks the save files sizes would increase dramatically from 5-8k save sizes to roughly ten times that size 80k. The 80k file sizes were unloadable and would crash my game outright while loading. However, I did some testing. After recruiting new soldiers this would cause the same issue. The increased file save size to 55-80k file sizes. This I believe could be a secondary cause of saves not working correctly.

I did further testing and found out that saving in mission reduces the size back down to 5k which means the barracks details are being saved with the game instance causing the bloating file save size. Then immediately after finishing a mission without recruiting the save file size is reduced down to about 6-7k which loads back fine with no issues.
N.C.V.  [author] 19 May @ 3:23pm 
Added Chonsu's mods from their run of the script! Most notable of these is Modjam for you Modjam users!
LeyShade 19 May @ 2:25pm 
@XpanD - Thank you for detailed response and link. Will take time to properly read through later and contact you directly for any clarifications.
N.C.V.  [author] 19 May @ 9:57am 
Added XpanD's mods from their run of the script, so in theory we now support LWOTC!
XpanD 19 May @ 1:25am 
I can answer this one -- the number of mods doesn't affect it. (I did the testing for the original issue/limit)

I successfully had the game saving and loading over 2000 testing mods, with a limit somewhere around the 2160 mod mark. This was purely due to it overflowing the data block responsible for storing mod names and save metadata, and I could shift that point around by just making my mod names (or even just the save name itself) shorter or longer.

You can read a summary of my findings here: https://www.reddit.com/r/xcom2mods/wiki/mod_troubleshooting/#wiki_what_is_the_maximum_number_of_mods_i_can_play_with.3F (more info in the Discord if you do a search for the magic marker, "Áƒ*ž")

As for the OnLoadedSavedGame calls, the script N.C.V. linked to in the description is a modified version of one I had ChatGPT generate, and it skips over empty calls. The only results should be ones that actually do something with the event.
LeyShade 19 May @ 1:02am 
Question: How was the limit worked out, as this error is also repeatable if a certain number of installed mods is breached, regardless of their filename length.

Also, "OnLoadedSaveGame" isn't the most reliable way of handling this, because over half the mods on workshop include calls to it which are inactive. You would have to manually check every single script people make to ensure that you accurately catch every case.

As such, it's more ''what is safe to remove is'' a case of ''what has it altered within the save configuration'', less than what scripting mods involve.
N.C.V.  [author] 18 May @ 2:07pm 
Generally, just looking at what ticks OnLoadedSaveGame, cosmetic and voice mods are safe to exclude, but weapon mods aren't.
N.C.V.  [author] 18 May @ 2:05pm 
It'd be nice if there was some sort of database for this.
N.C.V.  [author] 18 May @ 2:05pm 
It's technically* functional as is right now, but since you've probably got different mods, I'd recommend running the script to see what mods you've got that shouldn't be removed that I don't have installed.
Chonsu 18 May @ 2:02pm 
I will watch the development of this as I am constantly at or over the limit. Best of luck and thumbs up!