Signals in tunnels and on bridges V3.02 r24031
Moderator: OpenTTD Developers
Re: signals in tunnels V12 r15755
you're probably searching for the "chunnel" patch.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15755
http://www.tt-forums.net/viewtopic.php? ... 75&start=0simplexio wrote: Any idea where to find patch that enables tunnels under sea. It would be much better idea to build tunnels under sea that those slow bridges.
The patch was split in three see first message.
You can find instructions in the above link.
Updated patch to trunk
Regards HackaLittleBit
Re: signals in tunnels V12 r15755
If thats included in the version up for download at the moment (in the zip) then I must be doing something stupid because I copied that exactly and, nothing. It just builds the 3 tile tunnel to the sea edge.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15755
Kanibal wrote:If thats included in the version up for download at the moment (in the zip) then I must be doing something stupid because I copied that exactly and, nothing. It just builds the 3 tile tunnel to the sea edge.

Give me some time (dinner time) and I will correct it.
Sorry for the inconvenience.
EDIT check first page for latest update
Regards.
Re: signals in tunnels V12 r15833
No inconvenience, I just thought I was going a bit loopy for a while there.
You're patches are the most notable ones out there, your work is much appreciated and seems brilliantly stable, calling them hacks doesn't change their brilliant addition to the game. I hope you keep it up, and that someone keeps posting windows binaries so I can test them out, or posts nice detailed instructions how I can complie them on my linux computers.
I'd love to help test out new patches of yours, really great leaps forward.
Looking forward to more,
~Kan
You're patches are the most notable ones out there, your work is much appreciated and seems brilliantly stable, calling them hacks doesn't change their brilliant addition to the game. I hope you keep it up, and that someone keeps posting windows binaries so I can test them out, or posts nice detailed instructions how I can complie them on my linux computers.
I'd love to help test out new patches of yours, really great leaps forward.
Looking forward to more,
~Kan
Re: signals in tunnels V12 r15833
http://wiki.openttd.org/Coding_Tools#Linux...or posts nice detailed instructions how I can complie them on my linux computers.
Re: signals in tunnels V12 r15833
I must be having a bad couple of days, how come I never found that before, dunno. Thanx for the link though, much appreciated.
Re: signals in tunnels V12 r15833
I would like to use this in a network I'm building since there are places where I need like 5 or more tunnels to allow traffic to pass under something, and with this I can use just one. But as it is now I can't because the presignals don't work through the tunnels if it the patch is enabled. A lot of the time, if I'm making something complicated, there's no option except to run presignals through tunnels, as you can't put bridges over other bridges or stations etc.
Would it be possible to allow presignals to 'see' through the tunnels as the do normally?
Also one other thing I noticed, it seems the option setting is not saved and loaded with the save games, which I think you would want, since things aren't going to run very well if someone loads made with the patch and the setting off. Is this just disabled for now to keep the savegames compatible?
BTW It's exciting to think how much smaller it will be possible to build stuff using this patch, thanks for putting it together, I'm looking forward to playing around with it
Would it be possible to allow presignals to 'see' through the tunnels as the do normally?
Also one other thing I noticed, it seems the option setting is not saved and loaded with the save games, which I think you would want, since things aren't going to run very well if someone loads made with the patch and the setting off. Is this just disabled for now to keep the savegames compatible?
BTW It's exciting to think how much smaller it will be possible to build stuff using this patch, thanks for putting it together, I'm looking forward to playing around with it

Re: signals in tunnels V12 r15833
Does this patch work on 0.7.0?
Does it work on prev savings, cant make the trains to go in a tunnel without the first has exited
Am I doing anything wrong?
Does it work on prev savings, cant make the trains to go in a tunnel without the first has exited

Am I doing anything wrong?
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15833
IguannaB Do me a favor and post a picture of your track situation.IguannaB wrote: Would it be possible to allow presignals to 'see' through the tunnels as the do normally?
I am still testing and yes in a way it is possible to look through the tunnel.
If you look at the code in signal.cpp you can see that I changed this line to avoid a loop while building a tunnel in a rail circle
Code: Select all
if (_settings_client.gui.simulate_signals_in_tunnel && IsTunnel(tile)) continue; // avoid loop
No not in experimental feature.Kanibal wrote:the option setting is not saved and loaded with the save games
Don´t know I work with trunk.Roye wrote:Does this patch work on 0.7.0?
Are you using block signals?Roye wrote:Does it work on prev savings, cant make the trains to go in a tunnel without the first has exited
Am I doing anything wrong?
Did you enable the patch?
Tell me more about that one please.
regards
Re: signals in tunnels V12 r15833
I don't remember it well, but Owens (not ORudge) might know a nice solution, he played around with "not" signals (signals being green when the next signal is red) and he found that circular loops are a bad idea in this kind of experimentshackalittlebit wrote: if you would take that line out your request would be honored. The thing is that I do not know an other way of preventing that loop.(nice way)
I think he limited the number of signals to look through, but I might confuse it with the solution I suggested him
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15833
Thanks Wolf01
Am banging my head already a while on that one. (waiting for the eureka, but it did not come yet
)
The code without that line is much nicer but I would like to avoid a ugly counter and extra global var.
Am banging my head already a while on that one. (waiting for the eureka, but it did not come yet

The code without that line is much nicer but I would like to avoid a ugly counter and extra global var.
Re: signals in tunnels V12 r15833
What is the problem with the loop?hackalittlebit wrote:If you look at the code in signal.cpp you can see that I changed this line to avoid a loop while building a tunnel in a rail circleif you would take that line out your request would be honored. The thing is that I do not know an other way of preventing that loop.(nice way)Code: Select all
if (_settings_client.gui.simulate_signals_in_tunnel && IsTunnel(tile)) continue; // avoid loop
When I commented out this line it behaved normally and I couldn't find any problems (program hanging or otherwise). The way the combo signals stay green if they can 'see' themselves due to being in a circle of track is normal, and can also be useful (example of this being used in pic at bottom).
- Attachments
-
- Looping presignal through tunnels.PNG (79.51 KiB) Viewed 7878 times
-
- Example of something using combo in loop.PNG (83.83 KiB) Viewed 7875 times
Re: signals in tunnels V12 r15833
I am a very big noobhackalittlebit wrote:Don´t know I work with trunk.Roye wrote:Does this patch work on 0.7.0?
Are you using block signals?Roye wrote:Does it work on prev savings, cant make the trains to go in a tunnel without the first has exited
Am I doing anything wrong?
Did you enable the patch?
Tell me more about that one please.
regards


Can you please tell me how to make it work?
Thx.
Roye
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15833
See picIguannaB wrote:What is the problem with the loop?
IguannaB
Will give more comprehensive answer, give me time to test etc.
Tested this and that works.
Train stops in front of pre signal until other train left station. Regards
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15833
Hmmmmm scratch scratch.Roye wrote: I am a very big noobon patch use in general, and theres is so much to read and search through to find answers, so I just downloaded the file and placed it in"data"-folder in my openTTD and hoped it would work
.
Can you please tell me how to make it work?
Copy OPENTTD folder to let say "test" folder
unzip the zip file and copy content over your "test" folder. should work
(windows OS)
Regards.

EDIT changed IguannaB in Roye
sorry IguannaB
Last edited by HackaLittleBit on 07 Apr 2009 10:26, edited 2 times in total.
Re: signals in tunnels V12 r15833
Ehm, I don't want to be too much pernickety, but placing signals that way is enough aleatory, you can make "memory" cells so signals stay red without being connected to a piece of track with a train on itIguannaB wrote:What is the problem with the loop?hackalittlebit wrote:If you look at the code in signal.cpp you can see that I changed this line to avoid a loop while building a tunnel in a rail circleif you would take that line out your request would be honored. The thing is that I do not know an other way of preventing that loop.(nice way)Code: Select all
if (_settings_client.gui.simulate_signals_in_tunnel && IsTunnel(tile)) continue; // avoid loop
When I commented out this line it behaved normally and I couldn't find any problems (program hanging or otherwise). The way the combo signals stay green if they can 'see' themselves due to being in a circle of track is normal, and can also be useful (example of this being used in pic at bottom).
This might be achieved in various ways, I let you the pleasure to discover all of them, and I think this is a bug of the signalling system.
- Attachments
-
- signal_bug.PNG (42.75 KiB) Viewed 7754 times
Re: signals in tunnels V12 r15833
Um, that was Roye that said that not me, actually I'm not that big, more kinda skinnyhackalittlebit wrote:IguannaB wrote: I am a very big noobon patch use in general, and theres is so much to read and search through to find answers, so I just downloaded the file and placed it in"data"-folder in my openTTD and hoped it would work
.
Can you please tell me how to make it work?

hackalittlebit: Yeah, I should have tested with train running in the loop, it hangs without that line I see. The code went a bit over my head, but I did notice it was ok if using 2way signals in place of tunnel entrance and exit, so wondered what is different between the 2 scenarios, or if the tunnels could be made more like the signals to avoid the issue.
Would using a recursive function where the list of tile+trackdirs already visited is passed as an argument instead of a while loop help solve the endless looping problem? Just an idea - I don't really understand what's going on so can't help much, sorry. If you would like to explain it some more, maybe I can though.
Wolf01: Thanks for your advice, it's always welcome and I don't think you're being pernickety (I had to look that word up, and aleatory too, damn it)

In the case above, it's not memory cells I'm using the combo in a loop for, but a timer. It's setup so you can spin the exit signal and stop the timer, however problems arise if the green presignal 'pulse' from the timer is interrupted (turns red) too soon as trains elsewhere stop at signals which they would otherwise have passed. The combo in a loop holds the presignal output green until the timer train enters that part of the timer where the 'pulse' would be red, preventing this problem, so you can spin the exit signal to stop it any time. I don't see this behavior as a bug - combos are red if all presignals they can see (including them selves) are red, otherwise they're green, which makes logical sense to me.
- Attachments
-
- test.PNG (36.68 KiB) Viewed 7709 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels V12 r15833
Yeah saw it and changed it. Sorry about that one.Wolf01 wrote:Um, that was Roye that said that not me, actually I'm not that big, more kinda skinny
Solved loop problem.
see http://www.tt-forums.net/viewtopic.php?p=754430#p754430Expresso wrote:Isn't it better to make a tunnel have signals in it by letting the player build a signal on the tunnel entrance?
Now that is possible.
Very experimental just pretend your building signal on tunnel or bridge entrance
will set bit class 9 m5 bit 5 now the tunnel bridge will behave as if it has signals.
remove signal from entrance will revert this behavior.
please give suggestions and find bugs.
This is experimental code and most probably I will remove the signal bridge simulation.
But it is for you to get a taste of what is possible.
Happy Easter everybody
HackaLittleBit
- Attachments
-
- signaltunnel_V15_r16034.patch
- (20.13 KiB) Downloaded 322 times
-
- bridgesig.png (41.7 KiB) Viewed 7501 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: signals in tunnels and on bridges V16 r16138
Hello folks.
My patch is starting to become ready to go to flyspray.
I have no known bugs.
The patch starts to have a solid feeling
(thanks Smatz)
Now you can designate individually a bridge or tunnel with signal simulation.
Just use the signal building tool and click on the tunnel, bridge entrance.(cost is length / 4)

just to give you an idear of the distance 8 tiles.
The patch is designed to take as little processor time as possible.
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.
Before I submit I would like to know any of your wishes and suggestions.
See my wiki for a more detailed descriptionhttp://wiki.openttd.org/User:HackaLittleBit
In my first post you can find win binary and latest patch.
Have fun and regards
HackaLittleBit
My patch is starting to become ready to go to flyspray.
I have no known bugs.
The patch starts to have a solid feeling

Now you can designate individually a bridge or tunnel with signal simulation.
Just use the signal building tool and click on the tunnel, bridge entrance.(cost is length / 4)
just to give you an idear of the distance 8 tiles.
The patch is designed to take as little processor time as possible.
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.
Before I submit I would like to know any of your wishes and suggestions.
See my wiki for a more detailed descriptionhttp://wiki.openttd.org/User:HackaLittleBit
In my first post you can find win binary and latest patch.
Have fun and regards
HackaLittleBit
Who is online
Users browsing this forum: No registered users and 20 guests