[patch] Disable train reversing when waiting for too long

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
rahenri
Engineer
Engineer
Posts: 5
Joined: 08 Oct 2008 16:29

[patch] Disable train reversing when waiting for too long

Post by rahenri »

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!
Attachments
disable_train_reverse.diff
(4.64 KiB) Downloaded 446 times
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: [patch] Disable train reversing when waiting for too long

Post by SirkoZ »

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.
rahenri
Engineer
Engineer
Posts: 5
Joined: 08 Oct 2008 16:29

Re: [patch] Disable train reversing when waiting for too long

Post by rahenri »

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.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: [patch] Disable train reversing when waiting for too long

Post by Tekky »

rahenri wrote:Increasing it would just make it worse.
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.

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.
User avatar
flake
Engineer
Engineer
Posts: 66
Joined: 28 Apr 2004 10:07
Location: Salzburg
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by flake »

in the meanwhile i am gonna use this patch. thx !
*<(:-}
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by 2007Alain2007 »

updated and moved the settings to the right place :)
disable_train_reverse R16183.diff
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [patch] Disable train reversing when waiting for too long

Post by Bilbo »

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 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)
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by 2007Alain2007 »

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/
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: [patch] Disable train reversing when waiting for too long

Post by Bilbo »

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.
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)
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by 2007Alain2007 »

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/
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by Michi_cc »

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
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: [patch] Disable train reversing when waiting for too long

Post by 2007Alain2007 »

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/
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests