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: 7240
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Pathfinder: It's My Way Or No Way?

Post by Redirect Left »

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
Untitled.png (158.87 KiB) Viewed 132 times
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
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

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

Post by Eddi »

there are a few pathfinder penalties you can try to tweak, but it might cause problems in other areas.
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

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

Post by Gwyd »

Problems in areas such as multiplayer games, where the difference in penalties can cause de-syncs
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

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

Post by Transportman »

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: 8258
Joined: 17 Jan 2007 00:14

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

Post by Eddi »

Gwyd wrote:Problems in areas such as multiplayer games, where the difference in penalties can cause de-syncs
this is just wrong.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 4 guests