Cities: Skylines

Cities: Skylines

204 ratings
Adjust Pathfinding [BETA]
 
Rate  
Favorite
Favorited
Unfavorite
Mod
File Size
Posted
Updated
0.303 MB
Aug 9 @ 5:10am
Aug 19 @ 3:10am
3 Change Notes ( view )

Subscribe to download
Adjust Pathfinding [BETA]

Subscribed
Unsubscribe
Description
Warnining! Advanced/experimental!

Please report any bugs or odd behavior!

This mod allows you to change behavior of in-game traffic. You can make vehicles avoid specified segments and redistribute them better across the city. Are the pesky drivers using a local shortcut instead of going along the highway? Make the shortcut appear a little bit longer to the pathfinding algorithm so that only local traffic will use it.

Are the cargo ships using only a single port? Make them use both!

How do I use this?

When in game, press CTRL+P (default shortcut) or navigate to roads menu and click the Adjust Pathfinding Mod icon. (Currently there is a bug that the icon is missing sometimes, but the shortcut should always work.) Then you can select a segment and change its parameters.

Factor - adjusts the length of the segment as will appear to the pathfinder. If the value is 100, the segment will appear 100x longer then it is, thus traffic will probably avoid it. Works with numbers between 0 and 1 too.

Event probability - sets how large proportion of the traffic will obey the custom factor rule. This is useful for example when you want the traffic to use two cargo terminals instead of one.
Warning! Event probability of 0.7 means that about half of the traffic will obey the rule. The higher the number is, the larger the proportion will be. Sorry, I figured out this figure experimentally and if I had big enough data sample I would build the interface so that 0.5 means half of the traffic, but whatever...

Active - You can temporarily turn off the regulation.

It takes some time before the traffic starts obeying new rules.

Save your game regularly!
My game crashed once when testing this and I didn't find the cause. It is possible that it wasn't even caused by this mod. Keep in mind that I can't prevent everything.

This mod is compatible with Traffic Manager.

This mod is can be safely removed at any time.

Are "not enough goods" warnings appearing everywhere in your city? It may be cause by low capacity of outside connections. Check out Configure Outside Connections' Limits mod.

Source code & credits

This mod uses Harmony[github.com] for patching.

Detour icon[thenounproject.com] by Pierre-Luc Auclair from the Noun Project.

Source code[github.com]
< >
43 Comments
mully1011 Aug 27 @ 7:38pm 
Love the idea of this mod! very interested to see how it grows.
Strad  [author] Aug 20 @ 11:19am 
This seems to be ok. Sorry, now I can't help you much. I will see if there is something in the source code
Gucci Aug 19 @ 9:32pm 
Adjust Pathfinding mod by Strad [0.3.0]
Detour icon by Pierre-Luc Auclair from the Noun Project
Source code available on Github
https://github.com/Strdate/AdjustPathfinding
Traffic Manager detected
Workshop ID: 583429740
Local: 583429740
TMPE version: 10.20
Load save data: 0.2.0
Strad  [author] Aug 19 @ 12:15pm 
It would be possible to make the selection on lane basis, but it would require a much significant change to the game code. But I keep that in mind and it is something I would like to eventually implement
Avder Aug 19 @ 9:46am 
Can this work on a per-lane basis? For example: I use traffic sponges in front of cargo train terminals to allow more to queue up before they start blocking traffic. Typically I use a multi-lane road, such as a 2+2, for all but the last segment which just has one lane in and out. I'd like it if there could be a way to make it so half of the traffic sees the left lane as shorter and half of it sees the right lane as shorter.

I can somewhat do this using speed limits in TMPE by giving the less used lane a higher speed limit for a segment or two, but it's very hit or miss and eventually almost all traffic will move to that lane and I'll have to do more speed limit roulette.
Strad  [author] Aug 19 @ 3:13am 
@Gucci It probably doesn't work at all.
If you can, please load the map, go to options -> Adjust Pathfinding -> click Acknowledgements & Developer Info and copy the content here.
Gucci Aug 18 @ 9:44pm 
2nd screenshot:

Tweaked road segment
Gucci Aug 18 @ 9:38pm 
@Strad

I use TM:PE 10.20 and yes have made sure I saved the settings. Tried (b) but it didn't work. I'm going to test a few others i can think of and your next suggestion. But if you/anyone following can think of any or spot something let me know.

Screenshots:
General area preview

Attempt 1: Tweaked road segment and values

TM:PE 10.20 tweaked road speed




Strad  [author] Aug 18 @ 3:42am 
@Gucci
#2 will not work. But it is strange that you didn't see (at least some) effects of the #1, #3, #4
a) Do you use Traffic Manager? Which version?
b) First I would suggest trying sending all the traffic to the second cargo station (don't tick the probability box)
c) Don't forget to save the settings as sometimes people forget to do it
d) Do you have a screenshot from above of the area?

Otherwise the #1 is the right way to do it. (#4 could work too, but I didn't try it)
If you see no effects at all it isn't probably because of incorrect settings but because the mod doesn't work at all. Try testing it somewhere where the effect would be obvious.
Gucci Aug 18 @ 3:02am 
Tried this in the game and it didn't work for me. Hopefully someone who's had success with adjusting train pathfinding can point out where I missed.

I have a large general industry area which all other raw Ind. send their cargo to, so I have a train jam on my internal line. I want to use this mod to distribute the incoming cargo trains evenly between 2 stations. The stations are back to back with the rail forked to run through both of them.

My attempts:
#1: Tweaked closer train's outgoing road at 100 value and 0.7 probability. Clear traffic.
#2: Tweaked farther train's outgoing road at 0.5 value and 0.7 probability. Clear traffic.
#3: Tweaked all the road segments of the closer train roads at 100 value and 0.7 probability. Clear traffic.
#4: Tweaked closer train track at 100 value and 0.7 probability. Clear traffic.

Non of them worked. Rails are connected. Have seen trains leave both platform. But imports still prefer the first train. Help thanks!