Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Mar 29, 2017 7:21 am

All times are UTC




Post new topic  Reply to topic  [ 452 posts ]  Go to page 1 2 3 4 523 Next
Author Message
PostPosted: Fri Mar 11, 2005 8:27 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
I've been working on path based signaling (a brilliant idea from the ttdpatch people) recently and i decided to post the patch here so people can test it, and help a bit with finding bugs of course :wink:

Path based signaling will allow more then 1 train on a junction at a time, provided their paths don't cross. This works by letting the trains 'reserve' the path they are planning to take. Reserved tracks are shown darker as normal tracks. (see screenshot)

You build such a PBS-junction by making all signals (entrance and exit) to that junctions PBS signals, you do this by ctrl-clicking 4 times on a normal signal.

For this patch to work, you need to put nsignalsw.grf (made by Michael Blunck) in your /data directory.
Get this file at Michael's site -> Download -> nsignalsw.zip , or in the 'new graphics' section at the TTDPatch Website.

Its best to only use 2-way signals at dead end exits, like terminus stations.

Also, PBS needs NPF (new pathfinder) enabled, otherwise it won't work.

Known bugs:
    - the darkened track don't display 100% correctly on all tiles (not really a bug, just a gfx glitch)
    - [fixed] a crashed train wont release the tracks it has reserved


If you find any other bugs, post here or contact me at IRC.


Attachments:
File comment: Windows build, based on r2470 (v080)
pbs8.zip [1020.73 KiB]
Downloaded 1501 times
File comment: The .diff, based on r2470 (v080)
pbs8.diff [65.97 KiB]
Downloaded 1160 times

_________________
DopeFish Lives!!!


Last edited by Hackykid on Tue Jun 21, 2005 10:19 pm, edited 58 times in total.
Top
   
 Post subject:
PostPosted: Fri Mar 11, 2005 8:40 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Sep 10, 2004 8:25 pm
Posts: 325
Wow that seems great.

Maybe a new great featuere for this great game. :D


Top
   
 Post subject:
PostPosted: Fri Mar 11, 2005 8:51 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun May 23, 2004 1:19 pm
Posts: 27
Location: Germany
Could anyone compile it for win32? :)


Top
   
 Post subject:
PostPosted: Fri Mar 11, 2005 9:27 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
I have added a build for windows, see first post.

_________________
DopeFish Lives!!!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 12:43 am 
Offline
Engineer
Engineer
User avatar

Joined: Sun May 23, 2004 1:19 pm
Posts: 27
Location: Germany
Thanks!

First impression is very good, this really could revolutionize railbuilding ;)
It seems in some cases reserved track won't be released after a train
used it. Most time this happened on big junctions/stations (used older
savegames), but I got this bug appear on a small junction,
see screenshot. The train will wait there forever.


Attachments:
pbs-bug.png
pbs-bug.png [ 29.8 KiB | Viewed 29566 times ]
Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 1:12 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
hmm, yes, i see

Unfortunately i cant really see what would cause that from the screenshot.

Did you have NPF enabled? ( i forgot to mention this at first, but it is really needed)

Otherwise, i cant really see what could have caused this...

Hmm, i'll try building a similar setup and see if it happens to me too...

EDIT:
ok, i think i know what caused this

the problems started with the pieces of straight track between the station and the junction. because it has semaphores on each end, its treated as a pbs-block, and that setup can cause grid-locks.
This will lead to a train timing out at a signal and reversing, and reversing is not properly handled yet.

So, what you can do, it place a normal signal on those straight tracks, or remove the semaphores on the straight tracks.

Also demolishing a square (with the dynamite) and then rebuilding the track will reset the 'reserved' status.

_________________
DopeFish Lives!!!


Last edited by Hackykid on Sat Mar 12, 2005 2:20 am, edited 2 times in total.

Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 1:41 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Wed Jan 12, 2005 9:56 pm
Posts: 701
Location: Lisboa, Portugal
looking good, can't wait to try this out :mrgreen: (I'll wait until development is almost finished, I like my subsidiaries patch :oops: )

btw any hopes of getting this merged into the trunk when it's done? :roll:

_________________
Uncle Dex Says: Follow the KISS Principle!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 9:30 am 
Offline
Engineer
Engineer

Joined: Mon Jun 23, 2003 7:31 pm
Posts: 106
Location: Tirol/Austria
hackykid, are the semaphore signals just for style or are they necessary? :=) (in other words: can i use normal signals?)

_________________
to everyone who's coding on openttd: YOU ROCK !!!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 12:20 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Dec 13, 2004 9:13 pm
Posts: 202
Location: Rodos, Greece
I've noticed that, on a busy pbs block, if the (only)line a train entering the block is blocked (red signal at the exit), the train will go somewhere else, instead of just waiting, reverse when it has the chance, and come back to the junction.

Here's a pic:
The grain train on the junction is going to the left exit. When it entered the block, the signal was red because of the livestock train on the left, so the grain train went straight ahead. Shortly after, the signal went green so the train changed its path to go where it should. But if the track wasn't freed quickly enough, the train would continue to the wrong direction.
I should add that they don't go very far off to reverse, but still, its anoying.
[I marked red the path the trains normally take]


Attachments:
File comment: weird path
pbs-block.png
pbs-block.png [ 22.43 KiB | Viewed 29463 times ]
Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 12:55 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
hmm, yes, that is indeed a problem....

Ok, I've thought of a way too fix this, but it'll be a bit of work, I'll probably start working on it today.

Until its finished, I'll add this to the known bugs list.

_________________
DopeFish Lives!!!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 3:39 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Wed Jan 12, 2005 9:56 pm
Posts: 701
Location: Lisboa, Portugal
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:

_________________
Uncle Dex Says: Follow the KISS Principle!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 3:44 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun May 23, 2004 1:19 pm
Posts: 27
Location: Germany
OK, with normal signals on the track it works. Maybe tracks
with just 1 exit (2 ends) should never be treated as pbs junctions...
I also realized that removing reserved track does not work
(at least sometimes..) In the savegame from the example, I
tried to remove the dark track. I heard the removing-sound,
but the track was still there (only on the screen). when I
tried to remove it again, it said there is no track to remove.
Only demolishing works.

EDIT:
Got a similar problem to that of StavrosG. Same junction as
above, with signals on the straight track. One train coming from
the bottom wanted to go to the station. As the exit semaphore was red
because of another train on the track, the train reserved the track
to the exit top right. Just in that moment, the exit semaphore to the
station turned to green, so the train changed its way, but did not release
the old track.

Maybe a little workaround would be to auto-release reserved tracks after
let's say 30 seconds.

EDIT2: I was not able to reproduce this bug, maybe there were some
other circumstances.


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 5:15 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Feb 24, 2003 6:45 pm
Posts: 3051
Location: Hong Kong
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.

_________________
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."


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 5:52 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 02, 2002 6:57 pm
Posts: 5552
Location: Ithaca, New York
Hackykid wrote:
hmm, yes, that is indeed a problem....

Ok, I've thought of a way too fix this, but it'll be a bit of work, I'll probably start working on it today.

Until its finished, I'll add this to the known bugs list.


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.

_________________
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 6:48 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
Zahl wrote:
Just in that moment, the exit semaphore to the
station turned to green, so the train changed its way, but did not release
the old track.


hmm, when a train changes its way, it should defenately release all tracks it had reserved previously, are you sure this is what happened?

I know about trains going the wrong way when the only singal leading to where they go is red, and I'm almost done with a fix for that, I'll probably post it tonight.

_________________
DopeFish Lives!!!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 6:57 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Wed Jan 12, 2005 9:56 pm
Posts: 701
Location: Lisboa, Portugal
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.


great, can't wait to get my subsidiaries with this :mrgreen:

It's a pity you need to use semaphores though, but I can understand why :?

_________________
Uncle Dex Says: Follow the KISS Principle!


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2005 8:29 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
UPDATE:
new version (v050), the bug where trains would go the wrong way when the way they wanted to go was red, is fixed now,

look at the start post for the .diff and the windows build


btw, this version changes my implementation quite a bit, and has not been tested as extensively, so there *may* be more other bugs introduced by it.....

_________________
DopeFish Lives!!!


Top
   
 Post subject:
PostPosted: Sun Mar 13, 2005 2:20 am 
Offline
Engineer
Engineer

Joined: Sat Feb 05, 2005 4:04 pm
Posts: 39
Just tested this.

Looking good, but if a train breaks down at a certain point, the next train crashes straight into it.

In this savegame, the train on the LHS of the screen is just about to go through a red light, find a free path (which is covered by a broken train) and crash.

Mark


Attachments:
test-pbs-3.sav [70.31 KiB]
Downloaded 416 times
Top
   
 Post subject:
PostPosted: Sun Mar 13, 2005 11:49 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Nov 22, 2004 4:04 pm
Posts: 157
Location: Eindhoven de Gekste!!! (ongeveer ;P)
ah, well, your problem is not that trains are breaking down, but that they enter a pbs block without reserving tracks when they cant find a route to their destination.

You placed one of your signals the wrong way, which meant the train could not find a path.

I have now fixed this, trains who cant find their destination wont enter PBS-blocks. (v051)

The .diff and the windows build are in the start post.

_________________
DopeFish Lives!!!


Top
   
 Post subject:
PostPosted: Sun Mar 13, 2005 3:34 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Mon Dec 13, 2004 9:13 pm
Posts: 202
Location: Rodos, Greece
I've been suffering from a very nasty bug in v050, which ends in an Assertion fail:
Code:
[16:06]stavrosg@lorien trunk$ ./openttd
openttd: train_cmd.c:2943: TrainCheckIfLineEnds: Assertion `trackdir != 0xff' failed.
Ακυρώθηκε
[16:50]stavrosg@lorien trunk$


Savegame + config file in archive: Watch Train 14.


Attachments:
pbs_error2.tgz [372.95 KiB]
Downloaded 351 times

_________________
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.
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 452 posts ]  Go to page 1 2 3 4 523 Next

All times are UTC


Who is online

Users browsing this forum: Amak and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.