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

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by Wolf01 »

This patch is really really useful and easier to understand than the old PBS, now I don't use signals at all for the stations, I only put one PBS at the entrance track and one at the exit track
And I'm trying to reduce the number of signals at junctions at many as I can
It seems to work well, except on some layouts where trains try different ways before chosing the right one (especially in the basic terminus station with the depot placed on the junction, the train, fully loaded, go to the depot, then to the station again and then to the right way), but this might be my fault as it happens only in one station
I wish it in trunk, since I really need to balance some tracks I built where cities and competitors block me to build better junctions or load-balancers (and I easily run out of place to put signals)
Good work Michael :)
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

Firts of all - this patch is really cool! Great work!

But - is there any documentation?
I do not know why I can build at leat two types auf PBS signals.
(One straight one and one with a yellow bar (entry signal))
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by Tekky »

The signal with the yellow bar prevents traffic from passing the signal in the opposite direction, i.e. it designates the track as one-way.
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

Thank you! Now I know it. Anyway: Is there any documentation?

Do all signals have to be PBS signals? Or just one signal per PBS block?
Does YAPP work exactly like the ttdpatach PBS?

computing time compared to presignals
When I play ottd online I do get some problems with lagging. (Better: I do not have any problems, my patner has some, I host the game)
As far as I know ships with long routes without shipyards and buoyes are a reason for that problem.
Can big YAPP crossings be a problem, too?

Bi-directional double tracks
The openttd wiki says that these tracks are not possible with this patch.
WIKI LINK wrote:his implementation does not support bi-directional double track due to lack of support of "weak" reservations.
Is this still correct? Will these "weak" reservations be implemented?

Damn, I need a YAPP documentation.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by Tekky »

zypa wrote:Thank you! Now I know it. Anyway: Is there any documentation?
There currently is no documentation except what michi_cc has posted in this thread about this patch. However, this information is partially outdated, as he has released many new versions in the mean time. I think the best piece of information is this post by michi_cc which shows you how you can build a bi-directional station with the new PBS signals.

zypa wrote:Do all signals have to be PBS signals? Or just one signal per PBS block?
It is enough for one signal of a PBS block to be PBS, in order to make all other signals also behave as PBS signals. However, I recommend you upgrade all signals to PBS. In my opinion, there is no reason to use the old signal types, unless you want to do exotic things like priority lines using pre-signals.

zypa wrote:Does YAPP work exactly like the ttdpatch PBS?
I think this patch is similar to TTDPatch with through-signals (alpha feature). But I haven't been playing much TTDPatch, so I don't know if there are any differences, except for the graphics of the through-signals.

zypa wrote:computing time compared to presignals
When I play ottd online I do get some problems with lagging. (Better: I do not have any problems, my patner has some, I host the game)
As far as I know ships with long routes without shipyards and buoyes are a reason for that problem.
Can big YAPP crossings be a problem, too?
I'm not sure about multiplayer, but in single-player, large YAPP junctions are no problem. The main performance problem currently is that trains waiting at a red signal for a free PBS path are big performance hogs, because they try to find a new path every tick (=about 40 times per second). However, michi_cc already stated that he would address this issue in his next release.

zypa wrote:Bi-directional double tracks
The openttd wiki says that these tracks are not possible with this patch.
WIKI LINK wrote:his implementation does not support bi-directional double track due to lack of support of "weak" reservations.
Is this still correct? Will these "weak" reservations be implemented?
I am the one who wrote that wiki article. As far as I know, michi_cc has no intention to implement a train scheduler which requires weak reservations. I plan to implement this myself if necessary, but the current YAPP pathfinder/reservation system requires many more optimizations before it is ready for these additional features, in my opinion.
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

Wow. :bow:
Thank you Tekky. That's a kind of an answer I dream about. Thank you so much!
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

I've tested the PBS signals in my last games.
I guess I've found some problems,

Bug 1

I had an error with one multiplayer game. A specific railtrack could not be removed. It gave the error "train approaching". This error was there even when there was no train aproaching. I've even sold all trains on that line. Nothing helped.
My online gaming partner removed the tile, resulting a game crash...
Unfortunately I do not have any screenshot or savegame. We reloaded the game a couple of times and the problemjust disappeared...

Bug 2 (What do I do wrong?)
I've tested the PBS. Why is train 3 stucked? The whole reserved path is free, isn't it? Is this a bug? I guess i made a mistake...
Attachments
bug?
bug?
bug.png (121.68 KiB) Viewed 4329 times
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by Michi_cc »

zypa wrote:Bug 2 (What do I do wrong?)
I've tested the PBS. Why is train 3 stucked? The whole reserved path is free, isn't it? Is this a bug? I guess i made a mistake...
Without a savegame, preferably before the train gets stuck, there's not much I can do. But do make sure that you are using vanilla 4.3 YAPP.

-- Michael Lutz
-- Michael Lutz
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by Tekky »

@zypa:
At least in single-player, bug #1 happens if a train reserves a track but then doesn't clear the reservation again, because the train decided to go somewhere else. However, most of these "lost reservation" bugs have been fixed. Are you using the latest version of YAPP? You should be using Version 4.3.

Concerning bug #2, earlier versions of YAPP were incompatible with waypoints. The fact that you reported this bug also makes me guess that you are using an earlier version of YAPP.

Did you maybe download a binary in this thread which was outdated? I suggest you use BuildOTTD for building your own version of YAPP 4.3. This should only take you 5 or 10 minutes, depending on the speed of your computer.
broodje
Director
Director
Posts: 615
Joined: 13 Jul 2003 12:47
Location: Alphen aan den Rijn
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by broodje »

I'm not realy sure all the lost reservation bugs are gone. I'm using the latest binary (compiled it myself 2 days ago) and every once in a while the last 2 tiles of a station get reserved by a train that then gets stuck in front of them (waiting for a free path he just created). I do not have a sacegame, I'm to late to catch the train before it happens.
Waypoints directly behind a JN (thus no free tile between the waypoint and JN) without a signal it also cause trouble once in a while. The train can't reserve a free path then.
For some reason the above problems only happen once every 3 or 4 game years (sometimes even longer), and I can't see a good reason why it does not always happen.
MrMox
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 22 Mar 2007 07:51
Location: Denmark
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by MrMox »

Really looking forward to using this patch and the Canadian set - however CanSet requires r12382 or newer. Has anyone managed to get 4.3 to work with a recent nightly supporting CanSet - BuildOTTD reports a few errors trying to merge the patch. Alternatively (and even better :) ) is the release of 4.4 close? :bow:
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

I use gonozals patchpack r12180M.
I guess it uses an old version of this patch.

Thank you A LOT! I will simply put normal signals in front of my waypoints. That seems to work.
Is there a way to clear reservations?
satosphere
Engineer
Engineer
Posts: 40
Joined: 29 Apr 2005 06:09
Location: Santa Clara, USA
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by satosphere »

Does destroying the track tile and rebuilding help to remove reservations?
That was the default method for PBS to remove uncleared reservations.
Talent does what it can.
Genius What it must
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 4 out!)

Post by zypa »

Yeah... Destroying helps.
Ergh... I'm so damn stupid. I tried to remove the railroad tiles (CTRL+LeftMouse), that does not work.
Later on i activated the magic bulldozer. I thought that is the solution but the normaldozer helps as well.

Thanks satosphere.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by Michi_cc »

MrMox wrote:Alternatively (and even better :) ) is the release of 4.4 close? :bow:
I'm afraid the release of version 4.4 is in the indefintive future.

Alternativly (and probably even better), I can offer you a version 5 of YAPP instead. :D

Changes:
  • Major performance improvments, also see the bit about patch settings below.
  • Improved servicing in PBS areas, automatic train servicing should now work as expected.
  • Trains crashed in a depot no longer crash the game.
  • Fixed some problems with mixed railtypes and trains not reserving a path into a station.
  • Waypoints from the Canadian Station Set now work.
  • Various minor bug fixes and other things I forgot :) .
  • 5.1: Lost trains would sometimes leave an invalid path behind.
  • 5.2: Reversing trains would reserve an invalid path through a one-way signal.
  • 5.2: Better protection of reserved station tiles from modification.
As you might gather from the new major version, I'm breaking your old YAPP savegames again, courtesy some savegame bumps in trunk.

Patch settings:
A new patch settings, path_backoff_interval, has entered the game. It controls how many ticks a train will wait after failing to obtain a path before the next attempt. The default value should be good for most games, but if you play with a very high number of trains, increasing the value will lower CPU usage.

Another new patch setting is yapf.rail_doubleslip_penalty. Basically, it applies a penalty for passing a double slip. It should help in situations like the one shown in this post. Certain station layouts will produce sub-optimal paths with the new setting, setting it to 0 will restore the previous behavior.

I've also increased the default value of yapf.rail_curve45_penalty to 200, old savegames will still have the previous default, so change this yourself. You might also want to check your openttd.cfg.

First post updated as well.

-- Michael Lutz
Attachments
yapp_r12622_v5_2_svn.patch
SVN-compatible diff
(190.67 KiB) Downloaded 130 times
yapp_r12622_v5_2.patch
git diff -p
(197.47 KiB) Downloaded 108 times
Last edited by Michi_cc on 07 Apr 2008 22:41, edited 2 times in total.
-- Michael Lutz
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by zypa »

That's great! I'd really love to test it - but - I cannot compile it on my own.
I use win vista 64bit and openttdBuild seems to _not_work on my system.

If anyone will post a precompiled version, I'd really be happy. (And I would say thank you!)
User avatar
beeb375
Tycoon
Tycoon
Posts: 2082
Joined: 11 Apr 2006 13:48
Location: Jarrow, Tyne and Wear

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by beeb375 »

Seconded, I'm on Vista too, so a precompiled one would be great.

Good work on the patch :)
“Blackmail is such an ugly word. I prefer extortion. The ‘x’ makes it sound cool.”
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by Tekky »

Thanks for your new version of YAPP! However, I have found the following bug:

In the attached savegame, train #3 is currently entering the station. Later, it will reserve a route out of the station, but will be unable to take it.

Please note that I have set wait_for_pbs_path to 12 in order to reproduce this bug faster.
EDIT: Sorry, it seems that the wait_for_pbs_path setting has no influence on this bug.
Attachments
bug.sav
(93 KiB) Downloaded 89 times
Last edited by Tekky on 26 Mar 2008 09:48, edited 2 times in total.
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by Trond »

Heres a BOTTD win32 build with Yapp v5 for those who want to test but cannot build themselves.
Attachments
trunk_r12422_yapp_r12421_v5_svn.patch_26.03.2008_06-26-32.rar
(2.58 MiB) Downloaded 321 times
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: YAPP - Yet Another PBS Patch (New version 5 out!)

Post by zypa »

Thanks Trond! :bow:
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot] and 20 guests