Game Crash

Crash Saves & Loading
JohnMegacycle [github] · 1 year ago

Issue description

I was copy/pasting train stations when I received the below error, which kicked me out of the game (back to main menu).

The game failed to initialize. Please file a bug report if this issue persists.

Mafi.Serialization.CorruptedSaveException: Failed to initialize 'Train' when calling 'initAfterLoad' ---> Mafi.Serialization.CorruptedSaveException: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Mafi.Core.Trains.Train.initAfterLoad (System.Int32 saveVersion) [0x001c5] . Train initialization failed.
at Mafi.Core.Trains.Train.initAfterLoad (System.Int32 saveVersion) [0x00594]
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a]
--- End of inner exception stack trace ---
at Mafi.Serialization.BlobReader+<FinalizeLoadingTimeSliced>d__34.MoveNext () [0x005c7]
at Mafi.Core.SaveGame.GameLoader+<FinishGameLoadAndDisposeTimeSliced>d__7.MoveNext () [0x004a9]
at Mafi.Core.Game.GameBuilder+<BuildLoadedGameTimeSliced>d__3.MoveNext () [0x002fe]
at Mafi.Unity.GamePlayScene+<loadGame>d__25.MoveNext () [0x00297]
at Mafi.Unity.GamePlayScene+<Initialize>d__22.MoveNext () [0x000a5]
at Mafi.Unity.Main+<unloadAndStartNewScene>d__89.MoveNext () [0x0011b]
at Mafi.Unity.Main.stepSceneInitialization () [0x000dd]

Reproduction steps

Unable to replicate issue after loading earlier save. The crashing save is included in the attachment.

Game version and build number

v0.7.8a b486

Operating system

Windows

Attachments

Save 2025-08-22, 13-33-43.save

1 attachment only for registered users
poltime poltime · 1 year ago

It would be better to attach logs from folders:

%AppData%\Captain of Industry\Logs
%USERPROFILE%\AppData\LocalLow\Mafi Games\Captain of Industry
%USERPROFILE%\AppData\Local\Temp\Mafi Games\Captain of Industry\Crashes

JohnMegacycle [github] · 1 year ago

Good call and I completely spaced on that. Thank you!

25-08-22_08-44-16_9096.log

Player-prev.log

2 attachments only for registered users
Captain Marek Captain Marek · 1 year ago

This may have been fixed on v0.7.8b (currently on experimental branch), I cannot test this as I don't have the mods you are using. Would you be able to test loading of the save on the v0.7.8b and let us know whether it still fails?

JohnMegacycle [github] · 1 year ago

Good evening,
The mods aren't currently up to date with the latest experimental. I tried and the save crashes on load. Once the mods are updated, I'll give it a try on the v0.7.8b version and will let you know.

17 Showing 1–5 of 5