YAPF - Testers needed!

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

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

Post by Wolf01 »

it is because you used 2 way signals, if you usa one way signals the train waits at the signal of the right branch (but you have to use roro stations)
pshemko
Engineer
Engineer
Posts: 104
Joined: 24 Sep 2004 02:43
Location: Aotearoa (New Zealand)

Post by pshemko »

I think i found another problem:

Code: Select all

     D             
-s---X--S-PPPPPPP2
-s---X--S-PPPPPPP1
D - depot
S - signal (two way)
s - signal (one way)
P - platform.

If i have a train in platform one and i send it to the depot I can't send the second train (in the second platform) to the depot (message: can't find path to the depot) until the two way signal changes to green, which is really annoying, especially on busy terminus stations.
AdeV
Engineer
Engineer
Posts: 6
Joined: 28 May 2006 15:00
Location: United Kingdom

Logjam!

Post by AdeV »

This is a ridiculous track.... but YAPF stops using the inner tracks too soon, resulting in the logjam shown.

To reproduce: Load the save-file, then set all but 2 trains going from the depot (to seize it up sooner, send them all out).
Attachments
Kenhall Transport, 25th May 1952.jpg
(433.79 KiB) Downloaded 354 times
Kenhall Transport, 24th Jun 1951.sav
(88.74 KiB) Downloaded 281 times
Cheers!
Ade.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

strange, i always tought that with YAPF trains will choose the track which has less signals if both tracks are of the same lenght and bring to the same point (like your screenshot)
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

OK, guys, i see that devs were right that users will get confused and will not understand how the two-way signals work with YAPF. If the first two way signal (first from the current train position) is red, then it is treated as NO-WAY. If you have troubles with it, switch that behavior off:

in the config file (section [yapf]) find the following line:

Code: Select all

rail_firstred_twoway_eol = true
and change it to:

Code: Select all

rail_firstred_twoway_eol = false
and then tell me if it helped. thanks
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

Wolf01: there is no penalty for green signals. Only red ones from the first 10 signals generate path cost penalty by default.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

I have a pretty stupid bug here. Build a depot without any connected roads, then a bus and then start that bus. Click on the bus and try to send it to the depot; it will say it cannot find the route to the depot. It becomes really hard to sell such a vehicle when you cannot send/stop it in the depot. Don't ask me how, but the user did it again ;).

Desired behaviour: find depot from inside the depot, just like with NPF.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

AdeV: try to make all 4 paths identical - i.e. 12 signals on each with the same layout (distances). Red signals will get penalty so trains will balance between paths.
pshemko
Engineer
Engineer
Posts: 104
Joined: 24 Sep 2004 02:43
Location: Aotearoa (New Zealand)

Post by pshemko »

KUDr wrote:OK, guys, i see that devs were right that users will get confused and will not understand how the two-way signals work with YAPF. If the first two way signal (first from the current train position) is red, then it is treated as NO-WAY. If you have troubles with it, switch that behavior off:
I guess that's not about being confused about the way it works but rather about expecting different behaviour - if the train is next to the depot and I hit 'go to a depot' button it shouldn't display a message that it can't find a way - that's what's confusing.
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

Darkvater: yes, finally something that looks like real bug. Will look at it. thanks
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

KUDr wrote:OK, guys, i see that devs were right that users will get confused and will not understand how the two-way signals work with YAPF. If the first two way signal (first from the current train position) is red, then it is treated as NO-WAY.
Actually, I'm happy with this behaviour, it allows me to "override" YAPF's standard balancing with my own balancing :).
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

pshemko: it is only logical consequence. And you expect something else because you either don't understand what NO-WAY or DEAD-END means or you don't know that first red signal is treated as dead-end by default. This is what i meant with "confused". I agree, that if you don't know it, it can seem to behave incorrectly.

edit: and maybe i should change the first-red-signal behavior so, that if there was no junction (choice) between train and signal, the DEAD-END will not apply. Would it be better?
pshemko
Engineer
Engineer
Posts: 104
Joined: 24 Sep 2004 02:43
Location: Aotearoa (New Zealand)

Post by pshemko »

KUDr wrote:pshemko: it is only logical consequence. And you expect something else because you either don't understand what NO-WAY or DEAD-END means or you don't know that first red signal is treated as dead-end by default. This is what i meant with "confused". I agree, that if you don't know it, it can seem to behave incorrectly.[/qoute]

It's like with my windows box when I bought a new printer - I've installed the driver, windows told me that everything was fine, but when I tried to print it was complaining it couldn't communicate with the printer :-)

I believe that when most users clik 'go to a depot' button they expect the train to find a way if there is one, even if this requires waiting at a red signal. Just my 2c :-)
KUDr wrote: edit: and maybe i should change the first-red-signal behavior so, that if there was no junction (choice) between train and signal, the DEAD-END will not apply. Would it be better?
I think that it would be. If there is only one way, even if it's blocked it should be chosen - there is no other alternative.

Beside - I didn't notice this problem with 'regular' pathfinding - ie when a train wants to leave a terminus station to get to the next one it doesn't complain about the 'lack of path' - just patiently waits.

Now i'm only waiting for 'track reservation' - pbs like ;-)
User avatar
sidew
Engineer
Engineer
Posts: 115
Joined: 31 Aug 2005 06:46
Location: Milan, Italy
Contact:

Post by sidew »

A question: is possible to add the option to forbid 90 degree turns, like the actual option for NPF?
Sidewinder

Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

There is one, enable NPF and disable 90 degree turns, it will also work with YAPF.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

sidew: it works also with YAPF (and better, you don't need to switch NPF on). It was dependent on the NPF settings before. The current version in trunk doesn't need that. There is only wrong text ("requires NPF") in the GUI.
User avatar
sidew
Engineer
Engineer
Posts: 115
Joined: 31 Aug 2005 06:46
Location: Milan, Italy
Contact:

Post by sidew »

KUDr wrote:There is only wrong text ("requires NPF") in the GUI.

:oops: Thanks :D
Sidewinder

Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post by sc79 »

OK, guys, i see that devs were right that users will get confused and will not understand how the two-way signals work with YAPF. If the first two way signal (first from the current train position) is red, then it is treated as NO-WAY. If you have troubles with it, switch that behavior off:

in the config file (section [yapf]) find the following line:
rail_firstred_twoway_eol = true
and change it to:
rail_firstred_twoway_eol = false
and then tell me if it helped. thanks
Firstly, changing that setting has zero effect on the setup in the screenshot, which doesnt work because the EOL code forces the train into the depot. Im assuming with it set to false, the train should ignore the depot and wait at the red signal. I do wonder if having to turn that off for what is, imo, a silly pathfinding decision, will mean losing functionality in other layouts; but I havent been playing with YAPF enough yet.
Attachments
Pretfingford Transport, 24th Feb 1940.png
(242.64 KiB) Downloaded 304 times
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

sc79: i don't know what silly decision you are talking about. But in your railway design the change mentioned will help. Try to change it in config and then start new game (don't load existing savegame, where the old config was saved and will override the new one), or change the setting using console. Advanced users can use the default yapf behavior for better optimizing their network, but yes, in such cases as yours it can be disturbing. For such users as you are, the recommended setting change should help. Or you can change your signal to pre-signal and add one exit signal between it and depot.

Or simply make your railway design better - place your depot close to the station (on crossing) and use two-way exit signals at the station and one way signals for connecting it to your network.

You cannot ask me to support all stupid railway designs - i can always show you many other stupid designs that will not work with any pathfinder.

And arguing that with some other pathfinder it does what you want, but with yapf it does something else will lead nowhere. Then only what i can tell you is to either:
- use another pathfinder
- use recommended config setting on new game to change its behavior
- learn more about how it works and how you can benefit from it

btw: the same as on your pic you can see with TTDP. This feature was there in original TTD too. It should help to prevent dead-locks when two trains would decide to pass the same signal from opposite directions. It also allows many advanced features such as waiting loops and so on.

edit: using the game console you can switch it off during gameplay - with immediate effect:
patch yapf.rail_firstred_twoway_eol 0
R2
Engineer
Engineer
Posts: 90
Joined: 08 Mar 2006 09:53

Post by R2 »

What really would be great was a pathfinding that makes trains not change course if not needed. Look at the station picture: I want that train to move straight over that junction even though the way to that platform is a bit longer. When there will be PBS with YAPF such behaviour just brakes other trains.

The trains on the picture is supposed to unload and than pick the slope at the upper left end of the picture where you can see the other trains coming out of the depot. With current pathfindung, it crosses all slopes when coming from the bridge to get to platform 1 and then crossing all slopes again to get out of the station's peripherie.

Trains simply shouldn't change their slope as long as they haven't to, even though they need to go a slightly longer distance: Look the small picture, there is no need at all to change the slope.

Will this be fixed?
Attachments
18th Nov 1962.png
18th Nov 1962.png (19.44 KiB) Viewed 4654 times
Station.png
(205.39 KiB) Downloaded 183 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest