Why are my trains going around in circles?

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
webbhost
Engineer
Engineer
Posts: 7
Joined: 22 Jun 2019 00:12

Why are my trains going around in circles?

Post by webbhost »

So this was working fine until tonight.. and all of a sudden good travelling from Larnington Valley to Trendinghattan woods are going around in circles and getting lost.... I did a little bit of expanding tracks in the middle of the route (junction near renhill) but I cannot see any reason that the trains would be refusing to make the journey.

I tried sending all trains to depot to clear up any clogs and upon releasing them again they are lost again.

Help? Thanks
Attachments
Nay March 2021.sav
(8.29 MiB) Downloaded 21 times
mak
Traffic Manager
Traffic Manager
Posts: 166
Joined: 30 Sep 2015 13:16

Re: Why are my trains going around in circles?

Post by mak »

train jam
Attachments
Fort Trunwell Transport, 2057-03-08.png
(2.9 MiB) Not downloaded yet
User avatar
jfs
Tycoon
Tycoon
Posts: 1339
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Why are my trains going around in circles?

Post by jfs »

Well, because you allow them to.
Your station layout allows trains to wait in unfortunate locations, and doesn't have a clear way in separate from the way out.

I notice you have individual orders for all your trains, instead of using shared orders. Using shared orders makes it much easier to manage your vehicles, and could let you change all of them at once. What I would suggest is also adding a waypoint on the route to Trendinghattan Woods.

Overall, I think your problem is that most of your track is bidirectional instead of unidirectional, and you have crossovers everywhere even places they aren't needed. It confuses the pathfinding.

You should also be careful about having stations shared between loading and unloading trains. You can end up with all the platforms taken up by loading trains, so unloading trains can never get in and unload, and so the loading trains will never get any cargo because the industry can never produce anything without raw material.
Attachments
This train is waiting in an unfortunate position
This train is waiting in an unfortunate position
openttd_2021-05-01_09-42-59.png (101.08 KiB) Viewed 255 times
This is a straight line with one track per direction, you don't need crossovers (they only cause problems)
This is a straight line with one track per direction, you don't need crossovers (they only cause problems)
openttd_2021-05-01_10-21-55.png (130.45 KiB) Viewed 255 times
openttd_2021-05-01_10-23-22.png
Changing the station to a Ro-Ro layout lets the trains pathfind better and avoids sharing tracks for ingoing and outgoing trains
(202.39 KiB) Not downloaded yet
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1655
Joined: 30 Mar 2005 09:43

Re: Why are my trains going around in circles?

Post by peter1138 »

All the 90 degree turns and two-way loops cause the pathfinder to bail out before it can find a path. This is why so many trains are lost.

You can open the console and type `set pf.yapf.max_search_nodes 20000` (double the default maximum), but you'll need to manually fix the trains that are stuck.

Basically, what jfs said :-)
He's like, some kind of OpenTTD developer.
webbhost
Engineer
Engineer
Posts: 7
Joined: 22 Jun 2019 00:12

Re: Why are my trains going around in circles?

Post by webbhost »

set pf.yapf.max_search_nodes 20000 did the trick, thank you :) Is there any reason I can't just set this to 20,000,000? What exactly does it change?
User avatar
jfs
Tycoon
Tycoon
Posts: 1339
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Why are my trains going around in circles?

Post by jfs »

It changes how far the pathfinder will look for a route to the destination. Raising it can cause the game to use more CPU to route trains, meaning potentially much lower framerates.

The best long-term cure is still to simplify your network so trains don't have so many choices all the time. Make dedicated tracks for each direction instead of both-direction tracks, and avoid crossovers on long stretches of tracks. Using waypoints can also help since the trains don't need to pathfind as far at a time.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests