Path Based Signalling!!! (pbs v080)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Zahl
Engineer
Engineer
Posts: 27
Joined: 23 May 2004 13:19
Location: Germany
Contact:

Post by Zahl »

I still got trains entering pbs blocks with no free exit.
Only sometimes, but it happens. Then the train waits
at a random exit until it times out and reverses. In
this case the train does not reserve a route (I know
you know that ;)) and might crash with another train
(following a reserved route). This is the next
problem, as crashed trains do not release their track
after they got removed from the screen.
Best would be if crashed trains immediately release
the reserved track and only reserve the tiles they
are laying on.
Attachments
train waited at the marked signal...
train waited at the marked signal...
pbs2.png (99.84 KiB) Viewed 1257 times
Last edited by Zahl on 13 Mar 2005 20:51, edited 3 times in total.
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

@ Stavrosg
In the latest version (v052), your assertion problem is fixed.

@ Zahl
I also noticed trains going to red exit signals while testing v051, and it turned out te be a problem with the NPF. But, its fixed in svn now, and should not happen in v052.

As usual .diff and windows build for the new version are in the start post.
DopeFish Lives!!!
User avatar
Zahl
Engineer
Engineer
Posts: 27
Joined: 23 May 2004 13:19
Location: Germany
Contact:

Post by Zahl »

The problem with trains going to red signals seems to be gone.
But I have another problem, which is caused by me I think :D
As it is troublesome to directly connect two pbs blocks directly,
you normally have to build semaphore-signal-semaphore to
connect them, instead of just one semaphore between both blocks.
Otherwise a train that wants so go over block
A and B won't enter block A unless there is no train on block B,
even if there would be a free route on block B.
As there was not enough space, I tried something different.
I connected both blocks via signal and semaphore. (See screenshot,
top left). This seems to work perfectly. Block A ignores the signal
(track under the signal will be reserved too by a train) and trains
that have to go over block A and B will enter block A even if there is
a train on block B.
Now the problem that occured, where I don't know if it is caused by
this contruction: One train reserved the marked track to enter
the station. When it reched the blue line, it released the track and
followed the green path. A train coming from top left crashed with it.
I attached the savegame, so you can see this. (It is hard to explain
it all ;))

EDIT:
I think the problem is not the connection method of two blocks.
It is two blocks too close to each other, regardless of the
connection method, so I will avoid them... The only solution would
be a special block-connecting signal imho (like the 3rd presignal)
Attachments
pbs-crash.sav
hit pause to watch it...
(128.48 KiB) Downloaded 287 times
pbs3.png
pbs3.png (99.13 KiB) Viewed 8719 times
Wilson
Engineer
Engineer
Posts: 6
Joined: 13 Mar 2005 22:26

Post by Wilson »

Hy

I tried the pbs, and it's great. I attach a savegame, where a train crash into an other train while they are in pbs block.

Here is the save game. Just load and wait 5 second fot the crash.
http://web.axelero.hu/congy/pbs_error.sav
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

Darkvater wrote:
Dextro wrote:
tecxx wrote:hackykid, are the semaphore signals just for style or are they necessary? :=) (in other words: can i use normal signals?)
now here's something I would like to know aswell :roll:
Currently you use Semaphore signals to identify a PBS block. So yes, they are neccessary!

When it's done it'll be merged.
Isn't there any chance of a different set of PBS signals instead of semaphores? ie, I prefer the lights type, where it tells you the info right off the bat.
How about a replacement set, like some grfs, "overwriting" the semaphores?
I never use semaphores, because you have to spend an extra second to work out what mode it's in!
Also, although the idea (and execution) is brilliant, the track layouts using both lights and semaphores in a "mixture" is rather off-putting. Consistency helps here, in my view.
Don't take this as a criticism, just another idea.
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

@Wilson
Thacks for that savegame, it was really helpfull.
So, I tracked down what caused your crash, and its not my fault. There seems to be a bug with NPF :-(. I have found the solution for it, so it will be in svn soon.

Hehe, seems that we are doing a good job of stress-testing the npf :-), this is the third bug i found as a result of pbs.

@Zahl
This same bug was the cause of the crash in the savegame you posted, so lets hope this will solve your problems too.
Also having 2 pbs-blocks near eachother shound not be a problem, as long as there is at least 1 normal signal between them.
Another tip on this, is to just merge the 2 blocks into 1, eg remove all signals on the tracks connecting the 2 blocks, sometimes this will give better performance.

@Arsenal
Yes, later there will be a different system for defining pbs-block, the semaphores thing is just a debug solution. When the pbs itself it working a bit better, I may add a patch option to choose how you want to define your blocks.
DopeFish Lives!!!
User avatar
Ralph
Engineer
Engineer
Posts: 87
Joined: 21 Jun 2004 15:25

Post by Ralph »

Heres another crash, the grain train entered the block without reserving track, and the livestock train tries to go through it. (yes I know thats one ugly junction but I was just trying out some stuff with PBS). Running latest windows build posted in this thread
Attachments
BOOM!
BOOM!
crash.png (44.46 KiB) Viewed 1209 times
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

Good news, I've fixed some NPF bugs as well as some PBS ones, and this will mean a lot less train crashes. (i hope :P)

The new version (v053) is in the start post.
DopeFish Lives!!!
matthijs
Engineer
Engineer
Posts: 76
Joined: 25 Jun 2004 15:20
Location: Enschede, Netherlands
Contact:

Post by matthijs »

Patchman wrote: One algorithm that helped with this in TTDPatch PBS was to call the pathfinding twice, once the regular pathfinding, and once ignoring reserved pieces and red one-way signals. If the second call gives a much better (shorter) route, I tell the train to wait before entering the PBS block until this route becomes available, instead of taking the worse route right away.

Not sure if that's still feasible with OTTD's pathfinding, but it might be an idea to try.
Well, that is basically what NPF does, in one run. Instead of considering a red one way signal as a dead end, it gives it (any red signal) a penalty. This means that if it can find a route that is longer, but no more than the penalty longer, it will take that other route.
But, if the longer route is more that the penalty longer, the total cost of that path will be worse than the path past the red signal, so it will not be choses and the train will wait at the signal instead.

Hacky: Maybe we can increase the red signal penalty when inside a pbs block?

Matthijs
Wilson
Engineer
Engineer
Posts: 6
Joined: 13 Mar 2005 22:26

Post by Wilson »

I found a bug, on the attached screenshot I send a train in the depot, it went to the depot, but after it reserve a route out of the pbs block. So train waits in the depot, and in the pbs block is a reserved route. If I start the train in the depot, it can go where it wants. I tried this with (v052 and v053).
Attachments
bug
bug
bug.png (49.89 KiB) Viewed 8473 times
User avatar
Jump
Traffic Manager
Traffic Manager
Posts: 147
Joined: 22 Sep 2004 21:10
Location: Belgium

Post by Jump »

Wilson wrote:I found a bug, on the attached screenshot I send a train in the depot, it went to the depot, but after it reserve a route out of the pbs block. So train waits in the depot, and in the pbs block is a reserved route. If I start the train in the depot, it can go where it wants. I tried this with (v052 and v053).
...
Hackykid wrote: ...
Do not put depots in such junctions, that will not work. Also its best to only use 2-way signals at dead end exits, like terminus stations.
...
User avatar
Zahl
Engineer
Engineer
Posts: 27
Joined: 23 May 2004 13:19
Location: Germany
Contact:

Post by Zahl »

OK, another crash.
I added normal signals at the exit of the station, as the semaphores
directly behind the exit were even worse.

EDIT: Well the crash could be prevented by switching auto-renew off,
but now I got another train releasing its path. Will edit attachment...
Attachments
pbs-crash6.sav
(131.53 KiB) Downloaded 290 times
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

Zahl, i've made a quick fix for your last crash (v054)

See start post.
DopeFish Lives!!!
User avatar
acidd_uk
Traffic Manager
Traffic Manager
Posts: 194
Joined: 08 Sep 2004 14:38

Post by acidd_uk »

Jumper - but the depot doesnt look to be inside the pbs block - there's a semaphore next to it, so it's outside the pbs block. So I think it's a fair post, given Hackykid has just said don't put deots in the blocks... I guess Hackykid is the person to say if that's a known bug (I guess it's known now anyway :-) ).
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

@acidd_uk

Yes, technically your depot was NOT in the pbs block, but that kind of setups STILL can cause problems....

Also, it may be that your problem was not caused by the setup, but by one of the other bugs that I since fixed.

If you can give me a savegame where such a crash is GOING to happen (with latest version) BEFORE any of the involved trains has entered the block, I could tell you what caused the crash.
DopeFish Lives!!!
mpettitt
Engineer
Engineer
Posts: 85
Joined: 06 Apr 2004 18:08

Post by mpettitt »

This is a great patch, but there are still a few little bugs in it. Also, you _need_ build whilst paused turned on - modifying live junctions really doesn't work when you have dynamically changing routes and lots of trains on an unprotected signal block... :twisted:

This also leads to the other point - crashed trains need to release all reservations immediately, else you need to modify a junction. Normally whilst live. Leading to more crashes...
User avatar
Hackykid
Traffic Manager
Traffic Manager
Posts: 157
Joined: 22 Nov 2004 16:04
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Contact:

Post by Hackykid »

Yes, modifying pbs-junctions in use is very risky...

I will probably make removing reserved tracks impossible, so that you wont f*** up a train's path.
But for this to work, i would need to make crashed trains unreserve their tracks.

hmm, lets just say its on my todo list, but currently FIXING crashes is a higher priority :-)

speaking of fixing:
new version (v055) should prevent some crashes.
DopeFish Lives!!!
User avatar
StavrosG
Traffic Manager
Traffic Manager
Posts: 202
Joined: 13 Dec 2004 21:13
Location: Rodos, Greece
Contact:

Post by StavrosG »

I tryied 055 a bit, its okay in general, bar one crash I was unable to reproduce.

One thing to notice is that there are still trains that release their path when inside a pbs-block. I'll try to have a save towmorrow about that.

Stavros
If ain't broken, don't fix it. | JabberID: stavrosg@jabber.org

Hello, I am a signature virus. Please copy me to your signature to help me spread.
User avatar
Zahl
Engineer
Engineer
Posts: 27
Joined: 23 May 2004 13:19
Location: Germany
Contact:

Post by Zahl »

I still played with 54, and got no crashes for ~3 hours, except one with
a train reversing in a pbs block, which was more or less my fault. :)

I think stations should be treated like a "pbs-splitter", so that one can
have a pbs block at both, the entrance and the exit of a roro station.
This already works, but trains that just go through the station without
having this station in their schedule will reserve the track inside the station
and might cause troubles in the pbs block at the exit.
RookieTycoon
Engineer
Engineer
Posts: 34
Joined: 29 Dec 2004 01:16
Location: Bandung, Indonesia

Post by RookieTycoon »

I love this Feature PBS. Make a whole new strategies for designing the track.

An idea: what about making the forth pre-signal for PBS Block with 3 light

Green : mean the block free
Yellow : block is occupied but the train can still move because there is a free path.
Red: complete blocked. Train must stop...

what about this?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 32 guests