Could somebody explain, why those two trains are stuck?
If I got right the signals manual, then train at left should reserve top path, whilst train at right should wait until former will take top path and then go.
Moderator: OpenTTD Developers
Would it help to place the "exit signal" on the detour track in the bottom right corner further towards the middle of the "siding"? Or, to put the question another way: How far is the pathfinder "looking forward" - only until the next signal in the direction of travel or beyond that?Eddi wrote: 09 Jun 2021 22:28 the problem is this: there is a pathfinder penalty for occupied tracks, which should prevent this situation and let the train pick the detour over the other track.
however, this is counted per occupied tile, so a 1-tile train is too short to counterbalance the extra turns and distances of the longer track.
so the solution is to either use longer trains, or increase the pathfinder penalty for path reservations
It would still be theoretically possible to get a deadlock with one train in each track of the loop and one train waiting at each entrance, i. e. 4 trains in total. Or am I overlooking something here?jfs wrote: 10 Jun 2021 07:15 (Note that if you make the passing loops directional, then the white signal becomes a safe stopping position, and you can keep it.)
I agree with that, but in this case it doesn't fix the problem. Even if you remove these signals, the trains will be stuck, which seems to have no any sensible reason.jfs wrote: 10 Jun 2021 07:15 You should not have a signal where the white train is stopped. It's an unsafe stopping position, because it can cause a deadlock when trains are stopped there.
The problem is that you're making passing loops with two-way tracks. Make the passing loops strictly directional, don't allow trains to run in two directions on a length of track inside the loop.
The underlying assumption behind the pathfinder penalties is that a blocked path will eventually stop being blocked. Thus, if there is one route that is blocked, and one route that is free but is significantly longer, the train will wait for the blocked path to become free, rather than going from London to Glasgow via Moscow and Cape Town because that route just happens to be free.kaomoneus wrote: 12 Jun 2021 18:11 ...And yet. I still don't get stuff with penalties. It seems that penalties make sense when you have *several* alternatives. But should you calculate penalties when all routes but one are occupied?
Would it be possible for a modified pathfinder to consider every couple of "game cycles" (maybe best in slightly randomized intervals) to send a train on a somewhat longer route?Taschi wrote: 12 Jun 2021 18:51The underlying assumption behind the pathfinder penalties is that a blocked path will eventually stop being blocked. Thus, if there is one route that is blocked, and one route that is free but is significantly longer, the train will wait for the blocked path to become free, rather than going from London to Glasgow via Moscow and Cape Town because that route just happens to be free.kaomoneus wrote: 12 Jun 2021 18:11 ...And yet. I still don't get stuff with penalties. It seems that penalties make sense when you have *several* alternatives. But should you calculate penalties when all routes but one are occupied?
In your case, there is a deadlock, so the assumption that the blocked path will eventually stop being blocked is wrong and the matchmaker ends up making a wrong call.
That is neither an answer to the question asked by ebla71 in the post directly above yours, nor is it the most sensible option for their original problem.
Something like that would probably be possible, but outside of very specific problems like yours it really wouldn't be helpful. Once you've gotten the hang of designing intersections, stations and loops (which you will fairly quickly if you just keep playing), deadlocks are a very rare occurance anyway. The pathfinder works really well the way it is.Would it be possible for a modified pathfinder to consider every couple of "game cycles" (maybe best in slightly randomized intervals) to send a train on a somewhat longer route?
Or does a train simply not know (and cannot find out due to general code design) how long it has already been waiting at a signal?
Thanks for good explanation!Taschi wrote: 12 Jun 2021 18:51 ... wait for the blocked path to become free, rather than going from London to Glasgow via Moscow and Cape Town because that route just happens to be free.
calculating those two values separately would be too CPU intensive.
Btw, is it a C++ or Squirrel part?Eddi wrote: 13 Jun 2021 12:48 that could be achieved by multiplying the penalty for reserved tracks by the time spent waiting for a free path.
Users browsing this forum: Baidu [Spider], leifbk and 7 guests