YAPP - Yet Another PBS Patch (now in trunk!)

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

MarkyParky
Engineer
Engineer
Posts: 89
Joined: 20 Nov 2003 15:20

Re: YAPP - Yet Another PBS Patch

Post by MarkyParky »

Regarding the bug, I have posted: It occures only when there is at least one free tile between platform and exit signal from platform. If you place signal right after the platform, patch is working fine.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

Michi_cc wrote: To determine what kind of signal should be build by default, I could introduce another patch setting, but I know that the OpenTTD devs generally frown uppon too much patch settings, so I'm a bit weary about that.

Comments on that issue are appreciated.
I personally think that one-way signals should not be placed by default, since they are not needed much. However, since many people are used to traditional OpenTTD signalling in which single signals are one-way, I think that creating a new patch setting in which you can select the default behavior might be the best solution. On the other hand, this could be confusing because the default signals would then not work with terminal stations.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: YAPP - Yet Another PBS Patch

Post by DaleStan »

Tekky wrote:I see no point in having additional PBS-pre-signals because PBS-signals have similar behavior as pre-signals. As long as you only place signals before and not after junctions (in contrast to traditional OpenTTD signalling), there should be no need for having pre-signals.
This is exactly what Hackykid said about his PBS implementation. It didn't work. People (like other-than-me people) wanted to be able to to PBS *without* any presignal-like behaviour: "Enter the block as soon as possible. I don't care whether your desired block-exit signal is red or green, there's only one way out of the block. You aren't going to get any more choices by waiting, and you're not going to block something else that could get out a different exit. Now get! Go!"
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
MarkyParky
Engineer
Engineer
Posts: 89
Joined: 20 Nov 2003 15:20

Re: YAPP - Yet Another PBS Patch

Post by MarkyParky »

Dalestan,

I have played with this new PBS system whole afternoon, and I think this is kind of missunderstanding. I think that the point of this PBS implementation is is not making all signals work as presignals. Now the signal says "if you can safely continue through the block your way, you have green. If it is not safe to continue your way, red", which is making concept of presignals and standard signals obsolete - mainly because there are no exit signals of the block and there is no testing whenever somewhere is red or green. The only criterium is safe way through the block to destination. In fact I am not able to imagine situation, where I would want train enter a block without knowing where and how would it exit. Can you give an example?
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: YAPP - Yet Another PBS Patch

Post by Zephyris »

I really don't understand the arguments, and I cant build the patch w/BuildOTTD to have a go (Vista :s), so sorry if I repeat what hsa been said, BUT:

You have to consider the "target audience".
Beginners want PBS, and often expect normal signals to work as if they were PBS signals. Simple is always better, and keeping beginners happy is always good too... Therefore PBS signals which can be chucked around the place (with no pre-signal behaviour) and just work is a must. You should just be able to "switch PBS on" for an entire rail network and have it work.

I would also like to see a patch setting which places PBS signals instead of normal signals by default. Because PBS signals essentially are normal signals, but better, this would make sense...
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

I agree fully with MarkyParky that presignals are now obsolete.
User avatar
AntBUK
Transport Coordinator
Transport Coordinator
Posts: 319
Joined: 02 May 2007 12:29
Location: Sheffield, England
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AntBUK »

It appears we all had a problem with numbers :D

Putting it through BuildOTTD now.
Rasing Awareness: Aspergers Syndrome 1 (NAS UK)2 (BBC)3 (YaleDDC)


Something is driving you insane... It is me.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: YAPP - Yet Another PBS Patch

Post by richk67 »

I dont know whether it would help at all, but my NewGRF_ports airport code now includes a fully working block reservation and release system akin to PBS. OK it doesnt calculate the A-B path - but just reads it from the FSM, but the effect is Path Based routing.

From my experience with airports I would expect that there are two principal requirements:
1) each block has a reservation map of some description so that it can say if a segment is reserved.
2) each train has a list of the segments it owns in the current block.

From 1) a new train can evaluate whether it can reserve its route across the block.
From 2) a train can ensure that the block reservations are cleared correctly when it exits the block. (Very important and totally overlooked in previous airport scheme.)

You may also need a 3) each block has a list of the trains that own segments in the current block. This allows simple cleanups to be made. In my airports code, if an aircraft over-reserves (pretty unlikely), then all its reservations are cleared when it either goes into the hangar or takes off. This ensures that no airport segment can remain blocked forever (unless you really screw up the FSM!!! :) ).
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

@richk67: In your last post, you made two references to "FSM". What does that stand for? The OpenTTD wiki doesn't have any entry on that name.
Last edited by Tekky on 04 Feb 2008 17:51, edited 1 time in total.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: YAPP - Yet Another PBS Patch

Post by richk67 »

Tekky wrote:@richk67: In your last post, you made two references to "FSM". What does that stand for?
Finite State Machine... basically the preprogrammed route instructions for aircraft movement.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: YAPP - Yet Another PBS Patch

Post by Bilbo »

Zephyris wrote:You should just be able to "switch PBS on" for an entire rail network and have it work.
We now have "convert railtype" to convert between maglevs, monorails and ordinary tracks, so we could have similar tool "convert signal type" to convert between normal signals and PBS. This would do for that "switch PBS on for entire network" - you can do it only on part too if you wish ...
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: YAPP - Yet Another PBS Patch

Post by DaleStan »

MarkyParky wrote:In fact I am not able to imagine situation, where I would want train enter a block without knowing where and how would it exit. Can you give an example?
Consider a one-way ro-ro station. For the station-entrance block, which splits from on track into many platforms, you want the train to wait before entering the block if it can't find a green signal/empty platform. Presignals were invented to fill this purpose, and they do it quite well.

For the station exit block, which mashes all the platforms back to a single track, you want the train to enter the block immediately upon having the block clear, despite the fact that the signal through which it (and every other train) will exit that block is still red. This is not a presignal-type behaviour.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch

Post by Michi_cc »

DaleStan wrote: Consider a one-way ro-ro station. For the station-entrance block, which splits from on track into many platforms, you want the train to wait before entering the block if it can't find a green signal/empty platform. Presignals were invented to fill this purpose, and they do it quite well.

For the station exit block, which mashes all the platforms back to a single track, you want the train to enter the block immediately upon having the block clear, despite the fact that the signal through which it (and every other train) will exit that block is still red. This is not a presignal-type behaviour.
Like this you mean? No presignals needed.
Chonston Transport, 23rd Sep 1949.png
Chonston Transport, 23rd Sep 1949.png (36.76 KiB) Viewed 5824 times
MarkyParky wrote:Regarding the bug, I have posted: It occures only when there is at least one free tile between platform and exit signal from platform. If you place signal right after the platform, patch is working fine.
A bug fix for this is on its way, please hold on for a moment.

-- Michael Lutz
-- Michael Lutz
spets
Engineer
Engineer
Posts: 8
Joined: 29 Jan 2008 19:03

Re: YAPP - Yet Another PBS Patch

Post by spets »

looks cool!

can anyone make a .grf file for windows?
User avatar
AntBUK
Transport Coordinator
Transport Coordinator
Posts: 319
Joined: 02 May 2007 12:29
Location: Sheffield, England
Contact:

Re: YAPP - Yet Another PBS Patch

Post by AntBUK »

I've compiled, played and I'm impressed :) Fired an an old coop save and changed a couple of the stations so it was PBS'd and only had one crash, no idea why but didn't have any other crashes :) Going to go play with it some more now :)
Rasing Awareness: Aspergers Syndrome 1 (NAS UK)2 (BBC)3 (YaleDDC)


Something is driving you insane... It is me.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: YAPP - Yet Another PBS Patch

Post by DaleStan »

Michi_cc wrote:
DaleStan wrote: Consider a one-way ro-ro station. For the station-entrance block, which splits from on track into many platforms, you want the train to wait before entering the block if it can't find a green signal/empty platform. Presignals were invented to fill this purpose, and they do it quite well.

For the station exit block, which mashes all the platforms back to a single track, you want the train to enter the block immediately upon having the block clear, despite the fact that the signal through which it (and every other train) will exit that block is still red. This is not a presignal-type behaviour.
Like this you mean? No presignals needed.
Then (1) your PBS signals aren't behaving like presignals, and
(2) What happens at a terminus station or a two-way ro-ro, where you do have to have signals on the entrance side of the platform?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: YAPP - Yet Another PBS Patch

Post by Maedhros »

One problem with converting signals from normal to PBS is that any trains behind them won't have reserved tracks, so other trains will reserve tracks through them even though the track behind is occupied.

Is it possible to place PBS and normal signals without having to toggle the patch option?
No-one's more important than the earthworm.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch

Post by Michi_cc »

DaleStan wrote: Then (1) your PBS signals aren't behaving like presignals, and
(2) What happens at a terminus station or a two-way ro-ro, where you do have to have signals on the entrance side of the platform?
So what if the don't behave like presignals, they do exactly what you described. The entrance signal will only turn green if a platform is free and the signals immediately after the platform turn green as soon as the way to the exit signal is free.

A sample two-way ro-ro station:
Excuse the unreserved platform at the bottom, letting trains pose for a screenshot isn't that easy 8)
Excuse the unreserved platform at the bottom, letting trains pose for a screenshot isn't that easy 8)
Chonston Transport, 18th Mar 1950.png (34.95 KiB) Viewed 5703 times
Maedhros wrote:One problem with converting signals from normal to PBS is that any trains behind them won't have reserved tracks, so other trains will reserve tracks through them even though the track behind is occupied.
Yeah, you have to stop the trains and start them by hand again when it's safe. I don't think any effort spent on fixing this is worth it.
Maedhros wrote:Is it possible to place PBS and normal signals without having to toggle the patch option?
Right now it's not, but the next version will include more patch options so everybody can be happy at the same time.

Warning: This means I will have to break savegame compatibility.

-- Michael Lutz
-- Michael Lutz
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: YAPP - Yet Another PBS Patch

Post by DaleStan »

Michi_cc wrote:
DaleStan wrote: Then (1) your PBS signals aren't behaving like presignals, and
(2) What happens at a terminus station or a two-way ro-ro, where you do have to have signals on the entrance side of the platform?
So what if the don't behave like presignals,
Then don't say that they behave like presignals.

And I seem to see a presignal flag on some of those PBS signals. I thought you said that presignals wouldn't be needed any more.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch

Post by Tekky »

The "presignal flag" has a different meaning with these new PBS signals. It is used as a one-way sign.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests