The International Simutrans Forum

Simutrans Extended => Simutrans Extended Discussion => Topic started by: Ves on September 05, 2016, 10:53:38 PM

Title: All info in signal window
Post by: Ves on September 05, 2016, 10:53:38 PM
As talked about on the server, here is a suggestion as to show more coded info about a signal.
Example of usefull information:

* Longblock signal
* choose signal
* pre signal
* intermediate block signal
* etc etc
Title: Re: All info in signal window
Post by: Ves on September 19, 2016, 08:23:15 PM
I am quite happy to announce my absolute debut in writing code that actually works for simutrans!
I will let this picture explain:
(http://server.exp.simutrans.com/screenshots/simscr02.png)
(notice the "CLEAR" text in the infowindow)

James, what are your thought on this, would you consider implement it?
I would also like to try to show the other stuff as well mentioned earlier (long block, choose signal etc) if you would consider adding it.
Title: Re: All info in signal window
Post by: jamespetts on September 19, 2016, 09:16:50 PM
I should indeed consider adding it (although the text should not be in all caps, and will need translation data); is this on Github somewhere?
Title: Re: All info in signal window
Post by: Ves on September 20, 2016, 04:30:05 AM
I wrote it in caps, so it would distinguish from the other parameters to show that it is shifting (between states).
One question though:

Watching the signal state shifting, it appears that the states are shifting quite alot some times and non choose signal are showing sometimes clear, some times clear no choose, making it difficult to have the difference between them shown. Maybe worth looking into?

Also, I have not renamed the "clear no choose", "caution no choose" etc. as I am unsure which is intended to be main route and diverging route (both show occasionally up in the infowindow).

I was anyway also wondering if I was allowed to reallocate some of the information in the window (now that I learned how to do it), as it gets a bit messy with not so needed information quite high (as rotations) and more needed information scattered around (time since last train etc).

I Tried to make a Pull Request to your devel-new2 branch, but an error came up telling me I have no permission. What is the best to do?
Title: Re: All info in signal window
Post by: jamespetts on September 21, 2016, 12:49:53 AM
If you can let me know the name of your Github repository, I can follow you and pull from you manually. I am not sure why you are having trouble with pull requests. I will certainly consider any suggestions that you have to rearrange the data in the signal window, although I cannot guarantee that I will incorporate it.

As to the changings of state, I will need rather more information to understand whether or not this is a problem. Does it affect either the appearance of signal graphics or the operation of trains in practice? If not, it would seem hard to classify this as a bug.
Title: Re: All info in signal window
Post by: Ves on September 21, 2016, 05:34:23 AM
I have this time made a local branch of your devel-new-2, hence why I tried to push it to the devel-new branch directly (I thought I could create a pull-request?)

Anyway, in order for you to check the files in the meantime, they are put here as attachment.
The files are:

obj\roadsign.h
obj\signal.cc


And they are syncronized with the latest devel-new version, so you could just replace your existing files.
Title: Re: All info in signal window
Post by: jamespetts on September 21, 2016, 10:54:48 AM
May I suggest that you set up an account with Github (which is free) and put your changes there? It is much easier for me to integrate them that way.
Title: Re: All info in signal window
Post by: Ves on September 21, 2016, 12:59:17 PM
I already have a github account (hosting the Swedish pakset), however I thought the proper way was to create a branch within your project. Will work on it tonight!

edit:
I am afraid that I really do hit a wall when messing around with git:

If I clone a copy of your repository to my harddrive, I can update whenever you do, I can create local branches and edit files as I please. But I cannot make my local branch go online in any way. If I try to "publish" it, it tells me I dont have permission, and if I try to make a pull request, I also do not have permission. I have no clue how to publish my branch onto my own github account.

The other alternative I can see, is to make a copy of the entire simutrans experimental folder on my harddrive, delete the "git" folders inside and create a new repository in git, featuring the complete copy. With this, I can go live, but I have no clue how I am suppose to keep it in sync with your devel-new-branch (besides manually copying files, which will be very tedious).

How do you do this?

edit2:
I have now added information in the signal window wether it is a choose signal, longblock -, combined -, station - or distant signal. Still have intermediate - and permissive signal to go as well. Is there any other signal types that would be worth mentioning? Would a "normal signal" be in place when the signal is a plain signal?

(http://server.exp.simutrans.com/screenshots/Signal_information.png)
Title: Re: All info in signal window
Post by: jamespetts on September 22, 2016, 10:25:55 PM
Ahh - what you need to do is to clone the Simutrans-Experimental repository on Github (so that you have your own mirror of the repository on Github), and then pull your mirror to your own hard drive. When you make a change on your own computer, you then push that change to the version on Github, and then I can pull from your version on Github to my local computer. I cannot pull from the version on your local computer unless you have a Git server on your local computer that I can access from my computer running constantly, which would not be sensible or easy to set up.

As to additional information, you may want to specify whether a signal is a pre-signal and to have "station signal" become "directional signal" for track circuit block and cab signalling.
Title: Re: All info in signal window
Post by: Ves on September 22, 2016, 11:22:21 PM
I think that I have done the right thing now. I had the issue of cloning it to my computer, but I could not push anything because it only wanted to push to your repository. It is currently cloning (I think...) and eventually it should be available here: https://github.com/VictorErik/Simutrans-Experimental (https://github.com/VictorErik/Simutrans-Experimental).
I did not know what to name it, so I just used "Simutrans-Experimental", hope that is fine?

edit:
The branch that I have currently made stuff in is called "Signal-info-window" and is found here: https://github.com/VictorErik/Simutrans-Experimental/commits/Signal-info-window (https://github.com/VictorErik/Simutrans-Experimental/commits/Signal-info-window)

As to the signal windows, you think "station signal" should be renamed "directional signal"?
It could actually be cool to also write wether the signal is able to create directional reservations (ie signals with longblock and other doubble faced signals). Can one check wether two signals is on the same tile?
Title: Re: All info in signal window
Post by: Ves on September 26, 2016, 05:01:04 AM
It seems you found my branch!

I have question:
I would like to show the maximum speed a signal can be passed (the same number that is shown in the tooltip). But whenever I use get_max_speed(), It shows an extremely high number that doesnt seem to correlate with the speed. How am I supposed to find the max speed of a signal?
Title: Re: All info in signal window
Post by: jamespetts on September 26, 2016, 10:19:24 PM
Thank you very much for this work, and apologies for the delay in replying/looking into integrating the code: I have been really rather busy with work/going to Paris/upgrading to Visual Studio 2015/profiling/optimising in the last few days.

However, to answer your latest question, speed in the game is stored in internal units. To convert to km/h, use the (global) speed_to_kmh() method.
Title: Re: All info in signal window
Post by: Ves on September 27, 2016, 03:56:10 PM
Thank you, it is now working!

You can pull from the "Signal-info-window"-branch on my github. Have a look and see if you like it! :)
Title: Re: All info in signal window
Post by: jamespetts on October 01, 2016, 10:26:54 PM
I have tried to merge this, but I am afraid that it caused some very odd problems: I was not able to load saved games at all as the directory appeared to be empty. Looking at the merge history, there appears to be some very odd rebasing or something similar happening, with your branch ultimately being based on the master rather than the devel-new-2 branch, which seems to be at least in part what is causing the trouble, although it is hard to tell, as, because of that oddness, I cannot clearly see each commit.

Also, the base_texts_experimental-passenger-generation.dat file has not been updated with the new translation texts.

However, if those two issues can be fixed, this looks like a very worthwhile patch, as the actual display of text in the signal information window seems quite useful.
Title: Re: All info in signal window
Post by: Ves on October 01, 2016, 11:27:59 PM
I was messing around with github when I could not get it to work, and also since I still cannot compile the latest version due to the reasons given in the other thread. I accidentally pressed merge from master, but it looks like nothing did actually change with that. Also I have tried to revert that and so on. Maybe it is just easier if I create a completely new branch and put it all there...

edit:
I made some new experiments with github and have organized it in a completely new way (the way I suppose it is meant to be organized), and there should now be a new clean version of the commit. Also, the translation texts are added as you wanted.
I have not tried it though, due to the compiling issues...
Title: Re: All info in signal window
Post by: Ves on October 04, 2016, 10:24:34 PM
Now there should be a fully working version on the Github, you can pull it James and check it out.
Be aware, that due to certain Github "inagreements", it is the branch "signal-in-infowindow-2" that contains the correct version and can be found here:
https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2)

I was thinking about creating a button next to the signal box name, to make the world center above the signal box, much like factory suppliers do. Would you approve such a change (if I can get it to work)?
Title: Re: All info in signal window
Post by: Junna on October 05, 2016, 06:07:42 PM
I was thinking about creating a button next to the signal box name, to make the world center above the signal box, much like factory suppliers do. Would you approve such a change (if I can get it to work)?

That would be very useful.
Title: Re: All info in signal window
Post by: jamespetts on October 05, 2016, 09:22:01 PM
Thank you - I will have to look at that when I get a chance. That is most appreciated. Such a button, if you can make it work, would certainly be a good idea - thank you for that suggestion.

Edit: I have now incorporated this. It works very well - thank you.
Title: Re: All info in signal window
Post by: Vladki on October 09, 2016, 10:27:09 AM
Info about signals is really good  :thumbsup:
I like also the plan to add "hyperlink" to signalbox.
Title: Re: All info in signal window
Post by: Ves on October 09, 2016, 10:33:41 AM
Thanks!
Working on the button :)
Title: Re: All info in signal window
Post by: Ves on October 26, 2016, 11:39:56 PM
Done! https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/Signalbox-finding-signals-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/Signalbox-finding-signals-2)

Next: make a window with all connected signals from the signalbox? :)
Title: Re: All info in signal window
Post by: jamespetts on October 27, 2016, 12:24:15 AM
Thank you very much for that. You will need to add, not just the translator::translate call and translation, however, but the .dat file reference for when this is uploaded to Simutranslator.

Edit: Testing this, it works splendidly, except that the tooltip appears not to be translated (it reads "goto_signalbox" instead of "Go to signalbox").
Title: Re: All info in signal window
Post by: Ves on October 27, 2016, 07:04:12 AM
How typical! I did in fact change that dat file and commit it, however I must have forgotten to push it that last time as I was pushing many "last times"....
Will look into it tonight!
Title: Re: All info in signal window
Post by: jamespetts on October 27, 2016, 12:23:35 PM
Also, this seems to generate a compile error in GCC (under Linux):

Code: [Select]
build/default/obj/signal.o: In function `signal_t::show_info()':
signal.cc:(.text+0x1d): undefined reference to `signal_info_t::signal_info_t(signal_t*)'
collect2: error: ld returned 1 exit status
common.mk:21: recipe for target 'simutrans/simutrans-experimental' failed
make: *** [simutrans/simutrans-experimental] Error 1
Title: Re: All info in signal window
Post by: Rollmaterial on October 27, 2016, 03:22:47 PM
Many thanks for this very helpful feature! If I might make a suggestion in relation to this, a feature that highlights the selected signalbox and its signals would be totally worth it in my opinion.
Title: Re: All info in signal window
Post by: Ves on October 27, 2016, 11:51:07 PM
Now I have fixed the translation! I had forgot the last commit as well as forgotten the translate::translate section. Try again now, it should work!

Also, this seems to generate a compile error in GCC (under Linux):

Code: [Select]
build/default/obj/signal.o: In function `signal_t::show_info()':
signal.cc:(.text+0x1d): undefined reference to `signal_info_t::signal_info_t(signal_t*)'
collect2: error: ld returned 1 exit status
common.mk:21: recipe for target 'simutrans/simutrans-experimental' failed
make: *** [simutrans/simutrans-experimental] Error 1

I am really sorry James, but I think I do not understand enough to resolve that. The only text I have added is the tooltip "goto_signalbox". I have collected pieces of the code from around the code. It should behave similar as to "trafficlight_info_t" and "privatesign_info_t".

Many thanks for this very helpful feature! If I might make a suggestion in relation to this, a feature that highlights the selected signalbox and its signals would be totally worth it in my opinion.
Thanks! However, that is WAY above my skill level! Currently, I know only how to edit info windows and (in some occations) how to add a button to it  ;D
Title: Re: All info in signal window
Post by: jamespetts on October 28, 2016, 01:33:57 AM
Ahh, no, the compile error is not about the text, but it is claiming that it cannot find the definition of the signal_info_t constructor that takes a pointer to a signal_t object as a parameter. It is actually a rather serious error, as this cannot currently be complied on Linux at all. I had a brief look, but could not immediately find a solution. I am afraid that this feature will have to be reverted if a fix cannot be found to this, as the code cannot be in a state where it cannot be compiled on Linux (or, indeed, anything else that uses GCC, such as Mac).
Title: Re: All info in signal window
Post by: Ves on October 28, 2016, 10:22:45 AM
I have spent some time now starring at the compiler and comparing it with privatesign_info_t and trafficlight_info_t, without anything that appears to be out of order.
To be clear, am I right that the problem is with signal_t and not the signal_info_t? That it is signal_t that cannot "find" signal_info_t?
Title: Re: All info in signal window
Post by: jamespetts on October 28, 2016, 11:02:50 AM
That is what appears to be the trouble. I have trouble finding exactly what the problem is, too: it is rather cryptic.

Edit: I have made some attempts to fix this, pushed to the devel-new-2 branch, but without success. It may be helpful to ask the Standard developers for assistance with this.
Title: Re: All info in signal window
Post by: Ves on October 28, 2016, 01:29:59 PM
On my phone now so cant check if this is what you did, but could it be something with the project file that the gcc compilers use (if it uses differently from windows)? Have have only modified the windows project file. I would not know how to successfully modify any of the other files.
Title: Re: All info in signal window
Post by: Milko on October 28, 2016, 02:11:24 PM
Hello

I have similar problem compiling using MingW.

Giuseppe
Title: Re: All info in signal window
Post by: jamespetts on October 28, 2016, 08:15:25 PM
Ves - that is the problem - you did not add signal_info.cc to the makefile: for every new .cc file, you need to add a line "SOURCES += [filename]" to the makefile. I have fixed this now and it compiles. Thank you very much.
Title: Re: All info in signal window
Post by: Ves on October 28, 2016, 08:19:05 PM
I'm glad it worked! Had no idea about that, I will keep that in memory for the future! Thanks!
Title: Re: All info in signal window
Post by: Ves on March 21, 2017, 11:30:28 PM
When testing some Swedish signal layouts, I found it really frustrating not knowing how far away the signal was from the signal box, and therefore how further out I could place signals. I dont know if this is information other people would want, but I could not help my self but find a way to code it.
The info window of a signal shows the distance to its signalbox (if connected) as well as max possible distance. If the distance is specified to zero in the dat-file, "infinite range" will show up on the range part. Similar for signal boxes. Also, I experimented with decimals. 0-999m is specified in meters, 1-19,9km is with one decimal and 20 and above is without any decimals, for easier reading.

(http://server.exp.simutrans.com/screenshots/Pak128.Sweden-Ex/Distance_shown_in_infowindow.png)

I do however get an out of bounds crash quite rapidly when using a big brittish savegame, something about koord3d, and I have a pretty sure guess on where the faulty code is, I just dont know how to troubbleshoot it. I get many errors when I try to compile a debug build. If you are interrested in incorporating it, would you like to take a look at the out of bounds issue?

It is live on this branch: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2)

Incidently, James, do you think it is needed to show three coordinates for the signalbox in the signals info window? Is two not enough (x and y)?
Title: Re: All info in signal window
Post by: jamespetts on March 22, 2017, 12:39:59 AM
Thank you very much for this: I will look into trying to fix this issue when I have the time. As to the necessity to have three co-ordinates, this is probably desirable, as it is possible to build signalboxes underground.
Title: Re: All info in signal window
Post by: Ves on March 22, 2017, 09:09:26 AM
Yes, but it might not be that often you place a signal box underground (I have never done that yet, as the normal boxes usually support underground signals as well) and the height coordinate actually don't tell you wether it is underground or over ground (you have to compare the coordinates on the spot, and then you already usually see the signalbox, or you go underground to see it). maybe a text showing if it is underground?

I'm glad you will take a look into the patch!
Title: Re: All info in signal window
Post by: jamespetts on March 22, 2017, 12:38:49 PM
If you would like to add a feature that replaces the 3 dimensional co-ordinates with 2 dimensional co-ordinates plus a textual indication of whether the signalbox is underground or not (with the z-level if it is), then this would probably be worth including.

Incidentally, by out of bounds crash, do you mean an internal Simutrans fatal error (e.g. in vector_tpl), or do you mean a segmentation fault? If the former, you could look into adding checks to make sure that any reference to an item in a vector is within that vector's range (i.e. is less than or equal to get_count() - 1).
Title: Re: All info in signal window
Post by: Ves on March 22, 2017, 01:01:36 PM
Will look into the underground text!

Yes it's in vector_tpl. Doing that, will it help avoiding the crash or only in debugging?
Title: Re: All info in signal window
Post by: jamespetts on March 22, 2017, 01:17:47 PM
The error means that you have tired to access an element of the array which does not exist, e.g. elements no. 3 of any array with 3 items (numbered 0, 1 and 2). Making sure that the requested element is in bounds should avoid the crash.
Title: Re: All info in signal window
Post by: Ves on March 22, 2017, 07:13:57 PM
I am having troubble fixing the out of bounds crash. I think I understand the principle, and I have also found a similiarish part of the code that utilize the "get_count() - 1". I seem however to fail fixing it though as I find it a bit over my skill levels. Would you care to take a look when you have the time?

The underground message is now incorporated and live on the github.
If the signalbox is underground, the coordinates (now only two instead of three coordinates) will move to the next line followed by (underground).

The button , however, it moves down one line as well, since I have not figured out a good way to fix it to the panel. Currently, it follows the lower window border, minus two times LINESPACE and minus 25 pixels (or steps or what that means).
Do you happen know of any way to fix the button, by some sort of anchor or something?
Title: Re: All info in signal window
Post by: jamespetts on March 23, 2017, 10:11:03 PM
Can I ask you to set out the circumstances in which you can reliably reproduce the out of bounds crash? I have merged the code locally, and it seems to work, but I have not been able to reproduce the crash, which I need to do in order to try to fix it.
Title: All info in signal window
Post by: Ves on March 23, 2017, 10:28:07 PM
Thanks!
It should crash with this game Savegame to the big map:
http://server.exp.simutrans.com/savegames/My_fair_Lady_2.sve (http://server.exp.simutrans.com/savegames/My_fair_Lady_2.sve)

Just fast forward and it should occur
Title: Re: All info in signal window
Post by: jamespetts on March 23, 2017, 10:44:28 PM
Thank you - for how long do I need to fast forward it? I have reached November 1951 and no crash so far.
Title: All info in signal window
Post by: Ves on March 23, 2017, 11:12:52 PM
Ok, then I will give you another map when I come home. The crash is happening on that map, but on my computer it has been developed further (you got an old version there, which was earlier linked to In this forum. That's because I'm not home at the moment). I thought the crash would occur on your version as well, but I will upload it tonight!

Incidentally, how do you find the new additions? Any remarks?
Title: Re: All info in signal window
Post by: jamespetts on March 23, 2017, 11:22:50 PM
Thank you, that is very helpful. From what I have seen of them so far, the new additions seem very helpful - thank you!
Title: Re: All info in signal window
Post by: Ves on March 23, 2017, 11:43:51 PM
Splendid! I was thinking of also adding a distance to nearest moving block beacon.

The savegame in which I experience the out of bounds can be found here:
http://server.exp.simutrans.com/savegames/Signal-in-infowindow-2_out-of-bounds.sve (http://server.exp.simutrans.com/savegames/Signal-in-infowindow-2_out-of-bounds.sve)

It should occur after a minute or two fast forwarding.

edit
I have just added a special display for moving block beacons. It is too complicated to find the nearest moving block beacon, but I have made a text that tells the player how far the beacons can be placed and moved it away from the signalbox section to minimize confusion.
Title: Re: All info in signal window
Post by: jamespetts on March 24, 2017, 02:28:11 AM
Thank you very much for that. I think that I have found and fixed the crash issue (which I do not think was caused by your patch), and have merged it and pushed the result with the fix.

I cannot see your beacon commit, however; have you pushed it?

Thank you very much for this.

Incidentally, I should be grateful if you could now use a new file rather than base_texts_experimental_passenger_generation.dat, as that file has now been uploaded to Simutranslator.
Title: Re: All info in signal window
Post by: Ves on March 24, 2017, 09:09:25 AM
Maybe a new file called se_experimental_signals.dat and move all signal stuff there?
I dont have time to do it now, but in the weekend!

edit
The beacon commits should be online.
There are two commits, one is the moving block beacons and another one is just a line that was not added in some circumstanses.

https://github.com/VictorErik/Simutrans-Experimental-Ves/commit/f75c11255f3e12c98f49e0d08eece138b2e3b4a4 (https://github.com/VictorErik/Simutrans-Experimental-Ves/commit/f75c11255f3e12c98f49e0d08eece138b2e3b4a4)
and
https://github.com/VictorErik/Simutrans-Experimental-Ves/commit/41ce13f3a4700b9d433741702dcdbed1d8cc8638 (https://github.com/VictorErik/Simutrans-Experimental-Ves/commit/41ce13f3a4700b9d433741702dcdbed1d8cc8638)
Title: Re: All info in signal window
Post by: jamespetts on March 24, 2017, 01:07:16 PM
Yes, a separate file for each feature addition seems sensible, although do remember to call it "extended" rather than "experimental". I will have a look at those additions presently. Thank you again!
Title: Re: All info in signal window
Post by: Ves on March 26, 2017, 12:47:16 AM
James, it seems that you have accidentally merged my branch "signalbox-finding-signals-2", which is an older attempt to create a button in the signalbox info window. Since that branch is not updated, it looks like that has corrupted the code to the signal info window. Can you perhaps revert that merge?
Otherwise, the files that has been wrongly changed are:

"base_texts_experimental-passenger-generation.dat"
"signal_info.cc", and the english translation file
"en.tab"

If you cannot revert, I can make a new commit, "re-fixing" the wrong files.
Title: Re: All info in signal window
Post by: jamespetts on March 26, 2017, 01:29:17 AM
I am not quite sure how this has happened, but this would be difficult to unpick using Git tools, so I should appreciate if you could re-fix the files. Do not worry about base_texts_experimental-passenger-generation.dat, as that has now served its function, having been uploaded to Simutranslator.
Title: Re: All info in signal window
Post by: Ves on March 26, 2017, 11:11:53 AM
Somehow Github totally ignored my newly created file, "base_texts_extended_signals.dat" from my working directory and I had no clue why. I had to manually upload it and merge on the webbinterface, why the commits looks a little weird maybe.

The fix is here:

https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/Signal-in-infowindow-fix (https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/Signal-in-infowindow-fix)

I rearranged the base texts, so all signal related go into the above mentioned file.
Title: Re: All info in signal window
Post by: jamespetts on March 26, 2017, 12:23:54 PM
Splendid, thank you for that: now merged. I am just about to upload the .dat file to Simutranslator, too, so you can start translating if you like.
Title: Re: All info in signal window
Post by: Ves on March 29, 2017, 11:15:19 PM
I was looking at adding some information in the signs info window, which currently is rather sparse to be honest.

I have some points I would like some input though:

1) While I think it would be a nice addition to show the signs maximum speed, it feels quite overkill and un-immersive to show a sign with a 1000kmh speed limit when the track underneath only supports travel in 12kmh. What do you think of the issue? Maybe a text that tells that the sign supports higher speeds than the underlaying track but no numbers? Only show the value when the underneath way has a higher speed value? Any other ideas?

2) I wanted to have the section "Time since vehicle last passed:" in the signs infowindow as well, however, I could not immediatedly figure out how to add the counters for the value. Is that a complicated task you think?

3) And lastly, a clear english description for single way signs and traffic lights.
Currently, the oneway sign displays this:
Code: [Select]
Permitted direction: EastThe parameter get_dir() gets the correct direction of the sign, that will say, backwards from what other signs and signals give, and I think it is good to display the direction a vehicle MAY travel.

The traffic light currently says this:
Code: [Select]
Current clear directions:
North and South
The directions North and South (or East and West) are my previous translation from the signals info window. Even though the traffic light is on a T-crossing, the window will also display the direction to which there is no road. The value shifts automatically when the light is shifted.
Title: Re: All info in signal window
Post by: jamespetts on March 30, 2017, 12:06:40 AM
Thank you for considering this: your UI patches are most helpful.

To answer your queries:

(1) the best solution here, I think, is to show the sign's maximum speed if the underlying way's maximum speed is not less than half the sign's speed: players will need to know, after all, whether an upgrade to the way is warranted given the speed of the sign;

(2) I am not sure that this is necessary, as it is only implemented for signals for the purposes of time interval signalling; and

(3) I am not sure quite what you are proposing to amend here; can you elaborate?
Title: Re: All info in signal window
Post by: Ves on March 30, 2017, 12:29:57 AM
1) Ok, I will do that

2) The reason for its existence is for consistence for the user. If the user finds this information in the signals window, they might anticipate to find it in the signs window as well. Personally, I use the counter on the signals to check wether I got the spacing right on vehicles.

3) I was a bit unclear:
As with the signals, I show a text in which direction the sign is facing. That is easy enough for all signs, but not for the one-way signs and the traffic light "sign". My previous post presented some suggestions how to label the the direction of travel in the two examples, and was asking if you (or someone else) had some suggestions as how to name them more clearly, as I dont find my own suggestions very good.

Quote
Thank you for considering this: your UI patches are most helpful.
Most welcome! Im enjoying looking into programming! :) If you have some suggestions to other UI developments similar to these (as this is kind of the only thing i have some know-how of for now), just give me a shout in that direction!

edit:
I added the number 1) point, and found a frustration: When I see the sign speed, I now know that it is because its close to the underlaying speed restriction, but I did in fact not know if it was above the limit or not. So, I added a new line which will appear together with the max speed of the sign:

(http://server.exp.simutrans.com/screenshots/signs_infowindow.png)

Maybe worth adding to the signals info window as well, so it becomes easier to check for players.
Title: Re: All info in signal window
Post by: jamespetts on March 30, 2017, 12:06:59 PM
That is very interesting - thank you. I do not think that there is sufficient call for using signs (as opposed to signals) as counters to implement the computational overhead required for this: it would require some non-trivial changes to the code to achieve, and I do not think that it is materially inconsistent for signals to have greater functionality than signs that are not signals.

As to the signs, the text that you describe seems sensible, although I do not know the reason for having "track speed" as distinct from "way speed": railway track is a type of way.
Title: Re: All info in signal window
Post by: Ves on March 30, 2017, 03:18:36 PM
Ok, i skip the counter on the signs window.

If you don't mind, due to translations, not differentiating the track- and way speed might be quite tricky, at least in Swedish, possibly other languages too. The English translation file could anyway show "way speed" for both types.
Title: Re: All info in signal window
Post by: Vladki on March 30, 2017, 03:32:08 PM
Just a few quick ideas.
Speeds: show them always as numbers (min, max for sign, max for way)
Directions as NSWE are great. I always hate the directions as numbers.
Time: show only for time interval signals and only for directions that make sense.
Other info: type of sign (choose, end of choose,...) Currently end of choose has nothing in the info.
For cab signaling and moving block there may be some more info (how many blocks are free or allowed speed or distance to train ahead...



Title: All info in signal window
Post by: Ves on March 30, 2017, 04:51:33 PM
Just a few quick ideas.
Speeds: show them always as numbers (min, max for sign, max for way)
Done!

Quote
Directions as NSWE are great. I always hate the directions as numbers.
Hated that too, but it should all be fine in my signal window patch, right?

Quote
Time: show only for time interval signals and only for directions that make sense.
I don't agree on they should only be visible for time interval signals. I find it very handy to know when a train last passed a signal.
I have already tried to hide the directions not used on the station signals (that is what you mean right?) in a clever way, but failed. I might revisit this though.

Quote
Other info: type of sign (choose, end of choose,...) Currently end of choose has nothing in the info.
Yes, partly done and rest on the todo list!

Quote
For cab signaling and moving block there may be some more info (how many blocks are free or allowed speed or distance to train ahead...
How many blocks are free is actually already presented with clear2, clear3, caution5 etc, the English translation file however are dumbing the information down to only show clear etc.
Do you want an additional text that shows how many blocks are covered?
I don't think there are other signals than time interval signals that restrict speeds depending on aspects, but time interval restricted speeds could in fact be interesting to show.
I don't know how I should code the calculation of the distance to the train ahead.


Also on the todo list is to properly show the drive by sight speed in drive by sight signs window.
Title: Re: All info in signal window
Post by: Vladki on March 30, 2017, 05:23:50 PM
I dont know the internals about moving block, but my impression was that the beacon tells the passing train, how far is the next train ahead and from that it calculates the max allowed speed. But I don't play with moving block at the moment, so I might be wrong.



Title: Re: All info in signal window
Post by: Ves on March 30, 2017, 06:44:34 PM
Maybe James can clarify what the beacons actually do, and if there is something one can extract from there to show in the info window?
Title: Re: All info in signal window
Post by: jamespetts on March 30, 2017, 10:54:21 PM
The beacons must be placed periodically along the track to allow moving block signalling to work. The exact position of the beacons are not important provied that they are not more than the maximum distance apart from one another. If they are more than the maximum distance apart, the train will revert to the drive by sight working method at the expiry of the maximum distance.

Choose beacons work just like choose signals: the choose path starts from the choose beacon.
Title: Re: All info in signal window
Post by: Ves on March 31, 2017, 12:05:44 AM
Thank you James. Will look if some interesting information can be pulled out to be shown in the window.

Another area, would you guys think it is important to show the monthly cost of the signs/signals in the info window?

edit:
Btw, I think there is a bug somewhere in which directions some of the signs are reporting versus their graphics/functionaly. I will know more and show evidence at some later point.


edit2:
I have added the paranthese with the underlaying track to the signals infowindow as well. Although it can come in very handy to efficienctly check the speed of your network, I am not sure if I think it looks a bit too cloggy. A possibility could be to only show the track speed when the speed of the track is less than half the signal speed (same rule that displays the speed of the signs), however that feels too unconsistent. The current behavior of the signs is fine I think, since those anyway are less important (and since we decide to not show the time since last passed train).

(http://server.exp.simutrans.com/screenshots/signs_signals_infowindow_2.png)

The reason for the amount of names on the signs (ie "end of choose sign" is stated three times) is because the name of the object is shown in the window bar as well as underneith "default player" (same as in the signals info window). the third time is my programmed information text.
Title: Re: All info in signal window
Post by: jamespetts on March 31, 2017, 12:50:00 AM
Interesting, thank you for this. Showing the monthly cost would quite possibly be a good idea; what are others' views on this and the other changes so far?
Title: Re: All info in signal window
Post by: Matthew on March 31, 2017, 10:13:35 PM
Beautiful work, Ves!
Title: Re: All info in signal window
Post by: Ves on March 31, 2017, 11:11:41 PM
Thanks Matthew! :)
What do you think of the suggestion to show monthly costs? And also wether the track speed should be displayed or not?
Title: Re: All info in signal window
Post by: Vladki on April 01, 2017, 05:43:58 AM
Track speed yes, monthly cost yes (if it is not too complicated). Well done Ves



Title: Re: All info in signal window
Post by: thegamer7893 on April 01, 2017, 07:06:46 PM
Will this be a feature in the next Extended update? :)
Title: Re: All info in signal window
Post by: jamespetts on April 01, 2017, 07:19:34 PM
I do not know whether it will be in the next update (as those are automatically compiled every night). I expect that this will be integrated fairly soon, however, once Ves has finished working on it. I do not imagine that either of us can accurately predict how long that that will take.
Title: All info in signal window
Post by: Ves on April 01, 2017, 07:47:29 PM
Im not home over the weekend, but i might have it ready Monday or Tuesday night.
So, fam, to clarify, that means that James can pull my stuff, then it will be in the nightly AFTER all that is done. So hopefully Wednesday or Thursday, or maybe as late as Friday :)
Title: Re: All info in signal window
Post by: thegamer7893 on April 01, 2017, 08:44:04 PM
Ok. :)
Title: Re: All info in signal window
Post by: Ves on April 02, 2017, 09:05:37 PM
What is the difference between "maintenance" and "base maintenance"? I assume one of those (or both) are the monthly cost?
Title: Re: All info in signal window
Post by: jamespetts on April 02, 2017, 10:05:08 PM
Base maintenance is the monthly cost before adjusting for scale, so just use "maintenance".
Title: Re: All info in signal window
Post by: Ves on April 02, 2017, 11:24:05 PM
Thanks! I managed to get it working and get the value to correspond with the value specified in the tooltip display.

Translations should be done too, and everything is online at https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/signal-in-infowindow-2)

A picture of some of the windows:

(http://server.exp.simutrans.com/screenshots/Signs.png)

hmm.. maybe put the "direction" part of the signs window a line down?

Another thing comes to my mind: How should the capital letters be used? I can see that I hace done differently at every translation pass, so it says "Max. Speed", "Min. speed", "Choose Signal", "Choose sign" and all that looks clogged up. How would the proper way to use the english capitals?
Title: Re: All info in signal window
Post by: jamespetts on April 02, 2017, 11:27:28 PM
I suggest having at least two further line breaks in that otherwise somewhat large block of text. A very useful set of information, however!
Title: Re: All info in signal window
Post by: Ves on April 02, 2017, 11:28:35 PM
I edited my post while you posted your post. What do you think of the capital letter issue?

Quote
Another thing comes to my mind: How should the capital letters be used? I can see that I hace done differently at every translation pass, so it says "Max. Speed", "Min. speed", "Choose Signal", "Choose sign" and all that looks clogged up. How would the proper way to use the english capitals?
Title: Re: All info in signal window
Post by: jamespetts on April 02, 2017, 11:33:48 PM
I think that the capitalisation that you have so far is correct, except that words after the colon (such as "East" and "Danger" do not need to start with a capital - but do not worry about this if this would mean defining translations for "danger" and "Danger" separately if it needs to start with a capital elsewhere), and the word "Signal" in "Choose signal" need not have a capital "s".
Title: Re: All info in signal window
Post by: Ves on April 06, 2017, 11:00:29 AM
Ok, I have changed some of the capital letters to lowercase letters, and I think this info window is ready for shipment to the Extended trunk.

One thought I had for a future upgrade to the window, is to show which train is currently reserving the signal when it is not at Danger. Basicly it would be the same information as is currently shown in the way information window, and it should then be shown underneath the signalbox information. Reasons would be, again, to easier present to the player what is actually happening on the map, and minimize the number of clicks and manual calculations that the player have to perform.

I am however reluctant to include it at the moment, since I struggle witht the ::draw part of the code, which I think is needed to get the button appear and disappear properly.
What would you think of such an addition?

You can, however, pull from https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2) in the meantime to get the latest sign-windows and translations  ;D
Title: Re: All info in signal window
Post by: jamespetts on April 06, 2017, 09:19:43 PM
An earlier version has been, but I shall integrate this again with the latest code when I have finished finding/fixing a bug reported by Junna in another thread.

Edit: I think that the Github repository has become corrupted somehow: the latest commit message is:

Code: [Select]
Delete ãˆ½â°¸å¬ ç•³ãµ¢â°°æ˜ æ…¬ãµ§ã€°ã€°ã€°ã€°âãµ°â°°æ„ æ‘¤ãµ²ã¨ºæ™¦æ™¦ã„ºã ¹ã„®ã€°ã„®ãœ´ãˆ®ã”±
and it purports to alter a non-existent file containing a long string of garbled characters. Would you be able to look into this?
Title: Re: All info in signal window
Post by: Ves on April 06, 2017, 09:28:25 PM
Very strange. I did, however, alter the file in the online github, so that might be it?
I have pulled it down to my local version and pushed it again, would you mind try again?
Title: Re: All info in signal window
Post by: jamespetts on April 06, 2017, 09:43:30 PM
That does look better - I will test it when I have a chance.

Edit: Actually, I do not think that this is right: I get merge conflicts when I try to merge this into the master branch, and it looks as though this is now at a much older version. Can you check again?
Title: Re: All info in signal window
Post by: Ves on April 07, 2017, 05:40:48 AM
Try now!
Title: Re: All info in signal window
Post by: thegamer7893 on April 07, 2017, 10:04:15 AM
Ves, has it been put into the nightly pakset yet?
Title: Re: All info in signal window
Post by: Ves on April 07, 2017, 10:28:49 AM
It won't come to any pak sets nightly builds, but if James has time to incorporate it today (and I have not made any more mistakes), it should be in the simutrans extended nightlies of tomorrow :-)
Title: Re: All info in signal window
Post by: jamespetts on April 08, 2017, 06:24:51 PM
Now incorporated - thank you.
Title: Re: All info in signal window
Post by: thegamer7893 on April 08, 2017, 08:43:47 PM
Is it available now? :)
Title: Re: All info in signal window
Post by: jamespetts on April 08, 2017, 08:47:38 PM
I incorporated it just before I posted the message, so it should be in to-morrow's nightly build.
Title: Re: All info in signal window
Post by: thegamer7893 on April 09, 2017, 11:48:20 AM
It has not been incorporated. I downloaded the latest nightly and it has not been added.
Title: Re: All info in signal window
Post by: jamespetts on April 09, 2017, 11:54:24 AM
Which specific features do you think are missing? I have just checked, and it is incorporated so far as I can tell.
Title: Re: All info in signal window
Post by: thegamer7893 on April 09, 2017, 11:57:12 AM
Its the features from Ves's picture from a previous post.
Title: Re: All info in signal window
Post by: jamespetts on April 09, 2017, 12:00:16 PM
Which specific ones? I cannot find any missing.
Title: Re: All info in signal window
Post by: thegamer7893 on April 09, 2017, 12:01:47 PM
The maintenance costs, the way speed and the maximum distance.
Title: Re: All info in signal window
Post by: jamespetts on April 09, 2017, 12:06:57 PM
Those features are all present in the version that I just downloaded. You might want to check that you are downloading from the correct place and that you really are  using the one that you just downloaded rather than an earlier version.
Title: Re: All info in signal window
Post by: thegamer7893 on April 09, 2017, 01:36:40 PM
I am downloading it from your Bridgewater Brunel site.
Title: Re: All info in signal window
Post by: jamespetts on April 09, 2017, 07:42:01 PM
As I wrote, I tested the version from the Bridgewater-Brunel website and the new features are in place, so you have either not downloaded from the right place or are not actually running what you think that you are running.
Title: Re: All info in signal window
Post by: Ves on April 09, 2017, 09:20:17 PM
I just downloaded nightly, and it appears to work properly! :)
Title: Re: All info in signal window
Post by: thegamer7893 on April 09, 2017, 09:52:46 PM
James, could I have your version please via a download link if possible.
Title: Re: All info in signal window
Post by: Ves on April 09, 2017, 10:18:42 PM
This is the one you should download:
http://bridgewater-brunel.me.uk/downloads/nightly/windows/Simutrans-Extended.exe (http://bridgewater-brunel.me.uk/downloads/nightly/windows/Simutrans-Extended.exe)
That link should in fact always work at any time to get the latest windows nightly if Im not mistaken.
Title: Re: All info in signal window
Post by: thegamer7893 on April 10, 2017, 11:37:08 AM
Thank you so much Ves, it works!
Title: Re: All info in signal window
Post by: jamespetts on April 10, 2017, 11:48:11 AM
May I ask what link that you were using that was giving you an incorrect version and where you found that link? I shall have to remove it in order not to confuse others in the future.
Title: Re: All info in signal window
Post by: thegamer7893 on April 10, 2017, 02:59:25 PM
Incorrect version.
Title: Re: All info in signal window
Post by: jamespetts on April 10, 2017, 04:26:25 PM
You wrote that you downloaded the incorrect version from the Bridgewater-Brunel site. May I ask where on that site that you found an incorrect version? I ask so that I can remove it to stop this from happening again.
Title: Re: All info in signal window
Post by: thegamer7893 on April 10, 2017, 05:29:41 PM
Bridgewater Brunel
Title: Re: All info in signal window
Post by: jamespetts on April 10, 2017, 05:59:23 PM
That makes no sense - I was asking for where on that site that you found the incorrect link, so responding with the name of the whole site does not assist. Which specific link did you follow that gave you the wrong version?
Title: Re: All info in signal window
Post by: thegamer7893 on April 10, 2017, 06:43:27 PM
I simply thought it was incorporated into the pakset (pak128.Britain-Ex) its self.
Title: Re: All info in signal window
Post by: Ves on April 21, 2017, 05:45:23 PM
I realized that in some cases the signal state would show as "unknown" instead of the actual state. I investigated a bit and found that a normal permissive three aspect signal would not only use the states "clear=1" and "caution=2" but also "clear_no_choose=5" (and maybe even "caution_no_choose=6"). I just accidentally saw it and it appears to randomly use the .._no_choose state. Is there a reason for this or is it just 'randomnes' in the code? Im not saying it is a problem, I am just curios :)

Here is a correction to it anyway:
https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/commits/signal-in-infowindow-2)
Title: Re: All info in signal window
Post by: jamespetts on April 22, 2017, 12:15:57 AM
Splendid, thank you. Now incorporated.
Title: Re: All info in signal window
Post by: Ves on April 29, 2017, 05:53:17 PM
Given the resent discussion about wether the signal protects a junction, I thought that would be a nice thing to display in the info window. Partly as a piece of information and also to note to people that it is a thing wether there are any junctions ahead or not.
But I have have a question:
When I specify "if (get_no_junctions_to_next_signal() == false)" and show a text if thats true, the text comes and dissapears occasionally when some trains are reserving the signal. It seems very inconsistent and unreliable, so if there is nothing more I can do, I cannot use the parameter to show the text.

How do that parameter work?

edit:
It seem to depend on wether the head of the train has reserved any junction tiles or is in fact on a junction tile.

Do you think it is possible to find out only wether there actually is a junction ahead?
Title: Re: All info in signal window
Post by: jamespetts on April 29, 2017, 07:26:29 PM
One should be careful about adding UI elements for all internal variables like this: the system was designed to work so that the variable is correct at the moment that it needs to be used, not necessarily at other times. One should be able to tell whether a signal protects a junction without looking in its information window in any event.
Title: Re: All info in signal window
Post by: Ves on April 29, 2017, 11:33:37 PM
Ok, I see!
Title: Re: All info in signal window
Post by: Vladki on May 21, 2017, 10:35:35 AM
Hi Ves, could you add the number of aspects to the signal info window?
Title: Re: All info in signal window
Post by: Ves on May 21, 2017, 10:51:40 AM
I had that under consideration earlier but did not put it there because I couldn't at the time think this part through:

I think it would be disinformative to just show the "aspect" value (that would be 2 for a normal stop signal), because what is an aspect really? Imagine a three aspect permissive signal, it would technically have four aspects: danger, clear, caution and callon. Or a choose signal would have all the alternate route aspects as well. Should those be considered aspects too?
You as an experienced player might know the difference, but new players might not.

What I think you want (and what I also would like) is the pure aspect value but it needs to be presented as to what it actually means and that I have not yet figured out a nice simple  way to do. Do you have any suggestions?

Edit:
What one could do, is to *somewhere* write out all possible aspects the signal could do, ie list them like danger, clear, callon. One could even create a new "details" window, where this information, along with other technical and maybe non essential information like intro and expire dates, upgrade group, signal groups etc which are actually not available for view anywhere in the game.
Downside is that you would then expect to find a similar "details" window on all info windows in the game...
Title: Re: All info in signal window
Post by: Vladki on May 21, 2017, 04:14:27 PM
Yeah, I was thinking to show the aspects value from dat file.
Perhaps something like this:

aspects: 2
aspects: 3+callon
aspects: 4+alt. route

Title: Re: All info in signal window
Post by: Ves on May 21, 2017, 04:18:33 PM
Yeah, I was thinking to show the aspects value from dat file.
Perhaps something like this:

aspects: 2
aspects: 3+callon
aspects: 4+alt. route

That could actually work! Will think of it!  :)
Title: Re: All info in signal window
Post by: Ves on May 26, 2017, 09:22:21 PM
(http://server.exp.simutrans.com/screenshots/Signal_info_window_aspects.png)

Should also be stackable +Alt. Route+Call on, for when we get choose signals with call on states!

Found here: https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2 (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signal-in-infowindow-2).

Regarding the base translation file, James would you mind to wait a bit to upload it? I have trouble adding new basefiles and make Github recognize the new files. The way I had to do the last time, I had to manually upload the new file in the webbrowser version of Github, then manually sync it down to my computer. A quite heavy process..
Title: Re: All info in signal window
Post by: thegamer7893 on May 26, 2017, 09:26:35 PM
Whats call on mean?
Title: Re: All info in signal window
Post by: Ves on May 26, 2017, 09:48:22 PM
Whats call on mean?
That is the state of a permissive signal, when it is allowing a train to pass it while it is at danger. The train will change working method to drive by sight I believe.
Title: Re: All info in signal window
Post by: jamespetts on May 26, 2017, 11:00:32 PM
May I suggest that the aspects display be made slightly clearer by adding a space around the + sign and not using capitals for things like "alt route"?

As to adding things in Git, all that you need to do is issue the command git add <filename> or git add --all.
Title: Re: All info in signal window
Post by: Ves on May 29, 2017, 11:44:35 AM
Ok, I have pushed a new commit! Also, I have made a third text string which will display if signal is both a choose and permissive, although the signal type does not exist yet.
Title: Re: All info in signal window
Post by: jamespetts on May 31, 2017, 11:04:05 AM
Splendid, thank you for that. Apologies for the delay: I have been staying with my parents, so it is not easy to deal with coding matters on my secondary computer, but I have managed to pull your updates and push them to the master branch, so these should be in the next nightly. Thank you again for your work on this.
Title: Re: All info in signal window
Post by: Vladki on June 11, 2017, 01:13:31 PM
Thank you for this patch. But there is a minor bug. It shows Aspects: X+alt route for all choose signals, even if they do not have a special aspect for alt route. Similarly all permissive signalls have Aspects X+callon even if they do not have a special call on aspect.
Title: Re: All info in signal window
Post by: Ves on June 11, 2017, 02:52:05 PM
My post nr 1000! :)

I did that on purpose, since I think that the status of the signal doesnt care wether there are any extra defined images.
It would be confusing, I believe, if you read that this signal has 2 aspects, you would believe them to be clear and danger, but suddently "clear, alt. route" shows up.
Same with permissive signals, the call on state would show up even if there are no graphics that support the call on state.
Title: Re: All info in signal window
Post by: Vladki on June 11, 2017, 06:43:37 PM
But it already says whether it is permissive or choose signal. In my opinion it is confusing if it says that there is a callon / choose aspect and it does not show it, when it should... Can anybody else say what would be more preferable information?
Title: Re: All info in signal window
Post by: Ves on June 11, 2017, 08:09:55 PM
Ok, its not good if it is confusing. What do other people think?
Title: Re: All info in signal window
Post by: Ves on May 22, 2019, 03:21:30 PM
So, two years later, what information has been proven usefull and what have not in the signal window? :P

One thing I have been missing is the distance to the following signal. When I started to look at it, though, I realized that whenever there is a junction, the window would have to count the tiles in both directions from the junction, as there would be no way (that I could think of) to know what way would be the "main" way, if there ever was to be one. Therefore I made it stop whenever it reaches a junction. Locating junctions is btw also a good thing, in particular for the two time interval working methods, since if there is a junction before the next signal it would send the train away only in half line speed. Now I know there is some more logic to that when the junction is in near vicinity of the signal, but due to the "junction issues" i described earlier it would most likely not work.

Multi aspect signals display the line of stop signals ahead they have aspects for so you can determine what is the longest braking distance possible on the line. Unfortunately, the junction problem comes in here as well, and the signals will not show signals beyond the junction.

It works by counting the tiles from the signal and check what is on them.

James, I dont really remember, but what presignal working methods are compatible with what stop signal working methods? If, say I put an absolute block presignal in front of a time interval stop signal, how would it behave?
With this system warnings could be put in place if certain combinations are not valid.
Title: Re: All info in signal window
Post by: Vladki on May 22, 2019, 03:38:11 PM
In case of junctions, if there is a reservation through the junctions then use it as the path to next signal(s) to show the distance to next signal. If no reservation, then show distance to the junction.

Also the information about direction of signal is wrong on diagonals / corners.
Title: Re: All info in signal window
Post by: Ves on May 23, 2019, 09:14:27 AM
That is a good suggestion. Will need to think of how to accomplish that!

I have now fixed the wrong direction on diagonals!

I have also added a button that opens the signalbox infowindow and sets that to be the so called "default signalbox" from which you buy new signals.

Need to address the bad signalbox name which overlaps the buttons in when it spills over to the next line.

Skickat från min ONEPLUS A6003 via Tapatalk

Title: Re: All info in signal window
Post by: Jando on May 23, 2019, 09:46:07 AM
So, two years later, what information has been proven usefull and what have not in the signal window? :P

It's actually pretty rare that I open a signal window, or rather: with most signals I open it exactly once: namely after placing the signal to look at the distance to the signal box. :) And if it's not 1.8 kms (i.e. the max. possible distance for mechanical boxes) away from the box I reload the game to place the signal box on another tile. When signalling a line I usually know pretty well where I want the signals to be, the hard thing is figuring out where to place the box, lol.
Title: Re: All info in signal window
Post by: Ves on May 25, 2019, 10:11:04 PM
Yeah, a feature which shows the catchment area of a signalbox would indeed be useful!

You never use the window to debug problems in your network?
Title: Re: All info in signal window
Post by: Jando on May 25, 2019, 11:45:40 PM
Yeah, a feature which shows the catchment area of a signalbox would indeed be useful!

You never use the window to debug problems in your network?

Not really no. Of course now I could claim that my networks don't have problems, hehe. Okay, more a result of trial and error, by now I have figured it out. But then I mostly play before power boxes are a thing thus it's practically all absolute block signalling on my lines anyway - and absolute block is a pretty straightforward thing. Stop signal, distant signal and combined signal - not much choice to create problems there. :) And when I get a problem it's usually that I mis-clicked and placed a stop signal instead of a distant signal thus trains slow down where they should not.

Really, the only info in the signal window I need is the distance to the box and the type of the signal, the latter mostly because one needs to look very carefully to see the difference between a stop signal and a distant semaphore signal.
Title: Re: All info in signal window
Post by: Vladki on May 26, 2019, 10:18:57 AM
Yeah, a feature which shows the catchment area of a signalbox would indeed be useful!
I like that idea. Not only for signalbox but also for signal. Just using the same graphics as for stop coverage would be nice.
Title: Re: All info in signal window
Post by: Ves on May 28, 2019, 03:25:04 PM
I have been toying around with the feature of showing information from the train that is reserving through the signal, and I am not convinced of it...
Currently I have made a text that swaps out with the text I mentioned earlier that displays "next stop signal in danger: xxx", or if the route ends before there is a stopsignal, it reads "clear till end of route: xxx".
It would also be possible to make it count how many signals it passes, wether they are multiple aspects etc.
But I wonder how usefull any of this is? Many signals just show danger for long periods of time, displaying the static display I mentioned in my previous post. Most of the time there are no reservations through the signal, so this information will mostly be hidden from the user. The information is not that usefull either IMO since the block reserver tool anyway gives a much clearer visual picture of how long a reserved block might be.
Storing the information on what route trains normally take I guess is also not viable, since that might be quite alot of extra memory just for this small GUI-feature.

So I think we should abolish taking the route from passing vehicles to find out where oncoming signals are, and instead only show the static display.
Title: Re: All info in signal window
Post by: Ves on May 29, 2019, 10:41:20 PM
I have now found out how to make the range of the signalbox/signal visible on the ground when buying the signalbox/signal, just like the range is visible when you buy stations today.
BUT
The area covered are expressed as a two value coordinate, meaning that it is represented as a square... Since circles and squares never really have come along, the square pattern on the ground will in practice not display the actual coverage radius of the signalbox or signal.
The coding of this is dug deep down into the simutrans code and is likely not anything that I am capable of changing. And if it ever where to change, it probably should be synced with Simutrans Standard.

So, after that drawback, there might still the posibility to have a coverage shown on the ground much like pressing the 'v' key displays station coverage. It is not as clean and you need to build the signalbox before you can press the key, but would you think that feature usefull instead of the failed above one? In which case we should assign another key to this kind of coverage, perhaps having a button in the signalbox info window to toggle the coverage on and of.
Title: Re: All info in signal window
Post by: Ves on May 31, 2019, 03:16:08 PM
Triple post!  ;D

There is now a ready update to the signal window, where the name of the signalbox now will look good, even though it would be a very long signalbox name.
Also, as mentioned earlier, there is a new button in the window that will open up the info window of the connected signalbox and set that as the "default signalbox" from which to buy new signals.
And also, the feature of showing the next signal, junction, or end of line, in the signal window. It has the limitations I outlined earlier in the thread.

(https://live.staticflickr.com/65535/47972859716_4cf9739dac_o_d.png)

Lastly and not related to the signals, I took the liberty to change some translations from the class manager's, where it had not been properly renamed to "price" instead of "class". It should help avoid further confusion in that window.

If you would like to implement this, the code is located here:
https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/gui-small-improvements (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/gui-small-improvements)
Title: [Q] All info in signal window
Post by: thegamer7893 on June 01, 2019, 01:18:41 PM
Triple post!  ;D

There is now a ready update to the signal window, where the name of the signalbox now will look good, even though it would be a very long signalbox name.
Also, as mentioned earlier, there is a new button in the window that will open up the info window of the connected signalbox and set that as the "default signalbox" from which to buy new signals.
And also, the feature of showing the next signal, junction, or end of line, in the signal window. It has the limitations I outlined earlier in the thread.

(https://live.staticflickr.com/65535/47972859716_4cf9739dac_o_d.png)

Lastly and not related to the signals, I took the liberty to change some translations from the class manager's, where it had not been properly renamed to "price" instead of "class". It should help avoid further confusion in that window.

If you would like to implement this, the code is located here:
https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/gui-small-improvements (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/gui-small-improvements)

So, you would be allowed to name the signalling centre and when will this be implemented in the latest nightly builds of the game?
Title: Re: All info in signal window
Post by: Ves on June 01, 2019, 05:31:56 PM
Unfortunately no, you cannot name the sigbalboxes yourself with this patch. It is the name of the signalboxes as presented in the game, which might be longer than fitting in one line. I just set the limit to five lines, and created an example name to debug it.
Title: [Idea] All info in signal window
Post by: thegamer7893 on June 01, 2019, 06:35:18 PM
Unfortunately no, you cannot name the sigbalboxes yourself with this patch. It is the name of the signalboxes as presented in the game, which might be longer than fitting in one line. I just set the limit to five lines, and created an example name to debug it.

Okay, however imo I just thought it could be a good idea to that say if you are recreating the train lines (i.e. the WCML) you could rename the signalling centres to the appropriate names (i.e. Wembley SCC or Stafford PSB)
Title: Re: All info in signal window
Post by: Matthew on June 02, 2019, 12:20:43 AM
I have now found out how to make the range of the signalbox/signal visible on the ground when buying the signalbox/signal, just like the range is visible when you buy stations today.
BUT
The area covered are expressed as a two value coordinate, meaning that it is represented as a square... Since circles and squares never really have come along, the square pattern on the ground will in practice not display the actual coverage radius of the signalbox or signal.

 ;D Frustrating!

The coding of this is dug deep down into the simutrans code and is likely not anything that I am capable of changing. And if it ever where to change, it probably should be synced with Simutrans Standard.

So, after that drawback, there might still the posibility to have a coverage shown on the ground much like pressing the 'v' key displays station coverage. It is not as clean and you need to build the signalbox before you can press the key, but would you think that feature usefull instead of the failed above one? In which case we should assign another key to this kind of coverage, perhaps having a button in the signalbox info window to toggle the coverage on and of.
[/quote]

Yes, I think that would be very useful, both for planning new signalboxes and for working out where to build new junctions and passing loops.
Title: Re: All info in signal window
Post by: jamespetts on June 04, 2019, 09:21:45 PM
Splendid, thank you very much for that. I have now incorporated this.

May I check whether you have uploaded the translation base texts to Simutranslator? I cannot recall whether you have access to that; I know that Ranran was granted access a while back.
Title: Re: All info in signal window
Post by: Ves on June 04, 2019, 11:02:58 PM
Great, hope you like it!
No, I have no access to the simutranslator!
Title: Re: All info in signal window
Post by: jamespetts on June 04, 2019, 11:27:29 PM
In which case, may I suggest that you ask Mackie to gain access to this? This will be helpful whenever you add GUI features as well as if you ever wanted to maintain the Swedish translation.

Once you have access, you can add the base texts to Simutranslator yourself.
Title: Re: All info in signal window
Post by: Ves on June 05, 2019, 09:22:20 PM
True, I will look into getting that acces. In the mean time, could you perhaps upload it so we dont forget it?
Title: Re: All info in signal window
Post by: jamespetts on June 05, 2019, 09:29:59 PM
Done.
Title: Re: All info in signal window
Post by: Ves on June 06, 2019, 08:08:50 AM
Great, thanks. I just got response from Makie, that a limit of three accounts can upload basefiles for extended, and those three are all taken. So until that limit is expanded, Im afraid I will have to ask you to upload the basefiles for me.
Title: Re: All info in signal window
Post by: Matthew on June 07, 2019, 08:17:44 PM
Also, as mentioned earlier, there is a new button in the window that will open up the info window of the connected signalbox and set that as the "default signalbox" from which to buy new signals.
And also, the feature of showing the next signal, junction, or end of line, in the signal window. It has the limitations I outlined earlier in the thread.

Yesterday I used these new Quality of Life features for the first time and they saved a lot of clicking, so thank you! Planning & buildings signal can be complicated, but it's easier when you don't have to keep hunting for the right signalbox.
Title: Re: All info in signal window
Post by: Phystam on June 08, 2019, 05:19:22 AM
I translated these translatable texts of this patch into Japanese.
Title: Re: All info in signal window
Post by: Ves on June 09, 2019, 02:53:32 PM
Im happy you found it useful! :)

I have now also looked into the possibility of having it display on the ground like pressing the "V" key for stations, and unfortunately that is working the same way I realize.
However, I am looking into a method of displaying a ring of tiles by marking them individually and not as a clump. If it works, that might be a possibility, perhaps also for displaying coverage radius when building signalboxes/signals. Note that the ring for big coverage radiuses would be pretty big and out of screen if too big...
Title: Re: All info in signal window
Post by: Ves on June 14, 2019, 02:38:06 PM
(https://live.staticflickr.com/65535/48061374581_2af7d0affa_o_d.png)

https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signalbox-range-display (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signalbox-range-display)

If you click the clickbox, the range of the currently selected signalbox will be displayed on the ground like in the picture above. The cross on the ground is to show which signalbox the circle is surrounding. Usefull especially for larger signal box ranges, where you cannot zoom out to get a view of the entire range circle. The cross could even made to grow when the range is bigger to help locate the signalbox, alternatively extend all the way out to the circle.
Should be ready for integration.
Title: Re: All info in signal window
Post by: Matthew on June 15, 2019, 12:28:25 AM
(https://live.staticflickr.com/65535/48061374581_2af7d0affa_o_d.png)

https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signalbox-range-display (https://github.com/VictorErik/Simutrans-Experimental-Ves/tree/signalbox-range-display)

If you click the clickbox, the range of the currently selected signalbox will be displayed on the ground like in the picture above. The cross on the ground is to show which signalbox the circle is surrounding. Usefull especially for larger signal box ranges, where you cannot zoom out to get a view of the entire range circle. The cross could even made to grow when the range is bigger to help locate the signalbox, alternatively extend all the way out to the circle.
Should be ready for integration.

Amazing work, Ves! That's a really useful Quality of Life feature for Extended. Thank you for your work on this!
Title: Re: All info in signal window
Post by: jamespetts on June 16, 2019, 11:57:40 AM
Thank you for this - this is a most useful feature. Two things needing to be done before integration: first of all, the new TOOL_SHOW_SIGNALBOX_COVERAGE needs to be placed after TOOL_CHANGE_ROADSIGN=0x0080, as all Simutrans-Extended specific tools need to have a number >= 128 to allow for future Standard tools to be added without causing disruption, as has happened in the past.

Secondly, I will need a .dat file for the new translation text in the display dialogue.

Thank you again for this!
Title: Re: All info in signal window
Post by: ACarlotti on June 16, 2019, 04:49:01 PM
first of all, the new TOOL_SHOW_SIGNALBOX_COVERAGE needs to be placed after TOOL_CHANGE_ROADSIGN=0x0080, as all Simutrans-Extended specific tools need to have a number >= 128 to allow for future Standard tools to be added without causing disruption, as has happened in the past.
Specifically, it should be added after every existing Extended tool, so as not to change the numbers of existing tools.
Title: Re: All info in signal window
Post by: jamespetts on June 16, 2019, 07:16:48 PM
Specifically, it should be added after every existing Extended tool, so as not to change the numbers of existing tools.

Yes, this is correct - thank you for the clarification.

Incidentally, can anyone suggest a good keyboard shortcut key for this (that is not already spoken for)?
Title: Re: All info in signal window
Post by: Ves on June 16, 2019, 08:32:20 PM
What would this be specifically?

Code: [Select]
enum {
// simple one click tools
.....
TOOL_SHOW_RIBI_DEPRECATED,
TOOL_RECOLOUR_TOOL_DEPRECATED,
TOOL_ACCESS_TOOL_DEPRECATED,
SIMPLE_TOOL_STANDARD_COUNT,
TOOL_CHANGE_ROADSIGN=0x0080,
TOOL_SHOW_RIBI,
TOOL_RECOLOUR_TOOL,
TOOL_ACCESS_TOOL,
TOOL_SHOW_SIGNALBOX_COVERAGE,
SIMPLE_TOOL_COUNT,
SIMPLE_TOOL = 0x2000
};
This is the end of the section. Everything before "TOOL_CHANGE_ROADSIGN=0x0080," is Standard stuff and everything after is Extended I suppose?. I guess that the two last entries ("SIMPLE_TOOL...") has to be at the very end, so is the position correct as I have put it?

Edit:
The translation basefiles are uploaded to the translator now!
Title: Re: All info in signal window
Post by: ACarlotti on June 16, 2019, 10:02:03 PM
This is the end of the section. Everything before "TOOL_CHANGE_ROADSIGN=0x0080," is Standard stuff and everything after is Extended I suppose?. I guess that the two last entries ("SIMPLE_TOOL...") has to be at the very end, so is the position correct as I have put it?
Yes
Title: Re: All info in signal window
Post by: Ves on June 16, 2019, 10:36:51 PM
Great, thanks! The fixes should be online now.
As for a shortcut key I have noe clue... "s" as in "signalbox", or "r" as in "range"?
Title: Re: All info in signal window
Post by: jamespetts on June 17, 2019, 12:06:59 AM
Thank you for that : I will look into this when I have a moment.

As to the shortcut keys, I believe that all the letter keys are taken, so we only have a few symbol keys left available.
Title: Re: All info in signal window
Post by: jamespetts on June 17, 2019, 08:07:47 PM
I have now incorporated this. I have set the keyboard shortcut to the $ symbol, as there are very few vacant keyboard shortcuts left.
Title: Re: All info in signal window
Post by: ACarlotti on June 18, 2019, 03:00:27 AM
There is a mistake in the change - you have modified the loadsave routine in dataobj/environment.cc without putting the new code inside a version check. The result is that the game will crash when trying to read settings-extended.xml.
Title: Re: All info in signal window
Post by: Ves on June 19, 2019, 10:17:30 AM
There is a mistake in the change - you have modified the loadsave routine in dataobj/environment.cc without putting the new code inside a version check. The result is that the game will crash when trying to read settings-extended.xml.
Ok thanks! What is the principle with putting the stuff inside the version checks?
I suppose I need to put it in one of these checks, but which:

Code: [Select]
if(file->get_extended_version() >= 6)
{
file->rdwr_bool(hilly);
file->rdwr_bool(cities_ignore_height);
}

if( file->get_extended_version() >= 9 || (file->get_extended_version() == 0 && file->get_version()>=102003))
{
file->rdwr_long( tooltip_delay );
file->rdwr_long( tooltip_duration );
file->rdwr_byte( front_window_bar_color );
file->rdwr_byte( front_window_text_color );
file->rdwr_byte( bottom_window_bar_color );
file->rdwr_byte( bottom_window_text_color );
}

if(file->get_extended_version() >= 9)
{
file->rdwr_long(number_of_big_cities);
file->rdwr_long(number_of_clusters);
file->rdwr_long(cluster_size);
file->rdwr_byte(cities_like_water);
}

if(  file->get_version()>=110000  ) {
bool dummy = false;
file->rdwr_bool(dummy); //was add_player_name_to_message
file->rdwr_short( window_snap_distance );
}

if(  file->get_version()>=111001  ) {
file->rdwr_bool( hide_under_cursor );
file->rdwr_short( cursor_hide_range );
}

if(  file->get_version()>=111002  ) {
file->rdwr_bool( visualize_schedule );
}
if(  file->get_version()>=111003  ) {
plainstring str = nickname.c_str();
file->rdwr_str(str);
if (file->is_loading()) {
nickname = str ? str.c_str() : "";
}
}
if(  file->get_version()>=112006  ) {
file->rdwr_byte( background_color );
file->rdwr_bool( draw_earth_border );
file->rdwr_bool( draw_outside_tile );
}
if(  file->get_version()>=112007  ) {
file->rdwr_bool( second_open_closes_win );
file->rdwr_bool( remember_window_positions );
}
if(  file->get_version()>=112008  ) {
file->rdwr_bool( show_delete_buttons );
}
if( file->get_version()>=120001 ) {
file->rdwr_str( default_theme );
}

if(  file->get_version()>=120002 && (file->get_extended_version() == 0  || file->get_extended_revision() >= 10 || file->get_extended_version() >= 13))
{
file->rdwr_bool( new_height_map_conversion );
}
// server settings are not saved, since the are server specific and could be different on different servers on the save computers
}
Title: Re: All info in signal window
Post by: jamespetts on June 19, 2019, 10:29:21 AM
In general, any code that reads and writes anything from the saved game needs to be in a version check. The load/save format is very basic, in that it is just a string of game data with no control data of any sort telling the loading routine what the data are. Thus, the code needs to know precisely what order that the data will be in. It does this by knowing the exact version of the saved game file. Any changes, however slight, to what data are loaded and saved requires incrementing the file version and having code that detects for whether the file is the old version (in which case, only the data in the old version should be read/written) or the new version (in which case, the new data are read/written).

There are two version numbers: the extended_version and the extended_revision. The extended_version is the major version (currently 14) and the extended_revision is the minor revision. For making anything other than very major changes (such as those on the vehicle management branch), increment only the minor version (that is EX_SAVE_MINOR; EX_VERSION_MINOR has no effect on the saved games). Because the revision number (EX_VERSION_MINOR) is reset whenever the version is incremented, you will have to have a double check; the new code needs to be read if and only if the major version is 14 (the current major version) AND the revision is equal to or greater than whatever number that you have incremented it to (presumably 12), OR if the major version is 15 or greater whatever the revision number.
Title: Re: All info in signal window
Post by: Ves on June 19, 2019, 10:38:55 AM
Thanks, how do I check what number the revision is incremented to?
Title: Re: All info in signal window
Post by: jamespetts on June 19, 2019, 12:09:30 PM
It is the number that you manually type in in simversion.h in place of the existing number. It should be 1 greater than the existing number.
Title: Re: All info in signal window
Post by: Ves on June 19, 2019, 01:42:26 PM
Ok thanks, I believe I understand!

I have made this entry now in environment.cc:
Code: [Select]
if ((file->get_extended_version() == 14 && file->get_extended_revision() >= 12) || file->get_extended_version() >= 15)
{
file->rdwr_byte(signalbox_coverage_show);
}

And altered this entry in the simversion.h to read 12:
Code: [Select]
#define EX_SAVE_MINOR 12which was previously at 11.

Is this correct and sufficient?
Title: Re: All info in signal window
Post by: jamespetts on June 22, 2019, 10:54:28 AM
This would be correct if this had been done in the first instance. However, the current situation is more complex, because we now have people who have run the incorrect version and saved contaminated files. Luckily, these particular data are saved in a separate .xml file (~/simutrans/settings-extended.xml) and not with the saved games. If this had been saved with the saved games, serious problems would have occurred, because two incompatible saved game formats, one with and one without this datum, would have existed, both with the same version number and would thus be indistinguishable by the code in trying to read them.

I have made and committed this change. Users will have to delete their ~/simutrans/settings-extended.xml to be able to load the game.
Title: Re: All info in signal window
Post by: Ves on June 22, 2019, 05:10:23 PM
Oh, I am sorry I have caused this! Thank you for doing the fix and explaining how things should work.