Pathfinder: It's My Way Or No Way?

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 6526
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Pathfinder: It's My Way Or No Way?

Post by Redirect Left » 01 Jan 2019 01:29

I come across this frequently, where a train can make a specific turn, but the pathfinder is seemingly taking the first one it can find, and ignoring the blatantly obvious clear path a single tile later on.


Orange: The route the train was trying to take, but wasn't able to due to the sticking out train
Green: the route it could have taken to bypass the block.

After I removed the segment of track that it was trying to take on the orange line, it happily went "oh duh!" and took the green route. Is there any way of getting the pathfinder to avoid this?
Untitled.png
(158.87 KiB) Not downloaded yet
Oh, and yes, I know this is really bad junction design. It was made with the signal far enough back the longest train wouldn't stick out and block the entire junction, turns out ti does, because the pathfinder appears to find the first sane route and go "nooope". I have removed the segment of track the orange route was taking, but it'd be nice to not need to remeber to this. Pathfinder selected is YAPF
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!

Eddi
Tycoon
Tycoon
Posts: 7365
Joined: 17 Jan 2007 00:14

Re: Pathfinder: It's My Way Or No Way?

Post by Eddi » 01 Jan 2019 02:19

there are a few pathfinder penalties you can try to tweak, but it might cause problems in other areas.
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 684
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Pathfinder: It's My Way Or No Way?

Post by Gwyd » 01 Jan 2019 08:39

Problems in areas such as multiplayer games, where the difference in penalties can cause de-syncs

Transportman
Tycoon
Tycoon
Posts: 2683
Joined: 22 Feb 2011 18:34

Re: Pathfinder: It's My Way Or No Way?

Post by Transportman » 01 Jan 2019 09:03

It are indeed the pathfinder penalties that ruin the throughput, a single train piece has a lower penalty than the detour+tight corner+additional crossings, so the pathfinder will happily ignore the free path as the occupied path has the lowest path.
Gwyd wrote:Problems in areas such as multiplayer games, where the difference in penalties can cause de-syncs
But in multiplayer the penalties are part of the game, so there is no risk there.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML

Eddi
Tycoon
Tycoon
Posts: 7365
Joined: 17 Jan 2007 00:14

Re: Pathfinder: It's My Way Or No Way?

Post by Eddi » 01 Jan 2019 11:52

Gwyd wrote:Problems in areas such as multiplayer games, where the difference in penalties can cause de-syncs
this is just wrong.
You might not exactly be interested in Ferion, but if you are, have fun :)

Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 3 guests