MaFi-Games / Captain-of-Industry-issues

Public issue tracker for Captain of Industry video game
22 stars 4 forks source link

saved games cannot be loaded - strange recovery #1552

Open niddamm opened 4 months ago

niddamm commented 4 months ago

Issue description

Previous saved file cannot be loaded, resulting in following error message below.

Please check the reproduction steps as the "solution" was very strange.

Attachted the log from one failed loading and then the successfull loading for the same file.

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

System.NullReferenceException: Object reference not set to an instance of an object at Mafi.Core.Terrain.TerrainManager.IsOcean (Mafi.Tile2iIndex index) [0x0000c]
at Mafi.Unity.Camera.OrbitalCameraModel.recomputePivotHeight () [0x00048]
at Mafi.Unity.Camera.OrbitalCameraModel.SetMode (Mafi.Unity.Camera.CameraMode mode) [0x000cf]
at Mafi.Unity.Camera.OrbitalCameraModel.Initialize () [0x00000]
at Mafi.Unity.Camera.CameraController+<>c__DisplayClass28_0.<.ctor>b0 () [0x00000]
at Mafi.Core.GameLoop.IGameLoopEventsExtensions+d
3.MoveNext () [0x00013]
at Mafi.Core.GameLoop.GameLoopEvents+d66.MoveNext () [0x000d3]
at Mafi.Core.GameLoop.GameRunner+d
104.MoveNext () [0x0039f]
at Mafi.Core.Game.GameBuilder+d6.MoveNext () [0x00127]
at Mafi.Core.Game.GameBuilder+d
3.MoveNext () [0x0037a]
at Mafi.Unity.GamePlayScene+d21.MoveNext () [0x00296]
at Mafi.Unity.GamePlayScene+d
18.MoveNext () [0x000a5]
at Mafi.Unity.Main+d__70.MoveNext () [0x000fc]
at Mafi.Unity.Main.stepSceneInitialization () [0x000dc]

Reproduction steps

1) Save the game at the end of a session 2) Boot up and try to load last save file file with "continue" 3) Loading screen will show up until ~ 20% and then error message appears. Happens every time, even after restarting the game. 4) Trying all the savegames from this run result in the same error message => No working save for this run anymore

5) Trying an old savegame from last year, loaded without problems 6) Saved that old savegame to try to reproduce the issue 7) Exit the game and load the saved file, worked without any problem

8) Once again tried to open the original file from this morning => worked! no problem anymore without touching that file

So for some reason opening and saving an old save "healed" the problem with the new save...

In between the sessions for the "corrupt" game there was the update from 0.6.4 to 0.6.4a but I dont know if it was just before the corruption. After updating to 0.6.4 it worked just fine (was testing the (noticable) speedup during loading the file)

Game version and build number

v0.6.4a b339

Operating system

Windows

Attachments

Save 2024-05-18, 20-18-51.zip Log - failed load - 24-05-26_21-28-10_1926.zip Log - load ok - 24-05-26_21-47-15_8478.zip

niddamm commented 4 months ago

Maybe duplicate to #1545 - but the recovery was not there, so maybe that is helping new information