Trainz on Linux in 2022

Update: I now have TrainzUtil.exe commands running successfully from inside jEdit. I should soon be able to edit my script files in jEdit and commit them to the trainzbase without exiting the editor. Reviewing errors and warnings will also be possible, as will many of the other Content Manager commands, although some of them would work better if I could see the command`s progress as it runs, and having the editor able to see and process them on-the-fly would also be useful, but I don`t see any way to do that with any of the editor`s scripting facilities I am familiar with. At least it is working, whatever the inconveniences.
 
Update: I now have TrainzUtil.exe commands running successfully from inside jEdit. I should soon be able to edit my script files in jEdit and commit them to the trainzbase without exiting the editor. Reviewing errors and warnings will also be possible, as will many of the other Content Manager commands, although some of them would work better if I could see the command`s progress as it runs, and having the editor able to see and process them on-the-fly would also be useful, but I don`t see any way to do that with any of the editor`s scripting facilities I am familiar with. At least it is working, whatever the inconveniences.
Good to hear. TrainzUtil doesn't output much in the way of information when run from the command line. By default, it sends the output to the screen in the program, meaning the log that we can't save.
 
Good to hear.
Thank you.
TrainzUtil doesn't output much in the way of information when run from the command line.
That all depends on which command you run. Some of them generate huge quantities of output.

By default, it displays its output in STDOUT, which Content Manager intercepts and edits before displaying in its own window.

I`m doing much the same thing, except that I haven`t been able to capture the output live. I have to wait for the command to finish before I can access any of it.

Once the data is captured, however, the jEdit scripting features make massaging the output easy; I just haven`t managed to get far enough to massage any of the output yet. The first thing I want is to be able to identify errors in compiling script files, to automate positioning the edit cursor where the error was detected. It should be easy enough to do, as the output for that is quite regular and easy to parse.

Copied from my TrainzLibrary.bsh file:
Code:
/* beanshell commands:
source(".jedit/macros/_Custom/Trainz/Library.bsh");
trainzInstallFromPath(TrackLibLibraryPath);
trainzCommit(TrackLibLibraryKUID);
trainzValidate(TrackLibLibraryKUID);
*/
The source command can be entered into jEdit`s BeanShell console to make the rest of the library available there, or placed at the top of a macro to make it available to the macro. The remaining three do just what they look like they should do: they call runTrainzUtilCommand(String Command) with the command mentioned in the name and the data supplied in the parameters. runTrainzUtilCommand always dumps the output into a new buffer.

I also have two functions, one with two arguments that generates KUID strings and one with three that generates KUID2 strings. This is about all that exists in the library. I also have two macros that use the library, one that fetches the TrainsUtil Help output and one that runs a DataBase Rebuild.

This is about as much as my jEdit/TrainzUtil interface has, so far, but I am working on my Trainz project in very-slow-motion, building new BeanShell script to process the various steps as they come up. I`m also still finding things that need tweaking in my Python script to generate code for my project from the Trainz include files. Because I am so early in the process, fixing the code generator can still be faster than fixing the generated code.
 
I`m sorry for making a new post instead of editing and extending my previous post, but I have an issue that I think is rather severe, and could use some help on.

Something seems to be wrong with my trainzbase. Something seems to be so wrong with my trainzbase that a DataBase Rebuild refuses to complete. Something seems to be so very wrong with my trainzbase that an Extended DataBase Rebuild refuses to complete.

When I attempt to run one, the rebuild progresses so far, and falters. The output of the command stops accumulating when run from Content Manager, and no output is displayed at all when run from a console. When my System Monitor software stops showing CPU utilization at 400% (I can have up to four hardware threads running simultaneously on the CPU chip), it also continues to show both Trainz itself and TrainzUtil running at "idle"-level CPU usage. When I close the last window, TRS22.EXE usually continues to run for up to several seconds, but after a rebuild, it does not exit at all. I left the system running overnight with no change in status. I have had several DBRs complete on the same system that I first noticed the issue on, so I figure that there is something that has happened recently that is causing the issue. I suppose that what I had just done when I first noticed that something was "half a bubble off-plumb" was probably what triggered it, but performing an Import from Directory shouldn`t do anything like this. Could starting a DBR before an Import from Directory completes do this? I don`t think that I did that, but I cannot swear to it, and I did run a DBR after the Import. I just think that I waited long enough first.

I do not know why, but it also always shows the CPU time used by TrainzUtil being accounted to TRS22.EXE instead, and apparently always has, but this is probably unrelated.
 
Something seems to be wrong with my trainzbase. Something seems to be so wrong with my trainzbase that a DataBase Rebuild refuses to complete. Something seems to be so very wrong with my trainzbase that an Extended DataBase Rebuild refuses to complete.

Try this here:

Delete these files:
assets.tdx
asset-cache.tdx

Empty the contents of the following folders:

cache/internet
cache/libraries

Once complete, open Content Manager.
 
I now have the retail version of TRS22 PE installed in Debian Linux using the Lutris interface with all available update patches loaded in. All is good, - very good in fact. To tell the complete truth that surprised me since recent updates for TRS22 caused all kind of problems for some Trainz folk. Perhaps I got away with it because I'm not running Windows or DirectX.
Still running Debian Linux on my older model HP Z200 Xeon computer and it seems to be coping Ok.
 
I now have the retail version of TRS22 PE installed in Debian Linux using the Lutris interface with all available update patches loaded in. All is good, - very good in fact. To tell the complete truth that surprised me since recent updates for TRS22 caused all kind of problems for some Trainz folk. Perhaps I got away with it because I'm not running Windows or DirectX.
Still running Debian Linux on my older model HP Z200 Xeon computer and it seems to be coping Ok.
Good to hear, Annie. It could be that it's a fresh installation without all the extra baggage that comes with it when upgrading. I found that on my own installation that even though the old one crashed badly, the new one has been a dream to use, albeit, for the reported bugs we're all aware of and hope N3V will fix them soon(tm).
 
So far it's all good John. I installed TRS22 PE to help out with some route testing on a large WIP project and a build 5.4 install was necessary. By the time I'm finished I should have a fairly good idea just how good TRS22 PE actually is.
 
So far it's all good John. I installed TRS22 PE to help out with some route testing on a large WIP project and a build 5.4 install was necessary. By the time I'm finished I should have a fairly good idea just how good TRS22 PE actually is.
Overall, it's pretty stable. I have found that doing a large bulk update of textures does hang the program. This was reported and I was told it was my route, and now there are reports of others having the same issue. Since that's an issue, I do this carefully and save often so not to lose anything. Driving as you know is hit or miss and I think this is related to the new TLR initiative they're on. Hopefully, that will be resolved soon(tm) because that's really frustrating. If you can live with the caution and not fire your drivers, you'll be fine.
 
Driving as you know is hit or miss and I think this is related to the new TLR initiative they're on. Hopefully, that will be resolved soon(tm) because that's really frustrating. If you can live with the caution and not fire your drivers, you'll be fine.
I did manage to figure out the issue with the automatic fireman. It can't be saved anymore as a permanent setting in Surveyor and now has to be done each time in Driver when an engine is used. Somewhat of a nuisance, but at least it is still available to be used. So far I've been driving engines myself and I haven't tried setting up any AI runs yet so I haven't struck any problems. From what I can see here on the forums the TLR thing is a buggy mess that's barely fit for purpose and since it's spilled over and is affecting ordinary non-TLR AI sessions I can see why everyone is annoyed about it.
 
I did manage to figure out the issue with the automatic fireman. It can't be saved anymore as a permanent setting in Surveyor and now has to be done each time in Driver when an engine is used. Somewhat of a nuisance, but at least it is still available to be used. So far I've been driving engines myself and I haven't tried setting up any AI runs yet so I haven't struck any problems. From what I can see here on the forums the TLR thing is a buggy mess that's barely fit for purpose and since it's spilled over and is affecting ordinary non-TLR AI sessions I can see why everyone is annoyed about it.
Nice, another thing broken probably by the TLR code as that seems to affect the drive-ability outside of that realm. You are being kind. A buggy mess is an understatement.
 
I was wondering if you guys can tell me something about this...
Does it appear to use less, more, or about the same amount of memory (RAM) when running on Linux?
 
I was wondering if you guys can tell me something about this...
Does it appear to use less, more, or about the same amount of memory (RAM) when running on Linux?
I'm running Debian Linux on an almost ten year old HP Z200 Xeon computer with 16Gb of RAM and a 4 core Xeon processor that would eventually become the precursor for the i7 CPU. Scarcely cutting edge.

In TRS22 PE with a fairly large and detailed route loaded in my CPU is running at 23.8% and is using 3.3Gb of RAM. With a long coal train working its way along the route the CPU loading rises to 55%.

My overall impression with running TANE SP4, TRS19 SP5 and TRS22 PE is that they just plain seem to run better on Linux. I have a Win 11 i7 powered computer I could use for Trainz, but the fact that I'm not doing that should tell you something.
 
Last edited:
I've run TS12, T:ANE and TRS19 all on Windows and a variety of Linux distributions and there has been little to pick between either in respect of resources and performance other than perhaps Linux previously has lagged a little behind Windows in respect of fps, although recently with the newer graphic drivers I'm not so sure that is still the case. I have found that Trainz in general has been less likely to crash in Linux than Windows perhaps partly due to running in its own environment in Linux, i.e. Wine, and not having to put up with Windows doing its own thing in the background like downloading updates and so forth. Sorry I can't advise on TRS22 as I've only every run it in Linux and currently see no need or advantage to run it on Windows. Peter
 
Last edited:
Back
Top