Cannot recover game

Crash Mod issue Saves & Loading Reopened

A game update can break mods until their authors rebuild them. Mods not working explains how to keep playing meanwhile.

ComputerNerd ComputerNerd · 7 days ago

Issue description

This save file depends on content that's not available, are you missing a mod or DLC?

Mafi.Serialization.CorruptedSaveException: Failed to finalize deserialization of 'Mafi.Collections.Lyst1[Mafi.Core.World.Contracts.ContractProto].ToString() threw NullReferenceException' (type 'Lyst1')
parent object '--' (type '--')
Previous deserialized in this finalize call: 'Count: 0, capacity: 0' (type 'Set1') Last deserialized across all finalize calls: 'Count: 0, capacity: 0' (type 'Set1')
Last read object types: [VehicleReplacementTask[], ContractProto[], ContractProto[]] ---> Mafi.Serialization.CorruptedSaveException: Failed cast loaded proto '__PHANTOM__FAILED_TO_LOAD__cm_contract_639217536159364629 (InvalidProto)' to 'ContractProto'.
at Mafi.Core.Prototypes.ProtosSerializerFactory.deserialize[T] (Mafi.Serialization.BlobReader reader) [0x00065]
at Mafi.Serialization.BlobReader.ReadArray[T] (System.Int32 length) [0x0004d]
at Mafi.Collections.Lyst1[T].DeserializeData (Mafi.Serialization.BlobReader reader) [0x00023] at Mafi.Collections.Lyst1+<>c[T].<.cctor>b__156_1 (System.Object obj, Mafi.Serialization.BlobReader reader) [0x00000]
at Mafi.Serialization.BlobReader+<FinalizeLoadingTimeSliced>d__44.MoveNext () [0x00054]
--- End of inner exception stack trace ---
at Mafi.Serialization.BlobReader+<FinalizeLoadingTimeSliced>d__44.MoveNext () [0x00202]
at Mafi.Core.SaveGame.GameLoader+<FinishGameLoadAndDisposeTimeSliced>d__12.MoveNext () [0x004ef]
at Mafi.Core.Game.GameBuilder+<BuildLoadedGameTimeSliced>d__1.MoveNext () [0x005a4]
at Mafi.Unity.GamePlayScene+<loadGame>d__28.MoveNext () [0x002ca]
at Mafi.Unity.GamePlayScene+<Initialize>d__25.MoveNext () [0x000ad]
at Mafi.Unity.Main+<unloadAndStartNewScene>d__117.MoveNext () [0x0013b]
at Mafi.Unity.Main.stepSceneInitialization () [0x00104]

Game version: 0.8.7d
Loaded mods: (Trains expansion 1.0.0), (Kayser's Automatic Terrain Designations 0.9.6), (BeTTerLife: Transports 0.6.1), (Pier Wall Mod 1.0.2), (CAP.PierWall.LiquidDump 1.0.1), (CAP.PierWall.SeawaterPump 1.0.1), (Quick Build Unlocked 1.0.3), (Show Terrain Grid 1.0.2), (Decals Plus 0.1.0), (Kayser's Blueprint Designer's Toolkit 0.11.8), (Advanced Farm & Food Optimiser 0.4.0), (Vertical Balancers 0.1.3), (Instant Surfaces 0.1.1), (Notepad Mod 0.2.4), (Ore Sorters Storage Boost 0.1.0), (Pause On Start 0.1.3), (ProductHighlight 5.2.0), (Production Calculator 0.4.0), (Recolor 1.1.0), (Research Queue 1.0.1), (To-Do List 1.1.0), (Vehicle Ramp Revival 1.0.1), (Wind turbines 0.1.11a), (Zone Analyzer 1.4.2), (Adaptive Mining Tower UI 1.0.8), (Boost++ 1.3.5), (Cheat++ 1.5.0), (Gameplay++ 1.4.2), (Storage++ 1.3.6), (Tweaks++ 1.3.9), (Utilities++ 1.3.0), (WorldGen++ 1.2.5)
Failed mods: none

Reproduction steps

  1. Mods giving errors under the new 0.8.8b update
  2. Reverted to 0.8.7d
  3. Reverted to old versions of mods
  4. Tried to load old save so I can do a recovery save
  5. Kept getting the above error during load
  6. Cannot get into game save to do recovery save.

Game version and build number

v0.8.7d (b619)-legacy

Which branch of the game are you on?

Stable

Operating system

Windows

2 attachments only for registered users
poltime poltime · 6 days ago

The main cause of the error is a missing or incorrect version of a mod that adds custom contracts (most likely OnDemandContracts).

The log explicitly shows a CorruptedSaveException because the game is trying to load a contract prototype with the ID __PHANTOM__FAILED_TO_LOAD__cm_contract_639217536159364629 (InvalidProto) but cannot find it in the current session's database. As a result, the deserialization of the contract list fails with a NullReferenceException.

The game explicitly states: "This save file depends on content that's not available, are you missing a mod or DLC?"

  1. At the beginning of the log, during the initial folder scan, the game detects a mod called OnDemandContracts:

    I 17:31:45,273 S------ ~Mai: Found 32 mods
      ...
      OnDemandContracts vOnDemandContracts
      ...
    
  2. The mod disappears during initialization: However, further down in the list of successfully loaded mods (Loaded mods:), this particular mod is completely missing. For some reason, the game detected it at launch but failed to initialize it when loading the save file.

  3. The prefix of the missing prototype cm_contract_... (likely standing for Custom Mod Contract) confirms that the save file contains an active contract from this mod, but it cannot be loaded without the mod being active.


How to fix it:

  • Check the OnDemandContracts mod: Ensure that the mod files are not corrupted. Try updating it to the latest version compatible with your game version (0.8.7d), or reinstall it completely.
  • Check for conflicts: The log also captures an error from the AutoTerrainDesignations mod:
    InvalidOperationException: Expected one mining assignment assertion, found 0.
    While this doesn't crash the game instantly, it indicates that some of your 32 mods are not working properly with your current game version and might be interfering with the loading process of other modifications. Try disabling it temporarily.
Captain Matt Captain Matt · 6 days ago

Thanks for the report! This is caused by a mod, so please let the mod's author know. If it started after a game update, you can keep playing on the previous game version (Steam legacy branch) until the mod is updated, or continue without the mod (recovery save). See the Mods not working guide for how.

ComputerNerd ComputerNerd · 5 days ago

Captain Matt,

Help me Obi wan, your my only hope!

Q: Is there any way to do a recovery save without loading a working save and getting to the Console?

I tried rolling back to 0.8.7d and rolled back all 32 mods to their 0.8.7d versions and still cannot get into the save game. I spent about 300+ hours playing that save.

I even removed all the mods from my mods folder and reinstalled them for 0.8.7d in case they got contaminated when I had first tried to run the save with the new 0.8.8b version of the game and updated the mods.

Now I'm getting the following:

2026-11-08 14 26 35.png

All 32 of the same mods are in the mods folder. All 32 are green check-marked on my save games load/mods & DLC's window.

I'm between a rock and a hard place. I rolled back to the previous version of the game and cannot load the save game, which means I can't get to the console to do a recovery save.

Suggestion: It would be great if we could recover a save game outside of having it loaded and running (maybe have a recovery option at the main menu). Just a thought.

At this point it looks like I am going to have to start a whole new game with the 0.8.8 version and have a funeral service for the 300+ hours of my lost game. He was a good friend with many good memories. I will miss him deeply.

There will be a burial at sea.😢

The mods have really added a lot of fun to the game, but I am going to be real gun shy of ever using mods again.

Thanks for all your time and effort you have done with this great game.

Edited 5 days ago
ComputerNerd ComputerNerd · 5 days ago

poltime,

Thanks for the great analysis.

I too thought one or more of the mods might have been corrupted when I first tried running 0.8.8b and updated the mods. I ended up deleting all the mods out of the mods folder and reinstalling all 32 mods to the 0.8.7d compatible versions.

And now I am getting a new error about missing mod or DLC even though all 32 mods are there and got green check marks.

See the post above with a screen capture of the new error.

I appreciate your analysis.

Captain Matt Captain Matt · 4 days ago

Another player had a similar issue, be sure you have this mods installed (version must match) when you are using 0.8.7d. This list comes from you save:

COI-TrainsDlc 1.0.0
AutoTerrainDesignations 0.9.3
BetterLife_Transports 0.6.1
PierWallMod 1.0.2
CAP-PierWall-LiquidDump 1.0.1
CAP-PierWall-SeawaterPump 1.0.1
Carbon.QuickBuildUnlocked 1.0.3
Carbon.ShowTerrainGrid 1.0.2
DecalsPlus 0.1.0
DesignerToolkit 0.11.4
FaFOptimiser 0.4.0
H4uklotz.VerticalBalancers 0.1.3
InstantSurfaces 0.1.1
NotepadMod 0.2.4
OnDemandContracts 0.2.3
OreSortersStorageBoost 0.1.0
PauseOnStart 0.1.3
ProductHighlight 5.2.0
ProductionCalculator 0.2.1
Recolor 1.1.0
ResearchQueue 1.0.1
TodoList 1.1.0
Vehicle-Ramp-Revival 1.0.0
WindPower 0.1.11a
ZoneAnalyzer 1.4.2
adaptive-mining-tower-ui 1.0.8
boost-plus-plus 1.3.5
cheat-plus-plus 1.5.0
gameplay-plus-plus 1.4.2
storage-plus-plus 1.3.6
tweaks-plus-plus 1.3.9
utilities-plus-plus 1.3.0
worldgen-plus-plus 1.2.5
ComputerNerd ComputerNerd · 4 days ago

Captain Matt,

Thanks for the reply.

Unfortunately I have already erased everything (except my blueprints) and am starting over from scratch with 0.8.8c.
My old game save is now buried at sea with a 21 gun salute. The island sunk into the ocean like Atlantis. I am sailing to new lands to start over.🤧

I came up with a plan for the future where I will completely backup every COI folder when I know a new version is coming out BEFORE I startup the game.

If this happens again in a future update, I can just revert to the earlier version on Steam and restore the COI folders. Hopefully that will work and I won't lose hundreds of hours of construction again.

I love the game and have loved everything you guys at MAFI have done with it.

I looked it up just now on Steam and I have played 1,528 hours so far on COI.
Hopefully there will be thousands more.

ComputerNerd ComputerNerd · 1 day ago Reopened the topic, was Expired

Captain Matt,

I had erased all 32 Mods in the Mods folder and reverted back to 0.8.7d legacy and reinstalled all 32 0.8.7d mods with the version numbers you listed above from my save game file. I was still getting the same error message as above about missing mods.

Question: When someone reverts back to a previous COI game version (i.e. 0.8.7d) does Steam just write over the top of the files in the C:\Program Files (x86)\Steam\steamapps\common\Captain of Industry
directory or does it delete ALL contents of the folder?

The reason I'm asking is if Steam just overwrites the files in the steamapps folder and there are new 0.8.8 program files that linger without overwrite or deletion and are loading with the 0.8.7d code, or some 0.8.8 files in Appdata/Roaming besides the Mods folder it could have side effects giving errors for 0.8.7d Mods.

I was thinking of doing a test and doing a fresh install on one of my other computers of COI 0.8.7d with the above listed mod versions and see if it works. If so, then some lingering remnant of 0.8.8 code is the issue.

I remember reading somewhere that COI is discontinuing use of periods in Mod ID's:

>> "Mod IDs with a period are obsolete and will be rejected in Update 5 (v0.9.0). With a period, a mod can also neither prefix its prototypes with its mod ID nor ship translations."

Let me know what you think. Thanks.

🤔 1 🙄 1
Captain Matt Captain Matt · 17 hours ago

There are 33 in the list i provided, do you have OnDemandContracts 0.2.3?

ComputerNerd ComputerNerd · 4 hours ago

Captain Matt,

Yes, I have OnDemandContracts 0.2.3

Yes, There are 33 items in your list, but 1 is the TrainsDLC and 32 are Mods. All are loaded.

This shows the 32 mods and OnDemandContracts:

image.png

And the OnDemandContracts manifest.json:

image.png

Edited 4 hours ago
63 Showing 1–10 of 10