Page 1 of 1

[0.11.13] Train blocks itself unnecessarily

Posted: Wed Jan 28, 2015 9:14 pm
by dee-
Not sure if this can be considered a bug or just my bad* rail layout...


Observation:

In the following scenario the train came from north and wants to go south.
From what I can tell it chose the shortest path, straight through the circle.
However if the train choses this path it enters a separate short block, block 2.
The train can not leave block 2 because part of the train is still in the surrounding block 1, thus the signal to leave block 2 and enter block 1 is red.

Image

In case you wonder what's this block 2 for - that's where I normally park my ride :D


If the train logic would not only consider the train's head (telling signals to turn from green to yellow) but also the train's body on the calculated path it would find out that part of the train is still in and therefore reserving block 1 when it would try to leave block 2 and enter block 1. Ergo this solution is not considered, as there is no path, leaving only the other solution, going around the circle and staying in block 1, which I would consider the correct solution.


*) "bad" in the sense of "not suitable for train route planner"

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Wed Jan 28, 2015 10:49 pm
by Cloner
Untill pre-signals are implemented dont place signals inside of intersections.

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 3:26 am
by Gandalf
It doesn't block itself "unnecessarily", it blocks itself because your signal block is too short. Consider that this isn't so much a matter of
pathfinding. It's really just signals turning red when something's inside that block. Trains don't go across red signals, nothing else matters.

As a rule of thumb you don't want blocks that are shorter than trains. If you need a parking spot, build a side track beside the main line,
not in the middle of an intersection.

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 7:46 am
by ssilk
Blocks are just stupid. I build once such a circle in a form, where it needs to make a 270 degree turn to go into the right direction. This worked perfect up to 7 wagons. The 8th was then just destroyed. It tooks a while for me to find that, cause always when I saw a train with only 7 wagons I coupled a 8th on it. :lol:

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 8:29 am
by dee-
Good morning ;)

Ah, so it's not considered a bug then.

@gandalf: of course it IS unnecessary blocking itself because for the situation there IS a solution that prevents self-blocking.
The train route planner is just too straight forward (consider only train head and ignore train length, choose shortest path not the self-not-blocked path)

I'll implement workarounds for the train route planner. Read: stops on the side and don't nest blocks that could be too short for the longest train in the system because it will stuck if that's the shortest path.

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 8:48 am
by Gandalf
My point is, the signals are very simple minded. They don't care who blocks them, if any part of any train
is in that block it's red. And trains don't run across red lights, period. Those rules are intuitive, easy to
understand and remember. If you start adding “smart” exceptions it becomes harder to predict what will
happen and opens the potential for weird edge cases.

For Example, consider a simple loop with two blocks, two stops and two trains (one per block respectively).
Now you tell each train to go to the stop in the opposite block. Again we have a situation where there is
technically a simple solution, but would you want to make it work?

If you start considering every possible situation where a train could technically still run you'll reach the
point where signals just become obsolete because path finding might as well be smart enough to do
everything on its own, regardless of how impractical the rail layout is.

Basically signals in the game are a feature but also a challenge. You have to use them right.

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 9:28 am
by hitzu
It is not a bug. It is just wrong layout. You had to place one more signal on the left part of the circle to mark the end of a previous block

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 9:51 am
by dee-
Thanks all.

Yeah, I'll reconsider my expectations on signals and accept they're dumb :D Making it foolproof is part of the challenge ;)

Re: [0.11.13] Train blocks itself unnecessarily

Posted: Thu Jan 29, 2015 10:20 am
by kovarex
dee- wrote:Thanks all.

Yeah, I'll reconsider my expectations on signals and accept they're dumb :D Making it foolproof is part of the challenge ;)
Yes, and there will be more ways to control it in the future ...