Adjust Pathfinding

If you liked this item, please rate it up on Steam Workshop page.

Author: Strad

Last revision: 22 Feb, 2020 at 20:06 UTC (1)

File size: 311.3 KB

On Steam Workshop

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]

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.