The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: Ves on September 13, 2016, 10:36:22 AM

Title: The arrival of the T-signal
Post by: Ves on September 13, 2016, 10:36:22 AM
Wow, you did it, James! Really congratulations! You implemented the T-signal!!  :D

Do you need any additional signals (ie choose signals) other than T-signals?
Currently, I can only get a station to work if there is choose signals as well, but It is my impression that the T-signal would act as a choose signal as well?

Anyway, impressive job! I am watching my test station and the single T-signal at the centre of the platform lowering and raizing both left and right arm as the trains come along! :thumbsup:
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 13, 2016, 11:54:24 AM
The code as currently implemented works only for trains leaving the station: it is intended to solve what would otherwise be the problem of a train on one platform being sent along the line at full speed by a signal that had not been passed by a train in more than 10 minutes in spite of the fact that a train had just left the station along the same line from another platform.

It would be a different and much more complex task to replace signals protecting the entrance of a station with a single signal in the station because it would be difficult for the program to infer automatically at what point that a train should stop outside the station, so, yes, either choose signals or plain signals are needed at the entrance to stations in addition to station signals.
Title: Re: The arrival of the T-signal
Post by: Ves on September 13, 2016, 12:37:50 PM
I see! However it is still extremely satisfying to see trains leave the platforms by them self without a signal/flagman on every single track!
Would there be no possibility to make the signal show clear, when a train has been given clearance to a track (from a choose signal)?

Out of curiosity, you have "has_selective_choose=1" on those kinds of signals, is this in order to gain the extra visible aspects?


edit:
QuoteIt would be a different and much more complex task to replace signals protecting the entrance of a station with a single signal in the station because it would be difficult for the program to infer automatically at what point that a train should stop outside the station, so, yes, either choose signals or plain signals are needed at the entrance to stations in addition to station signals.
Just a thought from on top of my head, but could the sighting distance not be used so that the train stops when the sighting distance reach the tile with the signal? If the station (and junctions etc) is longer than twice the sighting distance (assuming the T-signal is placed in the middle and there are no objects, hills or bridges in the way) then the player would have to use dedicated choose signals. The result of using T-signals in that case would be potential deadlocks....
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 13, 2016, 05:54:05 PM
The has_selective_choose=1 is indeed necessary for the signal to show both the obverse and inverse aspects in a station signal.

As to the suggestion in relation to sighting distances, this would give rise to a range of very complicated difficulties, partly resulting from what might happen if the outer junction is not within the sighting distance, and partly resulting from the nature of the way in which the code is represented internally that makes it very difficult to anticipate a signal ahead in this way. I am reluctant to make these sorts of changes after the difficulties that I had with reserving through: I really do need to move on from signalling now.
Title: Re: The arrival of the T-signal
Post by: Ves on September 13, 2016, 07:50:51 PM
QuoteAs to the suggestion in relation to sighting distances, this would give rise to a range of very complicated difficulties, partly resulting from what might happen if the outer junction is not within the sighting distance, and partly resulting from the nature of the way in which the code is represented internally that makes it very difficult to anticipate a signal ahead in this way. I am reluctant to make these sorts of changes after the difficulties that I had with reserving through: I really do need to move on from signalling now.
That is ok, the reservation code seems to be a real beast! :)

What about if the signal could show clear when a train is released from a choose signal into a platform? It would be a real cosmethic thing, I know.
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 13, 2016, 08:03:13 PM
Would that not be confusing where there is a separate signal to indicate a clear route into the station, and the station signal usually governs departures?

Incidentally, preliminary testing suggests that this seems to work as intended for plain time interval (i.e. without telegraph) station signals, too. If you would be able to test this further, I should be grateful.
Title: Re: The arrival of the T-signal
Post by: Ves on September 13, 2016, 08:07:58 PM
Quote from: jamespetts on September 13, 2016, 08:03:13 PM
Would that not be confusing where there is a separate signal to indicate a clear route into the station, and the station signal usually governs departures?

Incidentally, preliminary testing suggests that this seems to work as intended for plain time interval (i.e. without telegraph) station signals, too. If you would be able to test this further, I should be grateful.
I personally dont think it would be confusing, merely add to the immersion!

I will cunduct further test with the signals (have to paint them and code them first!)
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 12:39:37 AM
Thank you, please let me know. I am preparing the tutorial film for time interval signalling at present, so it will be useful to know your test results.
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 10:51:14 AM
I am currently testing along and I find that they feel very consistent and easy to use (once the initial learning is done)!
I dont think I really can find any immediate problems with them actually. Not with nor without telegrapf. Seems to work quite well right out of the box! :)
Are there any subjects that you would like me to keep track of?

Incidentally, (sorry for bugging you with questions about this and that) have you considered to make the station signals available also for absolute block working method (or even track circuit working method to preserve directional reservation)?
What would be added to gameplay is that one can simulate the use of station signals in a time where no more than one train where allowed to be on the line between station, as opposed to time interval.
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 11:34:52 AM
Thank you very much for testing: that is helpful. One question, if I may: currently, station signals in the ordinary time interval working method make a directional reservation for a certain number of tiles outside the station. Ordinary time interval signals make a block reservation for that many tiles beyond a junction. I suspect that it is unlikely to make a difference in practice given the addition of the timer for station signals, but my provisional view is that it would be better for plain time interval station signals (without the telegraph) just to make a block reservation, as this would be less confusing to players and would make historical sense, since the railway policemen would not release a train even if the requisite time had passed if they could see another train blocking the line ahead. What are your views on that?

As to absolute block station signals, I will have to give that some thought. It would not be implemented in the British pakset, however, as I do not believe that station signals were used in the absolute block era in the UK, so I should need to test with the Swedish pakset; would you be able to add a suitable signal to the Swedish pakset for me to test this if, having considered it, I think the idea workable?
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 12:03:15 PM
QuoteOne question, if I may: currently, station signals in the ordinary time interval working method make a directional reservation for a certain number of tiles outside the station. Ordinary time interval signals make a block reservation for that many tiles beyond a junction. I suspect that it is unlikely to make a difference in practice given the addition of the timer for station signals, but my provisional view is that it would be better for plain time interval station signals (without the telegraph) just to make a block reservation, as this would be less confusing to players and would make historical sense, since the railway policemen would not release a train even if the requisite time had passed if they could see another train blocking the line ahead. What are your views on that?
If I understand you correctly, you mean that the station signal should behave similarish as to the corresponding "normal" signals? I would agree on that: It would indeed not make any sence for a dispatcher to release a train at any time, if he can spot that the rail is occupied!

QuoteAs to absolute block station signals, I will have to give that some thought. It would not be implemented in the British pakset, however, as I do not believe that station signals were used in the absolute block era in the UK, so I should need to test with the Swedish pakset; would you be able to add a suitable signal to the Swedish pakset for me to test this if, having considered it, I think the idea workable?
In fact I do have a signal graphic that would suit perfect for your tests!
https://github.com/VictorErik/Pak128.Sweden-Ex/blob/09d4fb21c4b96407c75bc6e9355ac017beef9932/Way/WayObjects/Rail%20Signals/images/Sem_T.png (https://github.com/VictorErik/Pak128.Sweden-Ex/blob/09d4fb21c4b96407c75bc6e9355ac017beef9932/Way/WayObjects/Rail%20Signals/images/Sem_T.png).
You probably recognize the positions of the arms, but a quick walk through:
1 - DANGER
2 - CLEAR obverse
3 - CLEAR inverse
4 - CLEAR both obverse and inverse (painted just in case)
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 12:39:33 PM
Thank you for that. Are you able to compile this into the Swedish pakset so that I can test with it?
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 12:58:45 PM
I have already made a testing pakset compiled (without that specific signal) where I have borrowed some space from the devel-new-server (as my dropbox is still disabled) to temporarely have the pakset. It features T-signals in time interval with and without telegraph and it is found here: http://server.exp.simutrans.com/Pak128.Sweden-Ex_Testing_version.zip (http://server.exp.simutrans.com/Pak128.Sweden-Ex_Testing_version.zip)
You can even take the savegame from the other bugreport I made today (about trains not changing working methods) so you already have some infrastructure to start from.

How would you like the specific signal? Maybe it is easier if I just provide a datfile containing the basics, and then you can compile it with different working methods or settings as you please?

The datfile comes here in plain text:

#--------------------------------------
# T-semafore test
#--------------------------------------
# T-semaphore
obj=roadsign
copyright=Vladki,Ves
name=Se_T-signal_test_absolute_track-circuit
waytype=track
cost=2000
maintenance=1600
aspects=3
working_method=absolute
max_speed=90
has_selective_choose=1
offset_left=11
has_call_on=0
permissive=0
allow_underground=0
is_signal=1
is_longblocksignal=1
intro_year=1890
intro_month=12
# DANGER
Image[0]=images/Sem_T.1.0
Image[1]=images/Sem_T.1.2
Image[2]=images/Sem_T.1.1
Image[3]=images/Sem_T.1.3
# CLEAR (inverse)
Image[4]=images/Sem_T.3.0
Image[5]=images/Sem_T.3.2
Image[6]=images/Sem_T.3.1
Image[7]=images/Sem_T.3.3
# CLEAR (obverse)
Image[8]=images/Sem_T.2.0
Image[9]=images/Sem_T.2.2
Image[10]=images/Sem_T.2.1
Image[11]=images/Sem_T.2.3


Icon=> images/Sem_T.1.4
Cursor=images/Sem_T.2.4

One could discuss if a potential station signal using the track circuit block working method should be able to show a caution aspect as well, however, that is not something I find nessecary.
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 01:11:43 PM
It would be easier if you could compile it, as I have not set up my systems to compile the Swedish pakset, and it can take quite a bit of work to set things up. All that we need is the signal to be coded as absolute block rather than time interval (with or without telegraph), but other settings the same (other than, e.g., cost and upgrade group, which may be the same or different). Thank you.
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 01:22:11 PM
Ok, here comes a signal. It looks like this in its .dat-file:

#--------------------------------------
# T-semafore test
#--------------------------------------
# T-semaphore
obj=roadsign
copyright=Vladki,Ves
name=Se_T-signal_test_absolute-block
waytype=track
cost=2000
maintenance=1600
aspects=3
working_method=time_interval
max_speed=90
has_selective_choose=1
offset_left=11
has_call_on=0
permissive=0
allow_underground=0
is_signal=1
#free_route=1
is_longblocksignal=1
intro_year=1848
intro_month=12
# DANGER
Image[0]=images/Sem_T.1.0
Image[1]=images/Sem_T.1.2
Image[2]=images/Sem_T.1.1
Image[3]=images/Sem_T.1.3
# CLEAR (inverse)
Image[4]=images/Sem_T.3.0
Image[5]=images/Sem_T.3.2
Image[6]=images/Sem_T.3.1
Image[7]=images/Sem_T.3.3
# CAUTION (inverse)
Image[8]=images/Sem_T.3.0
Image[9]=images/Sem_T.3.2
Image[10]=images/Sem_T.3.1
Image[11]=images/Sem_T.3.3
# CLEAR (obverse)
Image[12]=images/Sem_T.2.0
Image[13]=images/Sem_T.2.2
Image[14]=images/Sem_T.2.1
Image[15]=images/Sem_T.2.3
# CAUTION (obverse)
Image[16]=images/Sem_T.2.0
Image[17]=images/Sem_T.2.2
Image[18]=images/Sem_T.2.1
Image[19]=images/Sem_T.2.3


Icon=> images/Sem_T.1.4
Cursor=images/Sem_T.2.4


Note that there are no graphics differenting the CLEAR and CAUTION, so they use the same graphics. If you very much want that, I can make one tonight, as I have to go now.
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 01:28:24 PM
Absolute block would generally use only two aspect signals in any event, so this should suffice. Thank you.

Edit: The signal seems to be coded as time interval rather than absolute block in the .pak file; would you be able to upload an corrected .pak file for testing?
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 02:40:55 PM
Idiot me! I see that I forgot to change the working method! X-(
You will get a new version tonight!
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 04:30:27 PM
I have in any event committed some changes that should make absolute block signals work as station/T signals, but I have not been able to test it. Perhaps you could test it when you correct this error?
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 09:06:36 PM
I will test when I get home tonight! How will the signals work? Are there any directional reservation going on or only "normal" reservations?
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 09:11:42 PM
Absolute block signals should not have directional reservations: that is not part of how they work. They should work in just the same way as if absolute block signals were placed on each of the platforms.
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 09:23:33 PM
Ok, that is also what I assumed.
You talked earlier about, in the time interval method, the train would only be released if the time since the last train left was high enough AND the sighting distance in front of the train was clear.
If, within that sighting distance, there was instead a signal at danger, could that be a factor that would keep the train from being released from the platform?
Title: Re: The arrival of the T-signal
Post by: jamespetts on September 14, 2016, 09:26:04 PM
Quote from: Ves on September 14, 2016, 09:23:33 PM
Ok, that is also what I assumed.
You talked earlier about, in the time interval method, the train would only be released if the time since the last train left was high enough AND the sighting distance in front of the train was clear.
If, within that sighting distance, there was instead a signal at danger, could that be a factor that would keep the train from being released from the platform?

That would not make any sense, as the route to the next signal would be clear, so the train could be released to stop at that next signal.
Title: Re: The arrival of the T-signal
Post by: Ves on September 14, 2016, 09:44:15 PM
Oh, that's right! Did not think of that.
I am just in my head looking for as many possibilities as possible to make exit signals! :-)
I realize that I in other words was proposing the station signal to be a two block signal if the next signal was within sighting distance.

edit:

First, a new T-signal with absolute block this time...
#--------------------------------------
# T-semafore test
#--------------------------------------
# T-semaphore
obj=roadsign
copyright=Vladki,Ves
name=Se_T-signal_test_absolute-block
waytype=track
cost=2000
maintenance=1600
aspects=3
working_method=absolute_block
max_speed=90
has_selective_choose=1
offset_left=11
has_call_on=0
permissive=0
allow_underground=0
is_signal=1
#free_route=1
is_longblocksignal=1
intro_year=1848
intro_month=12
# DANGER
Image[0]=images/Sem_T.1.0
Image[1]=images/Sem_T.1.2
Image[2]=images/Sem_T.1.1
Image[3]=images/Sem_T.1.3
# CLEAR (inverse)
Image[4]=images/Sem_T.3.0
Image[5]=images/Sem_T.3.2
Image[6]=images/Sem_T.3.1
Image[7]=images/Sem_T.3.3
# CAUTION (inverse)
Image[8]=images/Sem_T.3.0
Image[9]=images/Sem_T.3.2
Image[10]=images/Sem_T.3.1
Image[11]=images/Sem_T.3.3
# CLEAR (obverse)
Image[12]=images/Sem_T.2.0
Image[13]=images/Sem_T.2.2
Image[14]=images/Sem_T.2.1
Image[15]=images/Sem_T.2.3
# CAUTION (obverse)
Image[16]=images/Sem_T.2.0
Image[17]=images/Sem_T.2.2
Image[18]=images/Sem_T.2.1
Image[19]=images/Sem_T.2.3


Icon=> images/Sem_T.1.4
Cursor=images/Sem_T.2.4


edit2:

Now my tests with the absolute block T-signals:
When trains wants to ENTER the station, they slow down in some circumstances to 1kmh. Also, the corresponding arm of the signal moves when this happens.
Sometimes, the wrong arm lift, is this because we have configured the signal with both caution and other aspects?
Savegame:
http://simutrans-germany.com/files/upload/T-signal_test_Absolute_block.sve (http://simutrans-germany.com/files/upload/T-signal_test_Absolute_block.sve)
New pakset needed (for all signals etc):
http://server.exp.simutrans.com/Pak128.Sweden-Ex_Testing_version.zip (http://server.exp.simutrans.com/Pak128.Sweden-Ex_Testing_version.zip)
Just let it fast forward. If there is too long till next train, a deadlock might be happening further away which you will have to resolve.
Title: Re: The arrival of the T-signal
Post by: jamespetts on February 18, 2017, 01:03:38 AM
I am currently reviewing old bug reports and I notice that this one appears to have no reported resolution. May I ask whether this can still be reproduced?
Title: Re: The arrival of the T-signal
Post by: Vladki on February 19, 2017, 12:12:12 AM
If you connect to the swedish sandbox game, you'll see a lot of blockages on stations with T signals. As if choose signals do not work properly in combination with T signals, and let multiple trains on the same platform, where they get stuck.
Title: Re: The arrival of the T-signal
Post by: jamespetts on February 19, 2017, 12:56:40 PM
If the blockage is already there, it is probably too late to see the actual problem arising. Are you able to identify a specific place and time in a specific saved game when it occurs from a non-blocked state so that I can reliably reproduce the problem in order to try to fix it?
Title: Re: The arrival of the T-signal
Post by: Vladki on February 19, 2017, 09:06:20 PM
Have a look at http://server.exp.simutrans.com/debug-saves/t-signal-deadlock.sve
You'll need swedish pakset to load it.

It should open at Klippan branch station - with a few trains heading left in emergency stop - ignore those for now, and look at the train heading right towards Klippan Se_townhall_01 station. The choose signal (home signal for that staion) is at caution, long before the train arrives. And although there is lot of empty platforms, the train heads to the only one that is occupied.

Now back to the other trains that are at klippan branch station - they are in time interval mode, and got too close to each other - thus in emergency stop. After resolving the stop, they should continue in drive by sight. But instead the all move a little at once and get again into emergency stop. I think the T-signal might be the cause. When I remove the signal, the problem is gone

Title: Re: The arrival of the T-signal
Post by: Ves on February 19, 2017, 10:23:45 PM
This also is the situation when I load the game.
Title: Re: The arrival of the T-signal
Post by: Vladki on March 05, 2017, 11:47:56 PM
The bug with T-signal and choose signals is reported also here http://forum.simutrans.com/index.php?topic=16805.0 and appears to be fixed in 85bd973
Title: Re: The arrival of the T-signal
Post by: jamespetts on March 06, 2017, 01:35:07 AM
Splendid - thank you for reporting.