[patch] Disable train reversing when waiting for too long
Moderator: OpenTTD Developers
[patch] Disable train reversing when waiting for too long
Hi!
I think it is very annoying when a train reverse its direction when it is waiting for too long.
The traffic is already messed and it just increases the chaos. So I made a simple patch
that adds an option to the advanced settings to prevent the trains from doing this.
Yes, I know, it is a very simple and trivial patch, but this is my first contribution.
Cheers!
I think it is very annoying when a train reverse its direction when it is waiting for too long.
The traffic is already messed and it just increases the chaos. So I made a simple patch
that adds an option to the advanced settings to prevent the trains from doing this.
Yes, I know, it is a very simple and trivial patch, but this is my first contribution.
Cheers!
- Attachments
-
- disable_train_reverse.diff
- (4.64 KiB) Downloaded 446 times
Re: [patch] Disable train reversing when waiting for too long
At least a longer time to not reverse trains would come in handy for maglevs (if not this patch
) because any such turn-around on busy networks causes a "Train is lost" message which is very annoying.

NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: [patch] Disable train reversing when waiting for too long
Increasing it would just make it worse. Imagine a scenario where there is a bad trafic jam, you take a while to fix it, when your are
done, lots of trains did the unwanted turn around and will take longer until everyone get to the right direction, unless you manually
turn around each train. It seems that, with the PBS, turning around behaves differently, making it even worse IMHO.
done, lots of trains did the unwanted turn around and will take longer until everyone get to the right direction, unless you manually
turn around each train. It seems that, with the PBS, turning around behaves differently, making it even worse IMHO.
Re: [patch] Disable train reversing when waiting for too long
Currently, when the patch setting "pf.wait_for_pbs_path" is set to 255, automatic train reversal is disabled for trains waiting in front of PBS/path signals. The only problem is when a train is waiting in front of a normal/block signal inside a PBS block. In this case, the train will automatically reverse after pf.wait_oneway_signal/pf.wait_twoway_signal time units (=days?) and will then not move if it cannot reserve a path.rahenri wrote:Increasing it would just make it worse.
So, the best solution to this problem seems to be to allow pf.wait_oneway_signal/pf.wait_twoway_signal to be also increased to 255 (current maximum value is 100) and treat this special value the same way as the patch settings "pf.wait_for_pbs_path" is treated.
EDIT: Or, it may be better to use "pf.wait_for_pbs_path" for all signals inside a PBS block, not just PBS signals. This approach has the advantage that non-PBS blocks will behave the same way as before YAPP was introduced.
Re: [patch] Disable train reversing when waiting for too long
in the meanwhile i am gonna use this patch. thx !
*<(:-}
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] Disable train reversing when waiting for too long
updated and moved the settings to the right place 

For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [patch] Disable train reversing when waiting for too long
This autoreversal is very annoying, especially if it autoreverses on part of track in which it is absolutely impossible to go backwards (like large section of track, where oneway ordinary signals are places each X squares). I think this could be solved by changing the behavior a bit:
* If the train autoreverses, set some special flag.
* If the train meets oneway signal "from the back", it currently stops. If the flag is set, it will clear and instantly turn back. Since the signal is impassable, it does no good waiting at it.
* If the train passes through any signal (or enter station or depot), clear the flag (this means the reversing was at least somewhat successful and train have found some track where to continue)
Or perhaps even simpler and also effective solution - if the train stops at oneway signal from side in which it can't pass, immediately turn back. This may make a bit trouble though, like if you want to use "ignore signals" feature to force train through some one-way track in reverse direction.
This change would still allow train to autoreverse, which could perhaps help as last resort solution with some messy track designs, but if the track design is "clean" (and the wait is because of other reasons, like lack of goods at station, cause of exclusive rights, etc ...) and the reversing won't help anyway, the train will quickly turn back and wait again at proper spot to not make things worse.
Even worse it is on MP servers - you can't fiddle with waiting time parameters there and if it is set wrong ... too bad.
* If the train autoreverses, set some special flag.
* If the train meets oneway signal "from the back", it currently stops. If the flag is set, it will clear and instantly turn back. Since the signal is impassable, it does no good waiting at it.
* If the train passes through any signal (or enter station or depot), clear the flag (this means the reversing was at least somewhat successful and train have found some track where to continue)
Or perhaps even simpler and also effective solution - if the train stops at oneway signal from side in which it can't pass, immediately turn back. This may make a bit trouble though, like if you want to use "ignore signals" feature to force train through some one-way track in reverse direction.
This change would still allow train to autoreverse, which could perhaps help as last resort solution with some messy track designs, but if the track design is "clean" (and the wait is because of other reasons, like lack of goods at station, cause of exclusive rights, etc ...) and the reversing won't help anyway, the train will quickly turn back and wait again at proper spot to not make things worse.
Even worse it is on MP servers - you can't fiddle with waiting time parameters there and if it is set wrong ... too bad.
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] Disable train reversing when waiting for too long
or if you set up a holding station to hold the trains if the station they want to go to is full what would be more of the gameing way to do it with out patchs
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [patch] Disable train reversing when waiting for too long
If you set up some waiting station, you just move the problem elsewhere, not solve it. Train will then reverse in the station and block it instead of reversing on plain track and blocking it :)
Not a good solution.
Not a good solution.
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] Disable train reversing when waiting for too long
or you can set the trains to wait in depots with jump odders so it stays there till it is clear to carry on
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: [patch] Disable train reversing when waiting for too long
Ever checked what setting pf.wait_oneway_signal, pf.wait_twoway_signal or pf.wait_for_pbs_path to 255 does? No need for any new setting, they would just need a GUI-entry.
-- Michael Lutz
-- Michael Lutz
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: [patch] Disable train reversing when waiting for too long
But this is not in the GUI so i did not know we had it
For Community Integrated Version http://code.google.com/p/civopenttd/
Who is online
Users browsing this forum: Baidu [Spider] and 1 guest