Truinto / ONI-Modloader-SimpleMods

OxygenNotIncluded Mods
MIT License
18 stars 6 forks source link

[PipedEverything] Kiln causes crash #47

Open RedStoner opened 11 months ago

RedStoner commented 11 months ago

Describe the bug Game is crashing upon loading map and resuming map. I can load into the map, but as soon as I unpause, it crashes.

To Reproduce Steps to reproduce the behavior: Unsure of what caused this issue directly. I have recently started using the ouputs/inputs added to the kilns and to a few storage bins.

[required] Debug Logs

Screenshots If applicable, add screenshots to help explain your problem.

Windows 10 Pro Version 20h2

Crash Log -

Assert failed: openOrderCount invalid

  at UnityEngine.Debug.LogError (System.Object message) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at Debug.LogError (System.Object obj) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Debug.Assert (System.Boolean condition, System.Object message) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at ComplexFabricator.StartWorkingOrder (System.Int32 index) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.RefreshAndStartNextOrder () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.Sim1000ms (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at SimAndRenderScheduler+Sim1000msUpdater.Update (ISim1000ms updater, System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at UpdateBucketWithUpdater`1[DataType].Update (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater+BucketGroup.AdvanceOneSubTick (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater.AdvanceOneSimSubTick () [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Game.SimEveryTick (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at Game.Update () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
Build: U49-577063-V

Player.log

RedStoner commented 11 months ago

Removing Piped Everything mod allows the world to load properly. Though my map is heavily reliant at it at this point being almost 700 cycles in.

Truinto commented 11 months ago

Seems specific to a state of a fabricator (meaning buildings with recipes). I can't think of a reason that would happen. If disabling the mod allows you to load the map, you could clear recipes and then re-enable the mod to get rid of the crash. Still, there must be more to it. I played many hours with this mod enabled and had no such issue...

RedStoner commented 11 months ago

It was a kiln. I was able to load the game, remove the recipes from the kiln, then resume without the crash happening.

RedStoner commented 11 months ago

Crash is still persistent hundreds of cycles later. Every time the save is loaded, I need to remove the recipes from the kilns to get the map to play without crashing. If any kilns have a recipe assigned to them with conveyors attached, the game will crash upon pressing play. I do not need to uninstall the mod to do this fix. I can load the map and remove all the recipes before resuming. It is just a large annoyance to do this all the time.

Truinto commented 10 months ago

You have the option to not connect the ports. You could also remove the ports from the config altogether. I can't find why your Kiln specifically would have this issue. The error can only be caused if the fabricator is processing a new order, but the order either has no recipe or zero remaining orders. In either case the processing should not have been started.

I added a patch that stops processing, if the order is invalid. So it's now impossible for this crash to happen. But since I didn't figure out why it happens, there might be other issues which I am unaware of. But it probably works fine now.

RedStoner commented 10 months ago

still crashing. This time though, the crash is actually disabling the mod, and the crash report looks just a little different.

 Assert failed: openOrderCount invalid

  at UnityEngine.Debug.LogError (System.Object message) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at Debug.LogError (System.Object obj) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Debug.Assert (System.Boolean condition, System.Object message) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at ComplexFabricator.ComplexFabricator.StartWorkingOrder_Patch1 (ComplexFabricator , System.Int32 ) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.RefreshAndStartNextOrder () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.Sim1000ms (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at SimAndRenderScheduler+Sim1000msUpdater.Update (ISim1000ms updater, System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at UpdateBucketWithUpdater`1[DataType].Update (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater+BucketGroup.AdvanceOneSubTick (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater.AdvanceOneSimSubTick () [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Game.SimEveryTick (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at Game.Update () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
Build: U49-577063-V

Save file - https://drive.google.com/file/d/1eNbBe897b_MWuFLFrnouLKJjXH17VR_Y/view?usp=drive_link

RedStoner commented 10 months ago

Was also noticing yesterday that the items that were going to the kilns via conveyors were just dropping on the ground(falling off the conveyors) if the recipe was not set on there.

Truinto commented 10 months ago

That's always the case. Delivering material not required by any recipe is dropped. Same without mods.

What other mods are you playing with? I am almost certain this is a cross compatibility bug. Note that the recipe order state can remain even with the mod disabled.

Truinto commented 10 months ago

I committed a coding sin and forced the function to not throw exceptions. There is no way this still causes issues.

RedStoner commented 10 months ago

Confirmed this fix prevents the crash. Mod list- mods.json

RedStoner commented 10 months ago

Yeah, so loaded in today.... it crashed again... just going to keep removing the recipe before resuming. I feel this is becoming bothersome to you.

Assert failed: openOrderCount invalid

  at UnityEngine.Debug.LogError (System.Object message) [0x00000] in <72b60a3dd8cd4f12a155b761a1af9144>:0 
  at Debug.LogError (System.Object obj) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Debug.Assert (System.Boolean condition, System.Object message) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at ComplexFabricator.StartWorkingOrder (System.Int32 index) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.RefreshAndStartNextOrder () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at ComplexFabricator.Sim1000ms (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at SimAndRenderScheduler+Sim1000msUpdater.Update (ISim1000ms updater, System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at UpdateBucketWithUpdater`1[DataType].Update (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater+BucketGroup.AdvanceOneSubTick (System.Single dt) [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at StateMachineUpdater.AdvanceOneSimSubTick () [0x00000] in <d9d260db23eb4b5ea9674097f27ddfad>:0 
  at Game.SimEveryTick (System.Single dt) [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
  at Game.Update () [0x00000] in <d1b7643456214f4e8c00f70e3a2b4469>:0 
Build: U49-577063-V
Truinto commented 10 months ago

Only a bit.

Weird that the patch is missing completely from the log now. Make sure you use Mod Updater. Try clearing your download cache https://help.steampowered.com/en/faqs/view/6AD7-820D-8BE5-E51F