klyte45 / TransportLinesManager

The TLM mod for Cities Skylines
Other
28 stars 23 forks source link

Vehicles Flickering on Screen #210

Open Jaroch76 opened 2 years ago

Jaroch76 commented 2 years ago

The vehicles on screen are flickering in and out. It doesn't matter if the game is paused. The flickering is affected by zoom levels and camera angles.

Turning of the TransportLinesManager, exiting Cities, and then reloading the game solves the problem.

Here's the relevant error in the game's output_log.txt file:

(Filename:  Line: -1)

KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2<long, Klyte.TransportLinesManager.Extensions.OutsideConnectionLineInfo>.get_Item (long) <0x0019d>
at Klyte.Commons.Utils.NonSequentialList`1<Klyte.TransportLinesManager.Extensions.OutsideConnectionLineInfo>.get_Item (long) <0x0003c>
at Klyte.TransportLinesManager.Cache.InnerBuildingLine.get_LineDataObject () <0x0014c>
at Klyte.TransportLinesManager.TLMVehicleOverrides.PreGetColorPassengerLineVehicle (uint16,Vehicle&,InfoManager/InfoMode,UnityEngine.Color&) <0x000be>
at (wrapper dynamic-method) PassengerTrainAI.PassengerTrainAI.GetColor_Patch2 (PassengerTrainAI,uint16,Vehicle&,InfoManager/InfoMode) <0x00075>
at (wrapper dynamic-method) PassengerTrainAI.PassengerTrainAI.GetColor_Patch2 (PassengerTrainAI,uint16,Vehicle&,InfoManager/InfoMode) <0x001a8>
at Vehicle.RenderInstance (RenderManager/CameraInfo,uint16) <0x00e4e>
at VehicleManager.EndRenderingImpl (RenderManager/CameraInfo) <0x02f17>
at SimulationManagerBase`2.EndRendering (RenderManager/CameraInfo) <0x0002a>
at VehicleManager.IRenderableManager.EndRendering (RenderManager/CameraInfo) <0x00024>
at RenderManager.LateUpdate () <0x009a2>

I'm running Cities v1.14.0-f4, but I don't have the Airports DLC installed.

Jaroch76 commented 2 years ago

I've discovered that the error above only occurs when I have one or more train stations set to use TLM's new Regional Platform settings function. With that function turned off on every station, the flickering, and the errors in the log file, go away.

Possibly related is the fact that, when this function is turned on, my stations are prone to sending out massive numbers of one- and two-passenger trains, despite having Quboid's “Optimised Outside Connections” mod installed updated.

klyte45 commented 2 years ago

I'll need the full log to check this issue

Jaroch76 commented 2 years ago

I fired up the game for only a couple of minutes: just long enough to enable regional lines settings for a train station and wait for the error to reoccur. Here's the full log file. I've inserted a line with the word "Bookmark" right at the point where the I enabled the regional lines.

output_log.zip

I've tested out the regional lines feature on a few different stations (exiting and reloading Cities between each one), and they all give me the same errors in the log file.

Let me know if you need anything else. And, thank you for looking into this.

TheBloke commented 2 years ago

I came here to report the same issue. Thank you @Jaroch76 for working out what the cause was - this issue was really bugging me. Here's my output_log.txt and CompatibilityReport.txt.

I have the same exception:


KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2<long, Klyte.TransportLinesManager.Extensions.PlatformConfig>.get_Item (long) <0x001a9>
at Klyte.Commons.Utils.NonSequentialList`1<Klyte.TransportLinesManager.Extensions.PlatformConfig>.get_Item (long) <0x0003c>
at Klyte.TransportLinesManager.Cache.InnerBuildingLine.get_LineDataObject () <0x00121>
at Klyte.TransportLinesManager.TLMVehicleOverrides.PreGetColorPassengerLineVehicle (uint16,Vehicle&,InfoManager/InfoMode,UnityEngine.Color&) <0x000be>
at (wrapper dynamic-method) PassengerTrainAI.PassengerTrainAI.GetColor_Patch2 (PassengerTrainAI,uint16,Vehicle&,InfoManager/InfoMode) <0x00075>
at (wrapper dynamic-method) PassengerTrainAI.PassengerTrainAI.GetColor_Patch2 (PassengerTrainAI,uint16,Vehicle&,InfoManager/InfoMode) <0x001a8>
at Vehicle.RenderInstance (RenderManager/CameraInfo,uint16) <0x01316>
at VehicleManager.EndRenderingImpl (RenderManager/CameraInfo) <0x03367>
at SimulationManagerBase`2.EndRendering (RenderManager/CameraInfo) <0x0002a>
at VehicleManager.IRenderableManager.EndRendering (RenderManager/CameraInfo) <0x00024>
at RenderManager.FpsBoosterLateUpdate () <0x00a32>
at BehaviourUpdater.Updater.LateUpdate () <0x00592>

Thanks very much for all your work on this and your other mods. I really love TLM and hope to be able to get it working fully.

PC28K commented 2 years ago

I don't know if it's the same phenomenon as you guys, but when I remove the WTS mesh, it doesn't flickering. In my environment, this happens when a WTS mesh is present in a vehicle returning to the garage. Screenshot 1235 Screenshot 1236

it is assumed that the value of the Next stop, Previous stop is empty, and I think it is an error caused by the WTS trying to render it.

klyte45 commented 2 years ago

Is this issue valid yet? @PC28K WTS is being fully rebuilt and all features will be remade