OpenBVE
OpenBVE copied to clipboard
[Suggestion] RouteViewer display Rail number and colorling line onto the rails
Description
When we are creating the route, we are sometimes confusing that what is this rail number.
Or, when we create the side objects etc (such as walls and dikes) using by rail, we are diffuclt to find what is the rail no. A Japanese user suggested me, I also think that if the rail number and colorling is display on the rail, it is incredibly useful.
We propose a function to display the rail number and the corresponding color on the track.
An example image is shown in the figure.
Reproduction
Nothing
Route
Nothing
Train
Nothing
Logs
Nothing
Related information
My PC's spec: OS:Ubuntu 20.04 LTS 64bit CPU:AMD® Ryzen 7 2700x eight-core processor × 16 Memory:31.3GB Graphic:AMD Radeon RX 590 Series (POLARIS10, DRM 3.40.0, 5.11.0-40-generic, LLVM 12.0.0)
I am a Japanese user who made a suggestion to ginga81. I think this feature is very useful for all creators and I hope you will consider implementing it. (This text is translated from DeepL and may contain some unnatural parts.)
For example, when a route producer sets up the syntax for a function that can run on other tracks, which is currently being considered for implementation, it will be easier to set up because the tracks can be visually determined.
The most recent build from today implements the start of this. https://vps.bvecornwall.co.uk/OpenBVE/Builds/OpenBVE-2022-05-24.zip
Press P to show / hide rail paths, Colors are remembered througout the session, but will be freshly randomly generated at the start of the next.
I haven't yet added a key (this will I think need to be in a popup window, as per the errors log) It also has issues when rails run along the same path, and the color selection could likely be better.
All of this is subject to change, but see what you think.
n.b. This doesn't work too well when the route producer has made heavy use of rails for scenery placement. Not a lot that can be done there at the minute.....
It is very nice!
But, in this case, we can't recognize what rail number the white and cyan rail?
To recognize, I think that to display the rail number somewhere such as my example screenshot.
Rail0=red
Rail20=Yellow
Rail3=Blue
etc...
Thank you for implementing it. It is exactly our ideal form. But if we want, as ginga81 said, it would be nice if you could make a column to show how the color and rail number correspond to each other. Thank you very much for your consideration.
Absolutely, I intend to- This was just the first experimental steps :)
It's probably going to be a popup window, where you can choose the rails to be displayed, a color picker etc. Will try and sort something out today, if not might be next week by the time I get some more time available to really work on things.
Please try the build from today.
This implements the popup window I mentioned. Toggling path drawing on / off must now be done using the checkbox in this window. (Could change to a different key to show the window, but that starts to get messy- Any other thoughts?)
Notes:
- Getting this working on Linux is messy- For the window to work, it must be shown as a blocking dialog (it must be closed for changes to take effect)
- No color picker yet.
- Need to implement the GL3 version of this.
- Haven't implemented the description box yet.
- Window sizing probably needs tweaking.
How meny good this!
Espacially, Currently visible status is supreme!
As you say, at Linux, to enable, to close window is a bit takes time and effort.
But, I think that not mind, because this function is more, more useful!
I think a bit, in this figure, two rails are not display. To show, we have to move to the display distance. I think that to useful more, all of rails colors should be able to always display within the drawing distance.
Additionally, to more visibility, I think that the bars pixel width should be able to change in the setting window.
I'd guess at a blending effect (as the line gets farther away, it gets blended into the surrounding pixels, so may end up dissapearing depending on the surroundings. Not a lot we can do if this is the case)
Another thing on my list to add is the ability to change the line size on a per-rail basis, which will probably help with this a bit.
Looking at your image, we probably want to tweak sorting a bit too. Not sure how off the top of my head, but perhaps display the visible rails first in the list. Not sure if sorting using the column headers will work or not (not tried it), but might well produce unexpected results.... Wants thinking about a bit.
I have just tested this new function, and I have already found 2 bugs:
-
Firstly, I pressed the "P" button, then I ticked the field of "Enable Drawing of Rail Paths". After that I clicked the "Close" button. It worked / works properly to this point. However, when I press(ed) the "P" button again after this method, the Route Viewer crashes and it's closed itself.
-
How you can see in the attached picture, the popup window will need some improvements in full size / screen (1920 × 1080 px) mode, but it is not a critical bug like the first one.
That's odd. I definitely tested re-opening the window. Silly question- did you move it or anything? (track position wise)
Sizing is known and needs tweaking. It probably shouldn't be allowed to go full-screen, or at the least to sensibly resize appropriately.
I have tried it without moving and also with moving and without resizing the Route Viewer window (I haven't sized to full-screen.). The bug also persists in these cases. I use the new renderer (GL 3.0), the latest nightly build and Windows 10 64-bit 21H2. (I’d actually be happy, if I could help develop OpenBVE, but I have to learn this and that to reach this dream.)
In my environment, didn't crash when the fullscreen. But, didn't work Display check button. The color lines are always displaying even the Display unchecked.
Added description today (sorry, things getting in the way of development....) Editing the line width is actually a massive pain, as there's no way to get a numeric up / down into a datagrid view without custom code :/
Could do this easily enough via a popup, but I'm not sure that it's important enough to do that. Anyone with other thoughts would be appreciated.
Next thing I think we need is going to be an additional file, which we can parse to load the path colors / descriptions, so that we don't have to do this from scratch every time. That feeds into running on multiple rails tangentially too (short descriptions would likely be of use here) https://github.com/leezer3/OpenBVE/pull/329
Something like the following:
<?xml version="1.0" encoding="utf-8"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<RailStates>
<Rail>
<Number>0</Number>
<Description>Main running rail</Description>
<Color>0,0,0</Color>
<VisibleByDefault>true</VisibleByDefault>
If VisibleByDefault is on, and rail is marked as drivable, show on map (??)
It'd also be useful for RouteViewer to save this data if it loads it. My only issue with that is that this could be seen as unexpected with regards to it's other behaviour (e.g. it saves nothing else) Might however be a start on turning it into a true editor- Could likely do the same by converting things such as the lighting into XML and saving. I'm not sure however how this might work with deep levels of $Include that some developers such as yourself use :)