slyh / Cities2-TrafficLightsEnhancement

Advanced traffic lights for Cities: Skylines II
200 stars 20 forks source link

v0.2.12-alpha make my save crash without any error message in the bepinex log #72

Closed GIS-PuppetMaster closed 6 months ago

GIS-PuppetMaster commented 6 months ago

Especially when I use road replace tool to update the 6 lane road to 7 lane road (both side of the road have custom traffic lights and one side has custom lane direction)

slyh commented 6 months ago

Could you share a screenshot of the road setup that caused the crash?

Although there is no error message, could you upload your BepInEx log? It contains valuable information, such as the mods you have installed, which could help us in replicating the issue.

GIS-PuppetMaster commented 6 months ago

Could you share a screenshot of the road setup that caused the crash?您能否分享导致事故的道路设置的屏幕截图?

Although there is no error message, could you upload your BepInEx log? It contains valuable information, such as the mods you have installed, which could help us in replicating the issue.虽然没有错误消息,但您可以上传您的 BepInEx 日志吗?它包含有价值的信息,例如您安装的模组,这可以帮助我们重现问题。

image image image image image After I replace the road and the game run normally for about 3 seconds, the game stucked

GIS-PuppetMaster commented 6 months ago

The last picture is a custom parking that I made by invisible road with parking lot

GIS-PuppetMaster commented 6 months ago

LogOutput.log

GIS-PuppetMaster commented 6 months ago

It seems that the game will break if I replace other roads, I'm not sure

slyh commented 6 months ago

I'm able to replicate this issue. The game might crash to desktop or throw an exception when upgrading a road.

Object reference not set to an instance of an object
NullReferenceException: Object reference not set to an instance of an object
  at Unity.Entities.ECBChunk.Bump (System.Int32 size) [0x00000] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBufferData.Reserve (Unity.Entities.EntityCommandBufferChain* chain, System.Int32 sortKey, System.Int32 size) [0x00116] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBufferData.AddEntityComponentTypeWithValueCommand[T] (Unity.Entities.EntityCommandBufferChain* chain, System.Int32 sortKey, Unity.Entities.ECBCommand op, Unity.Entities.Entity e, T component) [0x0003c] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBuffer.AddComponent[T] (Unity.Entities.Entity e, T component) [0x00018] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.InitializeTrafficLights (Unity.Entities.DynamicBuffer`1[T] subLanes, Unity.Collections.NativeList`1[T] groups, System.Int32 groupCount, System.Boolean isLevelCrossing, Game.Net.TrafficLights& trafficLights) [0x000f9] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x000d9] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x00000] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x000b5] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x00000] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at (wrapper delegate-invoke) Unity.Entities.JobChunkExtensions+JobChunkProducer`1+ExecuteJobFunction[C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob].invoke_void_JobChunkExtensions/JobChunkWrapper`1<T>&_intptr_intptr_JobRanges&_int(Unity.Entities.JobChunkExtensions/JobChunkWrapper`1<C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem/InitializeTrafficLightsJob>&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
Colossal.Logging.CustomLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
GIS-PuppetMaster commented 6 months ago

I'm able to replicate this issue. The game might crash to desktop or throw an exception when upgrading a road.我能够复制这个问题。升级道路时,游戏可能会崩溃到桌面或引发异常。

Object reference not set to an instance of an object
NullReferenceException: Object reference not set to an instance of an object
  at Unity.Entities.ECBChunk.Bump (System.Int32 size) [0x00000] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBufferData.Reserve (Unity.Entities.EntityCommandBufferChain* chain, System.Int32 sortKey, System.Int32 size) [0x00116] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBufferData.AddEntityComponentTypeWithValueCommand[T] (Unity.Entities.EntityCommandBufferChain* chain, System.Int32 sortKey, Unity.Entities.ECBCommand op, Unity.Entities.Entity e, T component) [0x0003c] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.EntityCommandBuffer.AddComponent[T] (Unity.Entities.Entity e, T component) [0x00018] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.InitializeTrafficLights (Unity.Entities.DynamicBuffer`1[T] subLanes, Unity.Collections.NativeList`1[T] groups, System.Int32 groupCount, System.Boolean isLevelCrossing, Game.Net.TrafficLights& trafficLights) [0x000f9] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x000d9] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) [0x00000] in <dfcc6cdd930f477d9380235c3d3625a0>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x000b5] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at Unity.Entities.JobChunkExtensions+JobChunkProducer`1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper`1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) [0x00000] in <9a7e91fb1c0a42bdb40b67eb2c0b13bb>:0 
  at (wrapper delegate-invoke) Unity.Entities.JobChunkExtensions+JobChunkProducer`1+ExecuteJobFunction[C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem+InitializeTrafficLightsJob].invoke_void_JobChunkExtensions/JobChunkWrapper`1<T>&_intptr_intptr_JobRanges&_int(Unity.Entities.JobChunkExtensions/JobChunkWrapper`1<C2VM.TrafficLightsEnhancement.Systems.TrafficLightInitializationSystem.PatchedTrafficLightInitializationSystem/InitializeTrafficLightsJob>&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
Colossal.Logging.CustomLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Great! Glad to be helpful

slyh commented 6 months ago

Unfortunately, I think it needs significant changes to fix the problem permanently. I have implemented a temporary fix that should reduce the number of crashes, making it unlikely to crash during normal gameplay.