CitiesSkylinesMods / TMPE

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

Tourists cannot despawn at two lane road outside connection #273

Open chronofanz opened 5 years ago

chronofanz commented 5 years ago

Temporary Workaround

Install the latest Crazy Tourist Fix mod (thanks chronofanz!) which should resolve the issue

[Unfortunately, I no longer have a viable savegame to aid in repro, but I'll describe the issue plus a possible fix to the base game anyways. Not sure if this is an issue affecting TMPE.]

For custom maps with outside connections that are two-lane roads, tourists who go out through these connections cannot despawn, and they continue (forever) to travel along crazy U-turn routes back to the same connection. I suspect this will eventually cause a decrease in available tourists because the game will exhaust the limit for spawned people, but I'm not sure. The cause of this condition is the fact that, when people arrive at their destination, their position is adjusted by the exit location of their vehicle ...

To repro: Create any custom map with a two lane road or two lane highway as an outside connection. Run the game a while, and you will see tourists who go out of the outside connection being unable to despawn and continuing to do these crazy U-turn routes.

Rough outline of suggested fix attached. Essentially, an override of TouristAI.SetCurrentVehicle and also possibly ResidentAI.SetCurrentVehicle that prevents the citizen from adjusting their target position by leaving a vehicle if they are at an outside connection.

touristaimod.txt

chronofanz commented 5 years ago

Link to associated Steam Thread: https://steamcommunity.com/app/255710/discussions/0/1812044473319307940/

Link to the thread on Paradox Forum: https://forum.paradoxplaza.com/forum/index.php?threads/cities-skylines-steam-tourists-cannot-despawn-at-two-lane-road-outside-connection.1113430/

originalfoo commented 5 years ago

From paradox forum:

Another person has hit this same bug, steam thread here:

https://steamcommunity.com/app/255710/discussions/0/1812044473319307940/

Suggested fix is to override TouristAI.SetCurrentVehicle (and possibly ResidentAI.SetCurrentVehicle) to prevent the citizen from adjusting their target position by leaving a vehicle if they are at an outside connection. (Couple line fix, I believe.)

originalfoo commented 5 years ago

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

FireController1847 commented 5 years ago

@aubergine10 Unsure if we want to re-open this at some point and implement a fix into TM:PE or if we're going to rely on this third-party mod?

EDIT: My apologies, I seem to have misunderstood this issue. We should implement a fix for this as it's definitily in the scope of TM:PE.

chronofanz commented 5 years ago

Please, do not rely on this mod! It's only a proof of concept to confirm that it fixes the issue. I will remove the mod when you fix the issue, thanks.

chronofanz commented 5 years ago

Note, however, that there is a separate but related issue with vehicles spawning at two-lane, two-way roads at outside connections. I've also observed that if the rate of spawning is less than the rate of vehicles trying to spawn, you get a huge queue of vehicles waiting to get spawned. As such, if you implement this fix, it will take a long long time before the crazy U-turn route actually disappears. In my own game, I "fixed" this by temporarily removing the bounding rectangle around each vehicle ... leading to a "tsunami" of vehicles emanating from the outside connection. (I can't remember, but it's the same code path that prevents vehicles from going through an intersection when the next road segment is already occupied.)

originalfoo commented 5 years ago

Latest version of tourist fix mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1759269367