Signals on bridges

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
dev|ant
Traffic Manager
Traffic Manager
Posts: 140
Joined: 30 Nov 2005 11:26
Location: melbourne.au

Signals on bridges

Post by dev|ant »

I got bored :( so I wrote a patch that allows you to build signals on bridges. :D Bridges become just like normal track, so you can put semaphores, pre-signals, PBS, whatever. I've tested it in as many situations as I can think of, and it seems to be ok.

I've also included an auto-complete function. I think the signals gui patch has something like this. Anyway the way I've implemented it is if you hold the control key down while dragging signals, it will place signals all the way along the track (ie. around bends) until it hits a junction, tunnel, station, etc. Any bridges along the way get signals too. 8)

Signals on bridges aren't possible with the current map array, so to do this I had to move all the signal data to it's own location. This makes the map array about 25% larger, but I doubt anyone will notice.

This is just a proof of concept for now, so the code is ugly in places, but it seems to work. I'm posting it here to get some feedback, suggestions, bugs, whatever. Let me know what you think.

Version 0.3 has fixed the bugs found by thepizzaking and paijm021.
Attachments
signals.png
signals.png (17 KiB) Viewed 16786 times
signals_on_bridges_v0.3.diff
Bug free so far! For r3393.
(45.28 KiB) Downloaded 902 times
Last edited by dev|ant on 20 Feb 2006 11:37, edited 5 times in total.
egladil
OpenTTD Developer
OpenTTD Developer
Posts: 188
Joined: 07 Nov 2005 17:10
Location: Sweden

Post by egladil »

Why add an extra variable? Just use existing free space in the map array. See this and this for information on the map array.

However, I like the possiblities building signals on bridges give :) To bad it would be nontrivial to use this at same time as my yellow signals patch :(
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

IMO it's good to expend the current map array:

New map array is planned for 0.6.0 - I bet it would be around one-two years.

But let's go back to the current one. TTDP has got extended one - trams, custom bridge heads, tunnel enterances, one way roads... It's a big list of features coming with more space in the map array.
OTTD will have all of these and many more in 0.6.0 - but why to keep the community with the TTD map array while we can expand it and give the features way before 0.6.0?

Please consider this and post your opinions.

Now back to topic, I really like this patch. However, there is one thing I'd suggest:
When making a signals on bridges patch - don't put the signal completion, too. Devs don't like two-in-ones. Also IIRC signal completion is planned for 0.4.5 (Wiki says it's finished)
User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 180
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Post by BeSt-Com »

is there anybody who would compile that for Windows?? Please!!
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

BeSt-Com wrote:is there anybody who would compile that for Windows?? Please!!
http://openttd.webfreakz.nl/r3393_signa ... ridges.rar
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
BeSt-Com
Traffic Manager
Traffic Manager
Posts: 180
Joined: 25 May 2005 18:19
Location: Berlin/Germany
Contact:

Post by BeSt-Com »

@webfreakz.nl
thx very very much!
User avatar
dev|ant
Traffic Manager
Traffic Manager
Posts: 140
Joined: 30 Nov 2005 11:26
Location: melbourne.au

Post by dev|ant »

egladil wrote:See this and this for information on the map array.
Hmm, I might have thought twice about the new variable if I'd known about that page! I looked for space to add the data, but never found enough.
However, I like the possiblities building signals on bridges give :) To bad it would be nontrivial to use this at same time as my yellow signals patch :(
Actually I don't think it would be that hard. But they both mess with the signal code so much that if they were combined, they'd pretty much have to stay together!
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

can you please separate the 2 patches in 2 diffs.
I want only the signal autocompletion.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

signal autocompletion has been in ottd for a long time now...

you don't need a patch for that ;)
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

just downloaded it to see. autocomplete is DEFINITLY NOT in the nightly
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

Korenn wrote:signal autocompletion has been in ottd for a long time now...

you don't need a patch for that ;)
If you mean autocompletion in terms of signal junctions - yes, it is. But I am not talking about that. (read the posts on the top).
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

gkirilov wrote:If you mean autocompletion in terms of signal junctions - yes, it is.
whats this signal junction autocomplete you are talking about? that with pre-signals?

with auto complete
Attachments
if you had this
if you had this
Chondingtown Transport, 21st Jan 1950.PNG (14.11 KiB) Viewed 16333 times
you'd get this
you'd get this
Chondingtown Transport, 30th Jan 1950.PNG (14.56 KiB) Viewed 16328 times
and did this
and did this
Chondingtown Transport, 25th Jan 1950.PNG (13.89 KiB) Viewed 16327 times
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

OMG... i dont want to explain what i meant.
Korenn, probably wanted to say about the autocompletion for junctions(PBS) - (which is in the nightlies).
I want the autocompletion for straight tracks(which is in this patch and bobingabout showed).
bobingabout, read my posts.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
User avatar
thepizzaking
Traffic Manager
Traffic Manager
Posts: 198
Joined: 08 Aug 2005 07:47
Location: Melbourne, Victoria, Australia
Contact:

Post by thepizzaking »

Found a bug, if you have a bridge, and a straight track in the opossite direction underneath and you try and build signals on the bridge(directly above the other track), it won't work properly.

Edit: Great work by the way
I'm A Cobra (or so the rumours go) :)
Get OpenTTD, It's awesome!!
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

gkirilov wrote:OMG... i dont want to explain what i meant.
it wasn't for you, it was for korenn
gkirilov wrote:Korenn, probably wanted to say about the autocompletion for junctions(PBS) - (which is in the nightlies).
i see... its crap, i created a PBS junction, and it auto-completed, then i couldn't get rid of the PBS!!! every time i tried, it re-converted it.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
KING
Traffic Manager
Traffic Manager
Posts: 180
Joined: 12 Dec 2005 08:03

Post by KING »

you have to remove the ENTRY ones BEFOR it lets you remove the exit ones.
Personaly i have the auto PBS off cause it cause problems.
Image
User avatar
paijm021
Engineer
Engineer
Posts: 84
Joined: 14 Apr 2004 20:32
Location: Netherlands
Contact:

Post by paijm021 »

I patched a source with your diff and loaded a very complex 950 trains map
with it. Worked perfectly (fast!) and was stable for one hour. Your signal placement patch works good too. The signal denstity could be a bit higher on diagonal tracks.

There are many possibilities with signals on bridges. Thank you for it. Great work.
User avatar
paijm021
Engineer
Engineer
Posts: 84
Joined: 14 Apr 2004 20:32
Location: Netherlands
Contact:

Post by paijm021 »

BUG-Report,

As for as I know there are no bugs during play, but when you save and load afterwards signals disappear, change direction and some remain red. So there is something wrong with (at least) the 'save-array' concerning signals.

I think the bug is easy to reproduce, but if you need a savegame or anything else please say so. I used nightly r3393
User avatar
dev|ant
Traffic Manager
Traffic Manager
Posts: 140
Joined: 30 Nov 2005 11:26
Location: melbourne.au

Post by dev|ant »

Hmm, it should be ok with 3393, though I'm pretty sure I was using earlier revisions than that. I'll grab a copy of 3393 tonight and see what's going wrong.
McGrega
Engineer
Engineer
Posts: 1
Joined: 08 Feb 2006 16:05

Post by McGrega »

2dev|ant

Many thanks for the decision of the first biggest problem is an opportunity of installation of traffic lights on bridges.
But there was a second biggest problem are traffic lights in tunnels.
Whether the decision of this problem enters into your plans?

Thanks
Last edited by McGrega on 08 Feb 2006 23:14, edited 1 time in total.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 0 guests