Transport Fever 2

Transport Fever 2

LineManager
223 Comments
CARTOK  [author] Aug 20, 2023 @ 12:31am 
Congestion control will take care of that, it will however not fix the problem for you. However, feel free to amend the 'rules.lua' file to add additional parameters and the processing thereof. For instance, see line 30 in 'rules.lua', you can add an optional additional parameter named, say, 'max_vehicles' (check adjacent rules for guidance), and then simply add a check in the 'function rules.moreVehicleConditions(line_data_single)' function under 'if rule == "P" then'. You need to fetch the parameter first, then do a simple 'if line_vehicles > max_vehicles then return false'. Note that you'll have to add two parameters to the line name in this case e.g. [P:0:25] where the first parameter corresponds to the aggressiveness level of adding vehicles (0 is the default), and the second parameter corresponds to the new parameter 'max_vehicles' you just created, in this case maximum 25 vehicles. Let me know how it goes.
Quad Tentacle Aug 16, 2023 @ 1:23pm 
Please add abilty to set maximal amount of vehicles on line. If something block movement (ex. traffic) of vehicles, LM will spawn infinite amount of them.
CARTOK  [author] Aug 13, 2023 @ 5:37am 
To follow-up: Please check what the console is showing, and send a copy (past it into a comment).
CARTOK  [author] Aug 12, 2023 @ 5:18am 
No, no dependency. Create some lines and add at least one vehicle per line. If there is at least some demand, it will work over time. When you say that nothing happens, I have a feeling that you expected it to immediately start adding vehicles - this is not how it works. The mod assesses supply vs demand over time and gradually add/removes vehicles.
mr. faster Aug 11, 2023 @ 10:59pm 
Is there any dependecy for the mod to work?
at first i thought it conflicts with another mod - created a new game, only added this mod - still nothing happens.
galaxy055 Aug 9, 2023 @ 11:15am 
@CARTOK I use timetables mainly to unbunch traffic on certain lines, as to not have a whole line of vehicles and then a long time nothing.
Anyway I've checked the console (forgot all about that), and saw that I set the rate to high. Above the maximum allowed rate, I didn't even know that there was a max.
I struggle understanding how rates actually work, so I set some very high to provoke more vehicles, which obviously didn't work.
CARTOK  [author] Aug 9, 2023 @ 9:41am 
@galaxy055 I don't use the timetable mod, so can't tell. Try removing and running without it. As the timetable mod directly interacts with vehicles, it's not unlikely that unpredictable things can occur - even more so as the vehicle timetabling disturbs/disrupts the vehicle/line load numbers.

Come to think of it, I'm not sure why you would run the mods at the same time, as the timetable mod is more targeted towards 'simulating realistic traffic patterns' (I think?), whereas LineManager strictly only optimizes vehicle numbers. Maybe it will work by using timetables for trains only i.e. disable automatic management of (passenger) trains, and let everything else be managed automatically?

Either way, LineManager should work with most mods due to the design - it's essentially only undertaking the same actions as the user would, albeit with a bit of processing and analysis in the background to determine the right action i.e., add or remove vehicles as required.
galaxy055 Aug 9, 2023 @ 7:40am 
@CARTOK Thanks for the info. I was wondering because it seems that lately LM isn't working properly. Could it be because of the timetable mod?
CARTOK  [author] Aug 9, 2023 @ 7:26am 
@galaxy055 LineManager will automatically locate any available depot. LineManager will reassess the used depot for every line over time as well, so the depot used can change. In summary: LineManager will use any available depot that will allow a vehicle to join a line. If a previously used depot has been removed, or connectivity has changed, then a new depot (as close as possible) to the existing line will be located. Sometimes, depending on the exact network, a seemingly less than ideal depot may be used temporarily - this will normally correct itself over time.

Having said that, to make things work as good as possible, make sure to place depots so they are indeed accessible to/from all directions - this is extra important for train depots as they need to follow tracks (unlike buses/trucks/ships/aircraft that can route relatively freely).

You will get repeated warning messages in the console if LineManager is unable to locate a depot for new vehicles.
galaxy055 Aug 9, 2023 @ 6:58am 
@CARTOK
Does a depot have to be in direct connection to a line or can I place it anywhere? For example does the line manager use one road depot in a city or do I need to place one where a line passes?
CARTOK  [author] Jul 2, 2023 @ 3:15am 
At face value; Check whether your lines are appropriate, seems like you have partial overload on one segment, should the line be divided into two separate lines? (I.e. one line that manages a section with much higher demand, and another line that handles a section with less demand).

Beyond that, you can try to manually set rule "[P:1]" for the line (this is a bit of an experimental feature that puts more emphasis on the number of waiting people on any given station rather than the overall usage of the line).

Or, you can set the desired rate along with a tolerable maximum station overload, like this: "[R:100:200]" - This set the line to achieve a rate of 100, and if the load at any station exceeds 200% of the average passenger capacity of the vehicles on the line, additional vehicles will be added. You could try different values for the base rate as you deem appropriate, depending on the demand.
Tapotupotu Jul 2, 2023 @ 12:43am 
I need help please. If I use this mod buses and trams are bought and sold. But at some stations are waiting more passengers as the capacity of a vehicle is. I use the standard rules. What should I change therefore the waiting passengers on a station are maximal the capacity of a vehicle on the line.
CARTOK  [author] May 27, 2023 @ 3:28am 
You need to enable the in-game console to see output from the game itself as well as any mods. Check here: https://www.transportfever2.com/wiki/doku.php?id=modding:ingametools#console
080james May 25, 2023 @ 8:54pm 
Also, I don't understand why, I can't see clear words under "Show Debugging Information", I can see partial words only, Can you show me the whole screenshot of the setting window ?
My Win10 Setting for screen is 1920X1680
080james May 25, 2023 @ 2:49am 
Yes, followed, but in my point of view , it is still not easy for me to fully understand, maybe more photos will help.

I already enable it and running, but I don't know where to see the second screenshot in workshop, https://steamcommunity.com/workshop/filedetails/?id=2581894757
CARTOK  [author] May 24, 2023 @ 9:41am 
There's a link to the manual and instructions in the description, not sure what else to say.
080james May 23, 2023 @ 7:42pm 
I feel it is not easy to understand how things are going, I installed this mod, and start my saved game, all I know is there is a "LM" in my bar. then ? where to set a specific line not auto ?
CARTOK  [author] May 1, 2023 @ 11:18am 
v1.38 is live, with improved vehicle addition (and depot finding logic) that should hopefully help and make things work better in "Insufficient cash" situations. Note: Depot finding process itself is unchanged, and depends on in-game functionality to send a vehicle to a depot (unfortunately also emptying the vehicle - albeit the number of times this occurs should be greatly reduce in specific scenarios with this update). I'm still looking for guidance on how to find a depot without having to send an existing vehicle to a depot...
CARTOK  [author] Apr 30, 2023 @ 10:39am 
I can imagine... :-) Good to know that x1/4 seems to work alright, thanks!
Damgam Apr 30, 2023 @ 9:39am 
It works more than fine on low capacity scenarios like buses or trucks, so i'll assume that x1/4 is working allright.
Damgam Apr 30, 2023 @ 9:38am 
Yeah i turned all automatic management off and then specify it on lines where i want it...
Which is why everything went a bit chaotic when it got all enabled again. :D
CARTOK  [author] Apr 30, 2023 @ 9:10am 
For sure, that's a typical scenario where automatic line management may not be suitable - the optimal balance might be somewhere between current capacity and what the addition/removal of another vehicle will provide (and this can be a significant difference in case of large trains).

In those instances there are some options to consider: either manage manually (disable automatic TRAIN management or assign [M] to the specific line), make use of rate-rule [R:xxx] instead as it will likely be a bit more consistent, or use smaller trains (if a feasible option) that are easier to optimize/balance against the demand automatically.

It seems you are well aware of this, and opted to manage manually.

Let me know if you notice any specific issues related to using x1/4 date speed. It is not specifically tested. It could work fine, but I'm not sure.
Damgam Apr 30, 2023 @ 1:13am 
So far it feels like it's overcrowding my rail lines. But i'm playing on x1/4 date. I find your mod to work really well with bus and truck lines, but trains, transporting a lot with one train, make a huge difference when you add or remove one. And also i don't like my trains to randomly disappear, So i'd rather control them manually.
CARTOK  [author] Apr 29, 2023 @ 8:53pm 
No worries. Unless you had a very specific line/vehicle setup (timetables or similar), I'd be curious to hear how line vehicles were optimized? I've loaded up my own pre-LineManager games at times, and the optimization can be quite intriguing to follow.
Damgam Apr 29, 2023 @ 10:18am 
I don't remember it popping up as it did the first time after installing the mod (or starting new map), but sure, maybe i did miss it on autopilot. :)
CARTOK  [author] Apr 29, 2023 @ 9:53am 
@Damgam: You must have missed this part in the information window that came up advising you that the data format has been updated; "The game has been paused to allow you time to review settings and changes. Un-pause the game when you are ready to continue."
CARTOK  [author] Apr 29, 2023 @ 9:46am 
@tavin44 Check the console window.
Damgam Apr 29, 2023 @ 2:28am 
The update just re-enabled all management without telling me it did so. All my rail lines are now messed up in terms of number of trains... nice.
tavin44 Apr 28, 2023 @ 2:05pm 
Im trying this mod out and in 3 games..i set up a 2 track rail for industry..example Logs to Planks to Tools..i start out at logs ..it grabs logs and halfway to planks it turns around dumps the logs and restarts run..it does this everytime it works fine on trucks and boats.
CARTOK  [author] Apr 26, 2023 @ 10:31am 
v1.37 just promulgated, adding congestion control.
CARTOK  [author] Apr 22, 2023 @ 11:27am 
Small update: I've made good progress on a "congestion control" system that will inhibit vehicle addition when congestion is detected. And even remove vehicles in case of extreme congestion. This seems to work quite well in testing. It will be "Congestion control" setting that is enabled by default. For most situations, you wouldn't notice it. As always, the console will give you a good idea what's going on and it's always a good idea to keep an eye there every now and then.
CARTOK  [author] Apr 16, 2023 @ 10:52pm 
Thanks, I guess that could be possible. The downside is the possible addition of a parameter that would no be backwards compatible if a future solution to the gridlock issue is developed. Let me give it some thought. Appreciate your constructive input!
Loric76 Apr 16, 2023 @ 4:58pm 
Thanks Cartok, I'm doing exactly that.

Not sure if this would be possible, but something to consider at least for a future version: Could we configure per line vehicle limits, via the square bracket commands in the line names? That would help address this issue.
CARTOK  [author] Apr 16, 2023 @ 8:56am 
That is very possible to happen, in particular if the traffic flow isn't sufficient. There's no getting around fixing traffic flow to ensure it meets demand. For instance, if you've asked for a specific rate to be met, it'll add vehicles (albeit slowly, as a mitigation) to meet the rate. If however the vehicle travel time is exaggerated due to traffic congestion, more vehicles are needed to achieve the requested rate - and so, you got yourself a spiral. I assume you could (relatively) easily remedy this by fixing traffic flows, re-organizing lines, or logistics network?
Loric76 Apr 16, 2023 @ 8:47am 
Anyone else running into a situation where Line Manager starts to spin out of control?

As demand increases it adds vehicles accordingly, that works great. Eventually it hits capacity of the source/factory, or the infrastructure (road/rail network, stations), and doesn't stop adding vehicles since it hasn't hit it's target rate yet, and eventually creates gridlock.
TNM_Gaming_UK Mar 24, 2023 @ 12:34pm 
Ah right well at least i know what the issue is now, thanks for getting back to me!
CARTOK  [author] Mar 24, 2023 @ 10:20am 
[LineManager][11:35:31][WARN] Unable to add vehicle to line 'Bricks to Bodmin' - Either no available depot, or not possible to find a depot on this update.
CARTOK  [author] Mar 24, 2023 @ 10:19am 
Ok, thanks for that. It seems that the trains turning around is due to the mod unable to find a depot. Check that you actually have a readily accessible depot on the line, add extra if you have to. The same would be true for ships - check that you actually have active depots available. The reversing is due to an attempt to find a depot using the native depot-finding function within Transport Fever 2, but it seems to fail for some reason. I'm not seeing any issue with this functionality of any of my different games (from small to large), so maybe it's a specific set up that you have. Is a depot perhaps behind a one-way traffic signal, or an odd railroad layout, and thus inaccessible?
TNM_Gaming_UK Mar 24, 2023 @ 4:37am 
TNM_Gaming_UK Mar 24, 2023 @ 4:27am 
tbh it does it with cargo ships as well i've noticed so its probably a conflict with another mod, i have got over 700 of them installed after all! Just found it strange that its never been an issue before until the latest game update!
CARTOK  [author] Mar 24, 2023 @ 2:04am 
Need a log for this. Specifically, if a trained is reversed by LineManager, it will be indicated in the log. Also, check what other mods you have installed.
TNM_Gaming_UK Mar 23, 2023 @ 7:08am 
Been using this mod for a long long time now and it's fantastic, only issue I have in the recent game update it seems the rail manager is broke, gets a short distance down the track and reverses back to station even with reverse disabled in the menu
CARTOK  [author] Mar 12, 2023 @ 3:03am 
Ok, then remove all mods and run with LineManager alone. I'm going to hazard guess you're having a problem with a different mod.
Ziktofel Mar 12, 2023 @ 1:41am 
I've started a new game, I'm using a lot of vehicle and station mods with Senseless Industries
CARTOK  [author] Mar 11, 2023 @ 10:45pm 
Is this an old or new game? Latest updated? What other mods are you using?
Ziktofel Mar 11, 2023 @ 9:54am 
I've got this (after clicking the Line Manager menu):

[LineManager][11:56:32][INFO] ============ Sampling ============
[LineManager][11:56:33][INFO] ============ Updating ============
[LineManager][11:56:33][WARN] Unable to add vehicle to line '[C] Logs Fort Wayne <-> Newport' - Insufficient cash?
[LineManager][11:56:33][WARN] Unable to add vehicle to line '[C] Logs Charlotte <-> Fort Wayne' - Insufficient cash?
[LineManager][11:56:33][INFO] ==> SUMMARY: 3 lines and 3 vehicles managed (0 lines not managed)
../../train_fever/src/Lib/UI/Component.cpp:1680: void UI::CComponent::HandleVisibilityChange(int, UI::Visibility, UI::Visibility, bool): Assertion `!m_childMutex' failed.
PANIC: unprotected error in call to Lua API (stack index 1, expected string, received boolean)
iProfessore Mar 8, 2023 @ 4:13am 
Kept causing my game to crash and freeze, removed it
CARTOK  [author] Feb 28, 2023 @ 9:02am 
Please include the console output (or at least applicable extracts) for any queries. Impossible to help without that. A copy of the <savegame name>.sav.lua file will also help.
Damgam Feb 27, 2023 @ 12:07am 
While for cars/trams this mod seems to do the job, i just went ultra bankrupt when i enabled it for trains on my current save, xD
Cool mod though, i'll definitely keep using it for cars.
Stay on target, Porkins! Feb 26, 2023 @ 5:53pm 
Not to sound like a dumb mofo, but now the line manager window works I can't seem to get it to take any effect. It says it's enabled for all transport types. All my lines are fine with a depot connected to them and even after the monthly stutter or pause I see no vehicles being added or taken away from the lines.