joaofarias / csl-traffic

A WIP mod for Cities: Skylines to improve traffic.
91 stars 30 forks source link

System.NullReferenceException: Object reference not set to an instance of an object #20

Open originalfoo opened 9 years ago

originalfoo commented 9 years ago

Object reference not set to an instance of an object [System.NullReferenceException]

Details: No details System.NullReferenceException: Object reference not set to an instance of an object at CSL_Traffic.CustomPathFind.GetLaneDirection (Position pathPos, .Direction& direction, .LaneType& type) [0x00000] in :0 at CSL_Traffic.CustomPathFind.PathFindImplementation (UInt32 unit, .PathUnit& data) [0x00000] in :0 at CSL_Traffic.CustomPathFind.PathFindThread () [0x00000] in :0

More infos: http://www.reddit.com/r/CitiesSkylines/comments/36i9dg/hotfix_traffic_for_cs_110_patch/crfnx2r?context=3

originalfoo commented 9 years ago

from quantumcanuk via /r/CitiesSkylines/ sent 20 minutes ago

I'm having an issue with vehicles randomly stopping in the middle of the road and not moving. If I disable the road customizer, the issue is fixed, which is a shame because that's the feature I wanted most from Traffic++.

I installed another mod which I can use to manually delete the traffic that's being blocked, but it seems to happen regularly in certain spots, generally where straight road segments meet. If I delete the road and recreate it, the issue seems to go away, but there's no way I can do that with EVERY road.

What eventually ended up happening is my garbage backed up and people started to die, now most of my map has dead people waiting for transport, which is causing buildings to become abandoned. I can't find anybody else who has this issue, so maybe I just need to start a new map from scratch with the mod installed.

Edit: Oh, and I can't save the game properly, it sits forever on "Saving...", and I cannot exit the game, I have to Force Quit.

joaofarias commented 9 years ago

This is a known bug that I haven't been able to track yet. It seems to be happening to a very small amount of people. I see that you asked him to report it in the feedback discussion. When he does, I'll add him to see if he can run some tests for me so that I can track this issue.

originalfoo commented 9 years ago

The user that recently uploaded a savegame to the feedback topic was also apparently having a similar error (although not sure if it's related to the save game uploaded).

originalfoo commented 9 years ago

Another user getting stopped vehicles - turning off "Realistic Speeds" didn't solve it:

https://www.reddit.com/r/CitiesSkylines/comments/37upz4/scooterexe_has_crashed/

originalfoo commented 9 years ago

I've not seen this error since the update that sorted out the vehicle AI stuff. Will leave open until after weekend and then close if no further comment.

originalfoo commented 9 years ago

This issue is also affecting people who've never used T++ and even people who don't use any mods. Seems the game is not properly handling removed assets (whether unsubscribed by user, or removed via Steam workshop due to copyright infringement etc).

Only fix I can think of would be do check objects passed in to pathfinder, AI, etc to see if they are null or something?

Recent versions of Advanced Vehicle Options mod have implemented a check and auto-fix for such objects so maybe code from that could be adapted for T++ use? https://github.com/SamsamTS/CS-AdvancedVehicleOptions

originalfoo commented 9 years ago

Not sure if this has any relation to the error - specifically overriding the LoadingExtensionBase

https://www.reddit.com/r/CitiesSkylinesModding/comments/3bttb9/111b_nullreferenceexception_how_to_load_mod_after/