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

dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

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

Post by dasy2k1 »

Thief^ wrote:Clear out your openttd.ini's yapp/pbs sections (or delete it entirely). That layout should work, but the old pbs/yapp pathfinder penalties from the older pbs can cause trouble.
compleate path to what i need to clear out please (form the openttd base dir)
User avatar
B-b0y
Engineer
Engineer
Posts: 44
Joined: 01 Nov 2008 16:29
Location: Netherlands

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

Post by B-b0y »

Does this mean PBS will be in the 0.6.4 or 0.6.5?

That would be great!
It takes an athlete to dance, but an artist to be a dancer. - Anonymous
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

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

Post by Zuu »

B-b0y wrote:Does this mean PBS will be in the 0.6.4 or 0.6.5?

That would be great!
No, you have to wait for 0.7 for that. No new features in 0.6.x. If you want more elaboration make a search, since this question pops up every now and then.

dasy2k1 wrote:
Thief^ wrote:Clear out your openttd.ini's yapp/pbs sections (or delete it entirely). That layout should work, but the old pbs/yapp pathfinder penalties from the older pbs can cause trouble.
compleate path to what i need to clear out please (form the openttd base dir)
<openttd-dir>\openttd.ini

Open it and look for the yapp/pbs sections.


Note that changing the openttd.ini only affects new games. To change yapp/pbs settings of your existing games you need to use the in game console for that.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

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

Post by Yexo »

Zuu wrote:
B-b0y wrote:Does this mean PBS will be in the 0.6.4 or 0.6.5?

That would be great!
No, you have to wait for 0.7 for that. No new features in 0.6.x. If you want more elaboration make a search, since this question pops up every now and then.

dasy2k1 wrote:
Thief^ wrote:Clear out your openttd.ini's yapp/pbs sections (or delete it entirely). That layout should work, but the old pbs/yapp pathfinder penalties from the older pbs can cause trouble.
compleate path to what i need to clear out please (form the openttd base dir)
<openttd-dir>\openttd.ini

Open it and look for the yapp/pbs sections.


Note that changing the openttd.ini only affects new games. To change yapp/pbs settings of your existing games you need to use the in game console for that.
The file is called openttd.cfg, not .ini. :)
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

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

Post by Thief^ »

whoops...
Melt with the Shadows,
Embrace your destiny...
Arda
Engineer
Engineer
Posts: 32
Joined: 09 Aug 2006 12:06

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

Post by Arda »

Created in nightly 14583 Windows 2000 32bit (also tested on Vista 64bit)
Fresh install - no config file present. (also tested on not so fresh install with config file present)
The included savegame did have a config file present. I can attach a savegame from the fresh install but its the same result.

I have included a screenshot and a save game.
When looking at the screenshot you will see two stations (A and B)

There is a train called "Sim Crash" that has been stoped to simulate a crash :) within a pbs block and train "Tester" to well test the PBS setup.

In the savegame train "tester" is stoped in depot next to town B.
Just start it. It is set to move to Town B --> Town A --> Town B
As it passes Town A and gets up to the PBS junction (behind Train Sim. Crash) it will stop at the junktion with the msg "Waiting for a free path" - even though there is a free path on the middle takeover lane.

I have done several tests. If i place the "Sim Crash" train on the takeover track it self then all train move normal through the PBS junktion both on Town A --> Town B and Town B --> A. (even with two trains entering the block at the same time)

If i place "Sim Crash" on the Town B --> Town A track then the train stops at the junktion just after Town B with the msg "Waiting for free path".

I use one way PBS signal on the main line. Two way PBS signal "reversed" in front of stations and Two way PBS signals on the take over track. (also tested with only two way signals - same result)

I just dont get it :)

Arda

Image
Attachments
PBS test - Waiting for free path.sav
(103.86 KiB) Downloaded 161 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

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

Post by Zuu »

I haven't tried, but I would suggest to copy the blue circled signals to the red circles. (see attachment)

This way the penalty to go either way will be equal, if there is no train. And with the train on the main-track as in the picture, the main-track will get a higher penalty than the other one.

As it is now I guess that the middle track has higher penalty value than the track with the "crash" train on it.


If I'm not mistaken trains does only calculates the penalties for all options and then check the cheapest route if it is free. There is a penalty for train on track however, but it does not check alternative options if the cheapest route is blocked.
Attachments
fix.PNG
fix.PNG (60.63 KiB) Viewed 6780 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

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

Post by Rubidium »

Zuu wrote:If I'm not mistaken trains does only calculates the penalties for all options and then check the cheapest route if it is free. There is a penalty for train on track however, but it does not check alternative options if the cheapest route is blocked.
It's more that the penalty for taking the free route is higher than the penalty for waiting for the train. As it always takes the route with the lowest penalty it has to wait.
audigex
Tycoon
Tycoon
Posts: 1998
Joined: 09 Dec 2007 21:28
Contact:

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

Post by audigex »

zuu's technique should work, by giving the tracks the same signal penalty, the empty track will get the train penalty and will be a weaker option...

basically, the penalty for the train is less than for the back of a signal, as long as you use one way signals where you need it it will work.

I think there's also some command line command to reduce the "signal back" penalty? I might be wrong though. Set that to 0 and make sure you use all 1-way signals when on 1-way track and you're away. It's more realistic anyhow.
Jon
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

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

Post by Brianetta »

It's a patch option, which can be set in the config file or with the console.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
xerxesdaphat
Engineer
Engineer
Posts: 66
Joined: 06 Apr 2004 03:32

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

Post by xerxesdaphat »

Brianetta wrote:It's a patch option, which can be set in the config file or with the console.
Excellent! Hadn't come across this before. Thanks.

If you want to change it, it's in ~/.openttd/openttd.cfg , or wherever else your openttd.cfg is. Mine's currently (originally) set as so: yapf.rail_pbs_signal_back_penalty = 1500

I might have a fiddle with the other _penalty values and see what happens.
Linux Registered User #350204
--The Shoes of the Fisherman's Wife Are Some Jive Ass Slippers
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

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

Post by Thief^ »

Set that high it looks like it would need 5 squares of reserved track on the other route to equalize it (if I'm reading this right), not including the possibly different length of the route. Perhaps lower it to 800?
Melt with the Shadows,
Embrace your destiny...
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

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

Post by Zuu »

xerxesdaphat wrote:
Brianetta wrote:It's a patch option, which can be set in the config file or with the console.
Excellent! Hadn't come across this before. Thanks.

If you want to change it, it's in ~/.openttd/openttd.cfg , or wherever else your openttd.cfg is. Mine's currently (originally) set as so: yapf.rail_pbs_signal_back_penalty = 1500

I might have a fiddle with the other _penalty values and see what happens.
Note that changing the value in the openttd.cfg file only impact new games. For existing saved games, you need to load the game, open the console (~-key, or use the menu option in the ?-menu to the right) and then type the right command to change the patch option.

(I don't remember exactly how the command looks like , but can be found with some searching. There is even built in documentatin on which commands exist in the console. - not as good sa the man-pages but still you can find out things if you know what you are looking for)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

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

Post by Michi_cc »

Thief^ wrote:Set that high it looks like it would need 5 squares of reserved track on the other route to equalize it (if I'm reading this right), not including the possibly different length of the route. Perhaps lower it to 800?
You're reading it right :) Penalty for one reserved track is 300 by default, so 1500 equals 5 tiles. In practice this should be no problem as most trains are longer than one tile meaning that you won't need much reservation in front to counter the signal penalty. In this specific case, there's of course also the standard YAPF curve penalty to consider, but that's nothing new with YAPP.

-- Michael Lutz
-- Michael Lutz
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

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

Post by Roujin »

Zuu wrote:
xerxesdaphat wrote:
Brianetta wrote:It's a patch option, which can be set in the config file or with the console.
Excellent! Hadn't come across this before. Thanks.

If you want to change it, it's in ~/.openttd/openttd.cfg , or wherever else your openttd.cfg is. Mine's currently (originally) set as so: yapf.rail_pbs_signal_back_penalty = 1500

I might have a fiddle with the other _penalty values and see what happens.
Note that changing the value in the openttd.cfg file only impact new games. For existing saved games, you need to load the game, open the console (~-key, or use the menu option in the ?-menu to the right) and then type the right command to change the patch option.

(I don't remember exactly how the command looks like , but can be found with some searching. There is even built in documentatin on which commands exist in the console. - not as good sa the man-pages but still you can find out things if you know what you are looking for)
type "list_patches pf" (without quotes) to display all pathfinder related patch variables (to be exact, all variables that start with "pf")
type "patch [var] [value]" (without quotes) to set one of them to a new value

e.g. "patch pf.yapf.rail_pbs_signal_back_penalty 1000" to set it from 1500 or whatever it currently is to 1000.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Arda
Engineer
Engineer
Posts: 32
Joined: 09 Aug 2006 12:06

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

Post by Arda »

Zuu: I cant move the signals as this is just a block that will be copied 30-40 times into a full main line. (without the stations and depoes.)
If i dont have any singals on the overtake line then it only takes just one train to block the entire line. You had no way of knowing that though. I just wanted to mention it.

I gradualy reduced the signal back penalty until the "waiting for free path" train started moving on the overtake line. I had to set it as low as 210 - down from 1500.

It works now. I still have to do some tweaking, but the design as i wanted it is starting to take shape.

Arda
User avatar
siu238X
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 13 Sep 2004 18:54
Location: Hong Kong, China

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

Post by siu238X »

Arda wrote:Zuu: I cant move the signals as this is just a block that will be copied 30-40 times into a full main line. (without the stations and depoes.)
If i dont have any singals on the overtake line then it only takes just one train to block the entire line. You had no way of knowing that though. I just wanted to mention it.

I gradualy reduced the signal back penalty until the "waiting for free path" train started moving on the overtake line. I had to set it as low as 210 - down from 1500.

It works now. I still have to do some tweaking, but the design as i wanted it is starting to take shape.

Arda

I also met similar problem, and my solution is to put a plain one-way signal at the straight route, about a block or two after the junction (NOT immediately after -- I did not want it to be an exit-signal). This enables robust movement, and even if the other track is occupied by trains from adjacent line or the other side, the train moving forward won't foul the junction.

To be a bit more elaborate...

Code: Select all

   =>===]==]==>===
     x         x
   =}={=======}={=
     x         x
   ===<==[==[===<=

  > = One-way YAPP signal
  } = YAPP signal
  ] = One-way plain signal
  x = scissors crossover
In other words, I make crossovers for minimum of every *two* blocks instead of one.
If trains want to overtake they should spend more length to do it anyway.
Image
Image
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests