Why do trains pick the wrong path

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Why do trains pick the wrong path

Post by Stu_Learmonth »

I'm still new to this, but perhaps someone can help me out?

I'm wondering why trains pick the wrong path to reach their destination? In the picture below, trains travelling from the top left and heading over the bridge in the bottom right, often (but not always) refuse to take the branch highlighted with an arrow.
Instead they travel way, way past until they find a turning point then come back the other direction. Does anyone know why this might happen?

Image

This is Owen Rudge's Orkney Islands scenario.
accipiter2000
Traffic Manager
Traffic Manager
Posts: 181
Joined: 19 May 2006 08:23

Re: Why do trains pick the wrong path

Post by accipiter2000 »

It may not for AI to find the right way all the time.
You can put a way point on the branch, and add the command to the train to pass by it.
My most satisfying game session.
viewtopic.php?p=1267789
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: Why do trains pick the wrong path

Post by Sylf »

Signals look ok to me (but not 100% sure). Not all rail pieces may be electrified. Maybe one of the tunnels, or the diagonal rail in front of the bridge is missing the electric rail. If it's the missing wire, it's probably easiest to do a blanket conversion of rail to e-rail of that whole region.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Why do trains pick the wrong path

Post by Transportman »

And if you force trains to take that branch by removing the alternative? Do they get lost, report that they cannot find a path? Or is there a train using that main route when another train takes the wrong path?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Re: Why do trains pick the wrong path

Post by Stu_Learmonth »

I'll upload a save once I'm home.

I'm fairly sure that all the track is electrified as occasionally trains will take this path. I've not used waypoints before, so I'll explore that tonight.

It may well be that another train was taking that branch when others get lost...

Thanks guys, lots to think of there

Sent from my HTC One_M8 using Tapatalk
User avatar
Protoford
Engineer
Engineer
Posts: 10
Joined: 06 Feb 2014 15:55
Location: LA.CA.NA.Earth.Sol

Re: Why do trains pick the wrong path

Post by Protoford »

Looks like no signal of any kind on the branch you want them to take.
Might want to put one at least right before the bridge, that might make it a more tempting choice.
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Re: Why do trains pick the wrong path

Post by Stu_Learmonth »

There are 2; one after each tunnel, but I will try add another closer to the split.

Perhaps I should redesign this junction in any case?

Sent from my HTC One_M8 using Tapatalk
Jimbow
Traffic Manager
Traffic Manager
Posts: 243
Joined: 29 Sep 2006 07:28
Location: Copenhagen, Denmark

Re: Why do trains pick the wrong path

Post by Jimbow »

I think the problem can be solved by putting a signal in front of your junction.

Now it seems that you have quite a long block before the junction, and if two trains are right behind each other, the first train will block the shorter route, and the second train may chose the longer route.
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Re: Why do trains pick the wrong path

Post by Stu_Learmonth »

Sorry, I promised a save game and then didn't upload.

Save attached
Attachments
Hamilton & Co., 6th Oct 1965.sav
(63.61 KiB) Downloaded 90 times
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Why do trains pick the wrong path

Post by Transportman »

The problem seems to be that the unblocked detour has a lower penalty than the direct but blocked route. Unless you modified the values for the pathfinder penalties, I do find it quite a long detour.

You can modify the pathfinder penalties to reduce the penalty of blocked tracks or increase that of distance needed to travel, but that might have unwanted results on other places. For this case you could also disallow 90 degree turns for trains, as the detour than is no longer possible.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Re: Why do trains pick the wrong path

Post by Stu_Learmonth »

I've no idea about penalties, but I like the 90 degree idea - thank you!

I really appreciate you taking the time to look. Any other tips while we're at it?
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Why do trains pick the wrong path

Post by Transportman »

Stu_Learmonth wrote:I've no idea about penalties, but I like the 90 degree idea - thank you!

I really appreciate you taking the time to look. Any other tips while we're at it?
3 tips:
I saw some bridges with lower speed limits than your train, so maybe you can upgrade some. Those bridges are also quite long, making them bottlenecks, although the traffic is not that intense that it really matters.
You use the original acceleration model, which really slows down trains going uphill. You should either reduce those, or switch acceleration model, but that would slow down trains through tight corners.
Signal placement can use some improvements at some places. If you take the location from your original screenshot, trains coming from the NE going to the SE onto the bridges that cannot pass the signal because the bridge is blocked, might still block the trains coming from the NE going to the NW (towards your drawn arrow). If you move that signal closer to the bridges, trains completely clear the split, allowing trains from the NE to the NW to continue.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
Stu_Learmonth
Engineer
Engineer
Posts: 7
Joined: 23 Feb 2016 22:16

Re: Why do trains pick the wrong path

Post by Stu_Learmonth »

Thank you. I see your point about the signal close to the bridge - I'll move it further down the line.

I may look at the long bridges. I had thought about raising land in the middle of the sea to reduce length and gain the faster bridges, though would that happen in real life? I'm not sure.

Will have a Google of the acceleration model and a read up.

Thanks again for your input, most kind.

Stu

Sent from my HTC One_M8 using Tapatalk
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Google [Bot] and 19 guests