News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

All info in signal window

Started by Ves, September 05, 2016, 10:53:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ves

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!

jamespetts

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).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Will look into the underground text!

Yes it's in vector_tpl. Doing that, will it help avoiding the crash or only in debugging?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

#39
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?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Thanks!
It should crash with this game Savegame to the big map:
http://server.exp.simutrans.com/savegames/My_fair_Lady_2.sve

Just fast forward and it should occur

jamespetts

Thank you - for how long do I need to fast forward it? I have reached November 1951 and no crash so far.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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?

jamespetts

Thank you, that is very helpful. From what I have seen of them so far, the new additions seem very helpful - thank you!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

#45
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

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

#47
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
and
https://github.com/VictorErik/Simutrans-Experimental-Ves/commit/41ce13f3a4700b9d433741702dcdbed1d8cc8638

jamespetts

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!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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

I rearranged the base texts, so all signal related go into the above mentioned file.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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:
Permitted direction: East
The 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:
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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

#55
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.

QuoteThank 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:



Maybe worth adding to the signals info window as well, so it becomes easier to check for players.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

Vladki

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...

Sent from my ONEPLUS A3003 using Tapatalk


Ves

Quote from: 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)
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.

Vladki

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.

Sent from my ONEPLUS A3003 using Tapatalk


Ves

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?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

#63
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).



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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Matthew

(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Ves

Thanks Matthew! :)
What do you think of the suggestion to show monthly costs? And also wether the track speed should be displayed or not?

Vladki

Track speed yes, monthly cost yes (if it is not too complicated). Well done Ves

Sent from my ONEPLUS A3003 using Tapatalk


fam621

Will this be a feature in the next Extended update? :)

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.