CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
575 stars 85 forks source link

Luke, vehicles are still despawning... #277

Closed originalfoo closed 3 years ago

originalfoo commented 5 years ago

Temporary workarounds

  • This issue is caused by a base-game bug that causes some pedestrian path nodes to "vibrate" between two heights, which in turn causes pathfinder issues.
  • There is a new mod which detects and highlights the bugged paths on the map - subscribe and enable it
  • When you see a problem path, bulldoze it or use Move It mod to tweak it a bit and it will stop vibrating.

Noooooooooooo!

Radieh 22 minutes ago Cars are vanishing after road upgrades and or adding new roads. It was working fine until few days ago, possible after the last upgrade this started to happen.

Tagging #86 and #218

krzychu124 commented 5 years ago

😄 but seriously, I hope this is a joke!

originalfoo commented 5 years ago

Another user just reported same issue:

GucciSnack 55 minutes ago @ aubergine18 exp same issue as @ radieh. I wish this mod was never updated for me at least as it was working perfectly fine before... now i have this huge city and my commercial zones need products, and it took me a while to realize the roads were the issue! GucciSnack 53 minutes ago
@ aubergine18 here's some helpful info that might also have you re-create the issue. Update a road, then you cant map out bus routes, etc. beyond that updated road

I've asked both for save and log file.

kuebel commented 5 years ago

Always did this for me since industry DLC.

Deactivating and reactivating "Lane connector" in TM:PE Maintenance options helps, but you have to do it for every road/road group built.

Lobocimby commented 5 years ago

I've run into the same issue today. As vehicles approach a new/upgraded road they despawn, and public transport lines can't be built on them. Only fixes I've found are saving and restarting the game, or disabling TM:PE.

My save: https://steamcommunity.com/sharedfiles/filedetails/?id=1740610774

output_log.txt

krzychu124 commented 5 years ago

I've checked your save and unfortunately I have to confirm that vehicles despawns after road upgrade. Disabling and reactivating lane connector feature seems to resolve problem with pathfinding through modified segments...

I will check tomorrow what is going on there and why that feature state change helps.

krzychu124 commented 5 years ago

@Lobocimby I think I found what is causing despawn issues. It might be strange, but removing/rebuilding that pavement path should resolve vehicle despawn issue Zrzut ekranu (181)

Now I have to investigate why that particular segment is causing infinite segment update loop.

krzychu124 commented 5 years ago

Another report from Discord channel savegame + backup if deleted

Investigation results:

@VictorPhilipp any thoughts?

[EDIT] I've just noticed that both nodes are placed outside regular 25 tiles (highlighted tile) Zrzut ekranu (187)

[EDIT2] Callstack: invalidNodeCallStack.txt

[EDIT3] Enabled Terrain modifier mods in this savegame: Extra Landscaping Tools Prop Snapping

originalfoo commented 5 years ago

If it's due to "outside 25 tiles" issue....

It would be worth investigating how the game applies terrain modifiers to roads. To see what I mean, sub the "Cross the Line" mod which allows building of networks outside of purchased tiles. You'll note that roads sit on an unmodified mesh, the terrain doesn't confirm like it would inside the purchased tiles.

My train of thought (all untested assumptions):

  1. Game hard-coded not to apply network terrain modifiers outside 25 tile area
  2. Within 25 tile area it first checks if tile is purchased before applying modifiers
  3. 81 Tiles mod would have to modify at least (1) and maybe (2)
  4. Such patch in 81 Tiles mod probably hasn't been updated ever
  5. Some performance tweak made in vanilla game and 81 Tiles overwriting it with older code
  6. Result = Node loops

Possibly it's something lurking here: https://github.com/bloodypenguin/cities-skylines-unlimiter-1/blob/master/Areas/FakeNetManager.cs

originalfoo commented 5 years ago

Just had another user with this issue, asked for save game. He mentioned it was also causing his bus routes to break - so the broken node thing might also cause #244?

megatr0n-69 commented 5 years ago

Hey, I am experiencing this issue and posted in this topic over on steam but here is my save game.

Save game: https://steamcommunity.com/sharedfiles/filedetails/?id=1753348463

Hope this helps you guys.

krzychu124 commented 5 years ago

@megatr0n-69 The same problem as in @Lobocimby I forgor to enable TM:PE when testing your save so I think it's not caused by our mod. More info + screenshot of node to rebuild later

Quick investigation: NetManager.UpdateNode(ushort, ushort, int):

This node has only one segment connected (maybe that's the problem) [EDIT 1] @megatr0n-69 Remove pavement path connected to end of that road segment (little blue marker)

Zrzut ekranu (190) Zrzut ekranu (191)

I found that game, in this case PedestrianPathAI is trying to add two lanes to that pavement node 10926 but those two lanes are already connected to road segment 16258 (clearly visible in debug build - lane preview (L idx 0 + L idx 3 [Pedestrian], nd: value jumping from 0 to 10926))

Sorry for ugly screenshot: nodes

[EDIT 2] I've just noticed that pavement path connected to node 10926 has no lane visible in lane debug... Is there any network segment without lane? I always thought that segment has to have at least one lane (for props or something else).

originalfoo commented 5 years ago

Was it inside the 25 tile area?

krzychu124 commented 5 years ago

Unfortunately, yes (only four tiles bought)😕

krzychu124 commented 5 years ago

Issue seems to be reproducible using Fine Road Anarchy mod. Unfortunately there must be additional variable which triggers it, because not every time this issue occurs.

Affected Path segments:

Note: All of them has only one pedestrian lane

Affected Road segments Network Extension 2:

Note: All of them have two pedestrian lanes

Requirements:

Additional notes:

I've managed to reproduce issue on the new game Savegame

Mods used:

Three intersections - tree two nodes affected by infinite loop Node ID's:

originalfoo commented 5 years ago

To clarify, the issue is occurring purely with anarchy mod (at least Fine Road Anarchy as tested above) by drawing a ped path (or some NExt2 prefabs) route from or too a cul-de-sac node? (ie. Move It mod is not involved anywhere in that process)

Is it possible to reproduce without NExt2 mod installed? Reason I ask is that NExt2 patches a shed load of stuff in the game to make its roads (which at the time of original development couldn't be created any other way) functional -- it could be bug in NExt2?

krzychu124 commented 5 years ago

I'm going to check it out tonight 😉

To clarify, the issue is occurring purely with anarchy mod (at least Fine Road Anarchy as tested above) by drawing a ped path (or some NExt2 prefabs) route from or too a cul-de-sac node? (ie. Move It mod is not involved anywhere in that process)

Yeah, route direction doesn't matter.

I tried connecting ped path to the middle of a segment but it doen't work. When you extend that road from invalid cul-de-sac, issue persist. Only moving or rebuilding/refreshing that invalid node solves the problem (which is odd, BTW)

It seems that something is wrong with those NExt 2 nodes in this case only Tiny but not all. I've tested other wider segments(NExt2 and vanill) but I couldn't reproduce that issue.

Maybe calculation of node height (or height of lane of ped/road segment) has a bug which reveals only when some conditions are met (anarchy enabled, nodes are too close to each other), because PedestrianPathAI.AddLaneConnection() updates node height using height of lane but only when value is different. If height was updated additional call to updateNode() is performed which calls vanilla updateSegment() or TMPE updateSegment() if enabled for each segment connected to that node.

I will check old saves again.

originalfoo commented 5 years ago

If nodes are on top of each other, is it possible that one node updates, causing the other to update, and it just goes round in loop like that - they can't update height because the other node prevents it, but they try anyway?

krzychu124 commented 5 years ago

Nope, I thought about that at first and I guess it's impossible.

In savegame I created you can see two nodes listed, because there we have two pavement paths which the game can't properly setup/update (?not sure what is going on there, to be honest).

Third node was invalid before saving but somehow fixed itself after loading savegame again.

This game is complicated 😅

krzychu124 commented 5 years ago

I was able to reproduce infinite loop using only Move It 😕

It seems that there is a bug in those NExt2 segments listed above. I enabled snapping and follow terrain feature but without that 'terrain' thing seems to be even easier.

Here is a quick demonstration how I made it. Infinite loop test

It looks like something is invalidating connection all the time but game is trying to connect lanes over and over again.

I've checked other vanilla segments and immediately noticed that when I move ped path node close enough to connect to road segment (like on video above), both segments stays connected until they are too far. No re-connection of lanes at all while moving node within connection range

originalfoo commented 5 years ago

@andreharv: Can you think of anything in NExt2 that would cause what's described above?

Semt-x commented 5 years ago

Requested save game on the comment section of the TMPE workshop. Vehicles disappear on a road section, if it is changed (upgraded or a new connection to a road section). until the game is saved an reloaded.

https://steamcommunity.com/sharedfiles/filedetails/?id=1759990551

*Edit: I just read this full thread. It might be useful information that i had trouble with a metro line loop that connects to the airport. the problem was to create a metro line, the tunnels itself were not the problem, but creating the line was. It refused to connect the last segment to complete the line ( and make it a loop). the game did not draw the last part of the metro line, and so i was not able to complete it. Closing the game and reloading it, resolved the issue. it was the only anomaly i can recall.

krzychu124 commented 5 years ago

Removing that pavement path segment under blue marker should solve the problem in this case.

01 02

Node id: 10745 Worth noting:

Semt-x commented 5 years ago

It did fix it indeed! thanks so much. Is there any way to detect and locate this problem myself?

originalfoo commented 5 years ago

369 confirmed as another instance of this issue.

originalfoo commented 5 years ago

Reported to Paradox as per #369

https://forum.paradoxplaza.com/forum/index.php?threads/cities-skylines-steam-vibrating-node-replicable-bug.1187861/

originalfoo commented 5 years ago

There's a thread on Steam with more users reporting this issue.

https://steamcommunity.com/workshop/filedetails/discussion/583429740/1812044473333143083/

I assume there's no benefit asking for more savegames as we can't really do much about it without Paradox/CO input?

originalfoo commented 5 years ago

Confirmed that CO will be investigating this issue. If you have any additional information that might be of use, add it now :)

krzychu124 commented 5 years ago

@aubergine18#8812 NetInfo.m_useFixedHeight : bool what does that variable do? Do you have any idea?

I'm asking about that because I figured out that just after regular node update, the game is calling PedestrianPathAI.AfterTerrainUpdate(). It looks like this method resetting node position (NetManager.MoveNode(ushort, Vector3) to be precise) which has been set earlier at the beginning of NetManeger.SimulationStep() and then marks that node for update. Whole update process of checking and updating nodes and segments has to be performed again in the next simulation step. This process will loop until you remove segment or modify terrain in that place before re-building again.

When I changed that m_useFixedHeight value to true, issue magically disappeared (because inside AfterTerrainUpdate() node height update was skipped). The question is: which feature will be screwed up after that change :smile:

Sorry for late response.

originalfoo commented 5 years ago

At a guess, it might be something to do with "make terrain same height as road", like when you choose the ground mode in Fine Road Tool/Anarchy?

I couldn't find anything from the usual sources, but some other stuff mentioning height in relation to networks:

Build Height When building the road, it will be created higher or lower than the player has chosen based on this value.

Surface Level CO states this is the default height for vehicles and pedestrians, although it seems ingame the individual vertical offset for lanes is used instead.

Water Block Offset Used for canal depth (negative) and flood wall height.

Vertical Offset The height position of the lane.

Use Terrain Height Uses terrain instead of lane vertical offset or surface level. Used for ground pedestrian paths.

krzychu124 commented 5 years ago

Extracted from cslmodding.info m_useFixedHeight True for station tracks and depot roads which are part of buildings, so they don't align to the terrain when such buildings are built on uneven terrain.

originalfoo commented 5 years ago

Ah, so by setting it true on a normal node that's not part of building it's basically saying "You just sit right where you are and don't move"...

krzychu124 commented 5 years ago

It's a property of NetInfo so it applies to AI of network prefab not just node, I think. Nonetheless, I still have no idea how to fix that issue 😕

Eapin commented 5 years ago

Hi - I think I'm experiencing this same issue. I just started playing Cities Skylines (had some 35 hours in game when this happened). I'm playing the base game, pretty sure I don't have any of the DLCs downloaded. The two major mods I think I had added were TM and Network Extensions (then a few more asset-based items from workshop [road and rail interchanges]). Was a solution to this ever discovered?

krzychu124 commented 5 years ago

As you can see, finding a solution is complicated. You can remove problematic beautification paths(pavement/bicycle/gravel) but it's only temporary fix. As @aubergine10 said CO will be investigating issue and I hope they'll fix it.

originalfoo commented 5 years ago

Krzychu has made a new mod that helps detect which paths are bugged and highlight them on the map - for more details see the workshop page below:

https://steamcommunity.com/sharedfiles/filedetails/?id=1777173984

originalfoo commented 5 years ago

Another thread on steam discussing this issue: https://steamcommunity.com/app/255710/discussions/0/1639792569832779992/

originalfoo commented 5 years ago

Another user with the problem - broken nodes detector is not finding the problem though

https://steamcommunity.com/app/255710/discussions/0/2605804632885276642/?tscn=1565816171

EDIT: Asked for savegame

originalfoo commented 5 years ago

@krzychu124 Here's the save game re: comment above: https://steamcommunity.com/sharedfiles/filedetails/?id=1834966040

originalfoo commented 5 years ago

Krzychu tested and Broken Nodes Detector did find a broken path in that save. The user did not have the mod active when the save was made so maybe they forgot to enable it?

Also Krzychu found they were using old broken mod called "Advanced Road Anarchy" which is no longer in workshop. I've suggested they unsubscribe/delete it via Content Manager > Mods.

krzychu124 commented 3 years ago

Temporal solution proved its value. Closing for now.