The International Simutrans Forum

 

Author Topic: Multi-aspect signals  (Read 2680 times)

0 Members and 1 Guest are viewing this topic.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Multi-aspect signals
« on: January 03, 2014, 02:59:26 PM »
Hi,
I think it would be great to have multi-aspect signals for railways, though I guess it would require quite a bit of programming work and some kind of switch in the signal properties window.


I'm thinking of a situation like this, with single-track line:

STATION A
platform1 -- presignal --- signal <--> station B <--> station C <--> station D <--> ...
platform2 -- presignal _/

When going from A to D, signal should be a longsignal to avoid having two trains stuck (e.g.) at B and C facing each other.
When going reverse, from D to A, instead we'd need signal to be a choosesignal, so that trains (belonging to the same line, thus with the same routing) would use all the platforms available.

What do you think?

Normally I would make a crossing station at C, with one platform eastbound and one westbound each presenting a longsignal at its end. That however requires quite a regular service, while in this case, after D, my track joins a two-track line with mixed traffic, so I can't really rely on such a solution and, due to limited space, I can't build a station on the junction with side-tracks to park trains waiting for the line to clear.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #1 on: January 03, 2014, 03:37:19 PM »
Programming the logic isn't so bad. Making it understandable to the player is the big issue. How to build such signals, how to modify them, interactions with dragging singals, and such things. Simutrans has a very steep learning curve already, with signals probably being one of the hardest things to understand.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Re: Multi-aspect signals
« Reply #2 on: January 03, 2014, 03:53:52 PM »
Yes, I think it could be a thing meant for advanced users.
Maybe one could build signals as usual (i.e. no new buttons on the toolbar), and then could turn a standard signal into a multiaspect one through its properties window.
Something like a switch "Advanced signal" in the dialog that appears when clicking on the signal (already built). When "advanced signal" is on, two options below get enabled: "direction X type" and "direction Y type", with X and Y I guess consistent with track ribi directions, and the values defaulting to the original signal type. Here you can chose from the standard signal types, but independently for each direction. Upon every change, half the cost of building a classic signal of that kind is payed.

I don't know if then it would be possible to mix the images from the two signals without messing with every pakset. Eg. black-yellow-red (longsignal) on one side and black-red with arrows (choosesignal) on the other.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #3 on: January 03, 2014, 04:47:11 PM »
The problem is that different signals are different object types. You can't turn a signal into a multiaspect one, that would indeed be a huge programming task, you have to build the two different signals on the same tile, but somehow be able to specify during construction which signal should face which way. That also solves the problem of being unable to have a one-sided signal, which is just as useful.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Re: Multi-aspect signals
« Reply #4 on: January 03, 2014, 04:55:34 PM »
Oh, I thought signals shared a common base, unsurprisingly someone with some knowledge of simutrans internals can suggest an implementation better than I can :D

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2715
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Multi-aspect signals
« Reply #5 on: January 03, 2014, 05:50:36 PM »
This is exactly what a single sided signals would solve. I mean signals that affect only one direction while trains can pass in oppisite direction. Just as in real life.

Sent from my GT-I9000 using Tapatalk 2


Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #6 on: January 03, 2014, 06:00:59 PM »
There is a common base for signals, but it pretty much also includes signs and traffic lights. Signs could also benefit from being able to have different signs facing each way on the same tile, while traffic lights only makes sense facing all directions.

Note: I'm not too familiar with this code myself, so I risking writing something thats not correct.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Re: Multi-aspect signals
« Reply #7 on: January 03, 2014, 07:48:29 PM »
I guess having single-side signals would be quite complicated instead, right?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #8 on: January 03, 2014, 08:36:31 PM »
Single-sided signals can be seen as a special case of "multi-aspect" signal where one of the directions is "none". One-way signals would be a special case where one of the directions is a no-entry sign.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Re: Multi-aspect signals
« Reply #9 on: January 03, 2014, 09:11:12 PM »
No, I get that, but I guess it would involve quite an extensive work if not almost rebuilding the whole signals thing

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9565
  • Languages: De,EN,JP
Re: Multi-aspect signals
« Reply #10 on: January 03, 2014, 10:38:25 PM »
The problem is than the single way aspect is not coupled with the direction. Hence any directional different signal needs to know from which direction it is queeried. The additional logic is probably not too hard, but the problem is rather the resulting confusion of signals that does not work as expected (especially after two years, when the line gets double track and you already forgot about the choose signal in the wrong direction ...)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #11 on: January 03, 2014, 11:05:57 PM »
The problem is than the single way aspect is not coupled with the direction. Hence any directional different signal needs to know from which direction it is queeried. The additional logic is probably not too hard, but the problem is rather the resulting confusion of signals that does not work as expected (especially after two years, when the line gets double track and you already forgot about the choose signal in the wrong direction ...)

Yes, but that goes for the "multi-aspect" thing as well. I think multi-aspect is actually two signals facing the same direction, typically a main signal and the distant signal for the next one, but the issue here seems to be having two different signals on the same tile facing in opposite directions.

Offline fredp

  • *
  • Posts: 25
  • Languages: IT, EN
Re: Multi-aspect signals
« Reply #12 on: January 03, 2014, 11:20:03 PM »
Yes, but that goes for the "multi-aspect" thing as well. I think multi-aspect is actually two signals facing the same direction, typically a main signal and the distant signal for the next one, but the issue here seems to be having two different signals on the same tile facing in opposite directions.

This helped me think about the real world thing, thanks. Actually, I may have used "multi-aspect" wrong, for what I meant from the beginning It would suffice that one-way signals (except the do-not-entry signal) didn't affect traffic going in the opposite direction (instead of blocking it).
So in the original example it could be possible to place a longsignal for A->D direction and a choosesignal for D->A, one right after the other, similar to what often happens in real world:


STATION A
                               C
platform1 -- presignal ---------------------> station B <--> station C <--> station D <--> ...
platform2 -- presignal _/   L

with C = choosesignal and L = longsignal (signals being on right side of the track)

On double track lines, a no-entry sign should be enough to prevent trains using the illegal track (as it is called in italy)


All this just to say that two signals for a tile isn't strictly needed

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Multi-aspect signals
« Reply #13 on: January 03, 2014, 11:39:47 PM »
I did try to get one-sided signals working once. Not sure how close I got, as it was my first attempt at modifying actual Simutrans logic, rather than generic display stuff that I've done both before and since. The changes are also probably lost and in any case outdated. I didn't get the reservation to run through the signal backwards, that I can remember, so it acted like a waypoint of the day, and hence like a normal signal. The reason for that was simply that I stopped coding on it, for whatever reason.

It should be mentioned that in some countries, according to a previous discussion on the subject of one-sided signals, seeing the back of a signal, but not the front of one at the same time, implicitly means "stop, you're going the wrong way!" just like the one-way signals in Simutrans today.