Signals in tunnels and on bridges V3.02 r24031

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: signals in tunnels and on bridges V16 r16138

Post by Wolf01 »

hackalittlebit wrote:I have been thinking about the developers and I am hopeful that they include my patch.
In the future when real signals will be possible I think that it will be more processor demanding so this is a nice alternative.
It leaves a minimal footprint on the signal code and non on the pathfinding code.
I think they won't include this patch for this exact reason, to not make the work twice and to not break the savegame compatibility when this feature might be removed to include real signals on bridges/tunnels
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V16 r16138

Post by HackaLittleBit »

Wolf01 wrote:not make the work twice and to not break the save game compatibility
I did the work the first time so that one they don't have to do.
The code for placing signals on tunnels and bridges is vastly more complex and completely different.
save game compatibility is no big issue when you look at the code you will see that I set two bits on the tunnel bridge tile. If they would decide to go for an other system it would be very easy to reset those bits. Or as I said already this code could be complementary.

HackaLittleBit
Vitus
Traffic Manager
Traffic Manager
Posts: 157
Joined: 11 Mar 2009 15:15

Re: signals in tunnels and on bridges V16 r16138

Post by Vitus »

I'm not sure whether it is or isn't bug, but I'll post it anyways.

I tried to make priority on bridge with the signaled bridge. With one train on the bridge, all seems to work. Signal on the exit of bridge, facing inwards, is red and the priority works. However, when there are more trains on one bridge the signal goes green after the first train passes. I've experienced same behaviour with tunnels, too.

Same problem appears, when I tried to make the two-way tunnel just by using one-way block signals (the signalling you described on wiki doesn't seem to allow more than one train in tunnel/bridge and eliminates the purpose of the patch).

I'm not sure if this is intended behaviour, if yes, then sorry.

Also, here's savegame. As I don't compile at all, I used the build in your first post. I'm not sure how much "up-to-date" is the build, though.
Attachments
bug.sav
(14.67 KiB) Downloaded 159 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V16 r16138

Post by HackaLittleBit »

Vitus thanks for testing.

I really appreciate this.
Two way behavior I will check it out but I need some time for that.
The patch I made is mostly for one way traffic but I will have a long and hard look at it.

Regards
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: signals in tunnels and on bridges V16 r16138

Post by 2007Alain2007 »

You said you was thinking about takeing out the Bridge part of this patch please dont i realy think its great and it makes my railway net works look and run better

Also can you have a way of the player picking what single gos in the Tunnels and Bridges might be a good way to go for getting the two way single proble working.
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V16 r16138

Post by HackaLittleBit »

Vitus wrote:I'm not sure whether it is or isn't bug, but I'll post it anyways.
I think I solved that one.
Please be so kind and check it out.
Now you can have two way traffic with normal block signal but with more trains in the tunnel / bridge
Train will wait until tunnel / bridge is free.

By the way you can change the distance between trains in the advanced option screen(2,4,8,16 tiles).
Image

Regards HackalLittleBit
Attachments
signaltunnel_V17_r16177.patch
(24.04 KiB) Downloaded 194 times
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: signals in tunnels and on bridges V17 r16177

Post by 2007Alain2007 »

tested and all works a dream thanks for this great patch hope it gos in trunk soon
For Community Integrated Version http://code.google.com/p/civopenttd/
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: signals in tunnels and on bridges V17 r16177

Post by ZxBiohazardZx »

Anyone have a clue when this SUPERB patch gets implanted in newest stable release? (im not using revisions at the moment)

LOVE this work though, as you might know im doing a few mountain scenarions and i have some bridge going into tunnel without any tiles stuff so sometimes a train has to wait 20-40 tiles before it can resume, but with this i can have multi-trains in the long tunnel/bridge

1 question though

will this support my tunnel-after-bridge (aka will they be linked?)

T=Tunnel B=Bridge L=normal track

LLLLL TTTTTTTTTTTTTTTT BBBBBBBBBB LLLLLL

is that better then


LLLLL TTTTTTTTTTTTTTTT L BBBBBBBBBB LLLLLL

or would they be the same?
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: signals in tunnels and on bridges V17 r16177

Post by 2007Alain2007 »

I had a test with it and i think it should work the same and also its in my patch pack now i can upload a build if your like in my post
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V17 r16177

Post by HackaLittleBit »

ZxBiohazardZx wrote:will this support my tunnel-after-bridge (aka will they be linked?)
in CheckTrainStayInWormHole proc

after line

Code: Select all

if (v->u.rail.force_proceed || !IsFrontEngine(v)) return false;
Insret these lines

Code: Select all

TileIndex next_tile = TileAddByDiagDir(tile, ReverseDiagDir(GetTunnelBridgeDirection(tile)));
if (IsTunnelBridgeWithSignals(next_tile) && !IsTunnelBridgeExit(next_tile)) return false;
That should do the trick.

Not really tested this quick fix.
Vitus
Traffic Manager
Traffic Manager
Posts: 157
Joined: 11 Mar 2009 15:15

Re: signals in tunnels and on bridges V17 r16177

Post by Vitus »

Did a quick test of the new version and all seems to work well. The new version of patch not only allowed two-way signalled bridges/tunnel to be built, but you can make working priority over signalled bridge now (see attached savegame). I guess that ottdCoop will be happy about it. :)

Also, I included the few examples of the problem that ZxBiohazardZx was talking about. I hope it'll help you somehow.

Anyways, it is really wonderful patch. Thanks for it!
Let's hope it'll get into trunk soon. :)
Attachments
bridge.sav
(20.42 KiB) Downloaded 150 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V17 r16177

Post by HackaLittleBit »

Vitus wrote:few examples of the problem that ZxBiohazardZx was talking about. I hope it'll help you somehow
Fantastic work Vitus that really helps.
Image

Included patch that I think solves ZxBiohazardZx problem.
I made a exception when two tunnels/bridges are connected to each other.
In that case train just keeps going
I am not 100% sure about secondary effects of patch V18 (train reversing, traffic jams near tunnel/bridge with signal )
also included binary V18 Beta.


They are however good for testing and I would appreciate if people would do that.

Regards
Attachments
Vitus.png
Vitus.png (21.95 KiB) Viewed 1691 times
signaltunnel_V18_r16180.patch
(24.08 KiB) Downloaded 160 times
Last edited by HackaLittleBit on 29 Apr 2009 09:08, edited 1 time in total.
Vitus
Traffic Manager
Traffic Manager
Posts: 157
Joined: 11 Mar 2009 15:15

Re: signals in tunnels and on bridges V17 r16177

Post by Vitus »

I'm glad to help. :)

I've tried v18 and found two bugs so far. Everything should be in the savegame, but just to be sure: trains between two bridges seems to run into eachother, when the first one is stopped (e.g traffic jam or other kind of traffic problem ahead). They won't crash, though. Also, when you click on vagon/engine, which is on entrance/exit tile of bridge (happens with tunnels, too), it shows all trains currently on bridge/tunnel.

Aside from that, everything seems to work perfectly.
Attachments
bridge2.sav
(18.47 KiB) Downloaded 152 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V17 r16177

Post by HackaLittleBit »

Vitus wrote:Also, when you click on vagon/engine, which is on entrance/exit tile of bridge (happens with tunnels, too), it shows all trains currently on bridge/tunnel.
That is feature for tunnels only so I fixed that one.
Now when you click on tunnel entrance you will be able to see trains that are inside.
trains between two bridges seems to run into eachother
Fixed!

Thanks Vitus

attatchments is experimental software!

HackaLittleBit

EDIT: NOW WITH NEW TITLE SCREEN :D (Better now ChillCore?)
Last edited by HackaLittleBit on 29 Apr 2009 09:22, edited 1 time in total.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: signals in tunnels and on bridges V17 r16177

Post by ChillCore »

Hi hackelittlebit.
I just had a quik look at your patch.
When i fired up the binaries you posted i had a savegame off mine as the titlescreen.
Should that happen?

I will test some more tomorrow.

EDIT:
I compiled myself now and I am getting the normal titlescreen.
I recall trying converting a savegame to title.dat a few months ago.
It did not work then because of newgrf. Maybe it is a left over from that time that now pops up.
I just do not understand it not happening with other ottd versions as they share data folder. (Only the config file for my test with the precompiled binaries is local and i only changed signal distance to 2 and autosave off.)
Most likely the problem is on my side.
/EDIT
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: signals in tunnels and on bridges V17 r16177

Post by ZxBiohazardZx »

hackalittlebit wrote:
Vitus wrote:few examples of the problem that ZxBiohazardZx was talking about. I hope it'll help you somehow
Fantastic work Vitus that really helps.
Image

Included patch that I think solves ZxBiohazardZx problem.
I made a exception when two tunnels/bridges are connected to each other.
In that case train just keeps going
I am not 100% sure about secondary effects of patch V18 (train reversing, traffic jams near tunnel/bridge with signal )
also included binary V18 Beta.


They are however good for testing and I would appreciate if people would do that.

Regards

lol you named the problem after meXD i was just wondering for bridge/tunnel combo's because they are realistic, i dont mind the extra normal tile, but i was simply wondering, glad i can help you improve this patch:)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: signals in tunnels and on bridges V17 r16177

Post by ChillCore »

NOW WITH NEW TITLE SCREEN (Better now ChillCore?)
I kinda liked seeing it there, its my first game with ecs vectors and pbs. I just wonder where you got it ?
I never posted that.
It's cool if you want to use it but then it would better to extend with your new features.
The new one is a bit calm ...

ps:
This is how far i got untill i started patching.
It could be you will need some grf ...
Attachments
chicop eerste 07.sav
(147.87 KiB) Downloaded 146 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: signals in tunnels and on bridges V17 r16177

Post by HackaLittleBit »

ChillCore wrote:I just wonder where you got it ?
Don't know :?: The only thing I know is that I did not use regedit :twisted:
Vitus
Traffic Manager
Traffic Manager
Posts: 157
Joined: 11 Mar 2009 15:15

Re: signals in tunnels and on bridges V17 r16177

Post by Vitus »

hackalittlebit wrote:That is feature for tunnels only so I fixed that one.
Oh, silly me. And I though it was a bug :roll:

However, tried last version of your patch and everything seems to work perfectly now. Also, I've tried to load one of openttdcoop games (was PSG 138 I think) and played with the bridges a bit. Everything seems to run smoothly. Oh, and old savegames are compatible with your patch, which is great!

Thanks for your effort!
ZxBiohazardZx
Tycoon
Tycoon
Posts: 1534
Joined: 14 Mar 2006 12:46
Location: Netherlands

Re: signals in tunnels and on bridges V17 r16177

Post by ZxBiohazardZx »

will this patch be included in next stable release? im dying for it lolz
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests