Trainz on Linux in 2022

Hi, @JCitron! Was that directed to me? I don`t think that that`s what`s causing my problems, but just in case I`m wrong, I deleted the performance settings file, answered the dialog to configure video by clicking the left-most preset, and have an Extended DataBase Rebuild running right now.

That said, I had already chosen low settings; I just do not recall if I had chosen the lowest possible. Doesn`t matter now, as they are minimal now. When the EDBR terminates, I`ll exit the program and try again, and share the results. I`m betting No Change, but I`m hoping that I`m wrong.

Odd. I distinctly remember posting a message where I stated that I like @wilts747`s wallpaper, followed by a comment that the problem I`m having is that I`m getting exactly the same results as @wilts747 is getting. I then followed that with some additional commentary detailing the specific problems I`m having with the command not doing what I`m needing. I also informed @KotangaGirl that I was not complaining, just explaining how I had gotten here. So why can`t I see that post? I don`t know, but I did have a crash just about then and may have lost it there. I thought I had successfully posted it first, though.
 
Hi, @JCitron! Was that directed to me? I don`t think that that`s what`s causing my problems, but just in case I`m wrong, I deleted the performance settings file, answered the dialog to configure video by clicking the left-most preset, and have an Extended DataBase Rebuild running right now.

That said, I had already chosen low settings; I just do not recall if I had chosen the lowest possible. Doesn`t matter now, as they are minimal now. When the EDBR terminates, I`ll exit the program and try again, and share the results. I`m betting No Change, but I`m hoping that I`m wrong.

Odd. I distinctly remember posting a message where I stated that I like @wilts747`s wallpaper, followed by a comment that the problem I`m having is that I`m getting exactly the same results as @wilts747 is getting. I then followed that with some additional commentary detailing the specific problems I`m having with the command not doing what I`m needing. I also informed @KotangaGirl that I was not complaining, just explaining how I had gotten here. So why can`t I see that post? I don`t know, but I did have a crash just about then and may have lost it there. I thought I had successfully posted it first, though.
Yes, I know all that and yes this was directed in your direction. The way I looked at it here, there are way too many variables and you needed to reduce them down to a single one. By eliminating the Trainz factor, when trying to run that, then you can move on to the others if they are still an issue. As a technician, I was shown to always bring things back to the base state prior to testing again, otherwise new issues may be introduced and you'll end up running in circles as it appears you are doing now.

The way I look at it, I would've stuffed everything and started from scratch ensuring that everything works at each step of the way prior to adding in something else, but then again, I'm a technician by trade and not a programmer and by training I was taught the scientific and engineering test methods.
 
I am very greatly pleased to announce that I was incorrect! I currently have Surveyor Classic open with my one and only current route and session open for edit.

Hip hip hooray!
Hip hip hooray!
Hip hip hooray!

You win that bet, or would if we had bet!

I still need to get that TrainzUtil command issue working, but the game bleeping well works now!

I was also taught the scientific method, but as a programmer, I perform incremental testing and repair. Every time I had introduced a new element, it was after the previous issue had been resolved to my satisfaction, and I presented the issues in the sequence of each one dependent on the one before it and a prerequisite of the one following it. This is also how I develop my software: I establish that the prerequisites are satisfied before going on to the next step, at least usually.

As things stand now, I have two outstanding issues. No audio, something you likely cannot help with, and executing TrainzUtil from inside a Linux program.

I am sorry, but I kept having people trying to fix something that I had already said was working satisfactorily, but may not have said clearly enough. I suspect that this was part of people thinking that I was introducing new complications prematurely. I assure you that they were never premature, in that the preceding issue had indeed been resolved to my satisfaction before the introduction of another. I apologize if I did not make it sufficiently clear that each stage had been resolved, but I certainly did try to make it clear. You may have noticed a rising frustration level in my various comments that I was sure that the issue being diagnosed had already been resolved. I admit that I was indeed feeling a rising frustration level, and tried to conceal the frustration, as I have noticed that exhibiting that frustration tends to drive would-be helpers away. I tried, but it wasn`t easy, due to the way that my brain is "miswired" by neurotypical standards.

Just to make things perfectly clear, I say it again: it works! Thank you! Even if it didn`t seem like it at the time, the help is MUCH appreciated!

I could still use some help with the TrainzUtil thing, though.

Edit: I tried to load and run the free-drive session of a route, and it took what felt like a long time to load enough to see the route. When enough had loaded that I thought I could start trying to drive, I control-right-clicked on a locomotive, and Trainz went Poof! It works, but it apparently still has a few issues to work out. I`ll try to work with simple things for a while, and see if I can identify what triggers issues like this. It still works a bleeping lot better than ever before on this machine!
 
Last edited:
@MasterTracklayer
Good to hear that things are working. The initial run of any route will take time to load due to precaching content. If you can get Trainzutil to work, you can precache the content prior to running any route and speed up your operations. Just a thought, is your Trainzutil issue permissions related? Just asking.

I saw the hardware issue with the sound card. You can install your PCIe type 1 card, meaning your sound card, into any PCIe slot if you have more than one, but from the description, it sounds like you may not due to the motherboard being one of those earlier transitional ones that had a bit of both old new. If you do have any additional PCIe slots, it'll fit in the first part of the slot while leaving the rest of the slot empty.
 
Just a thought, is your Trainzutil issue permissions related? Just asking.
I doubt it, but I cannot guarantee not, other than to say that all of the files appear to have all the appropriate permissions bits set correctly. I have checked this, and can report that even as root, several tests failed. Admittedly, this was before I learned about wineconsole, but still....

As for the slots, the one slot contains, as best as I can recall without the services of a screwdriver (and being admittedly to lazy to get up and check the audio card that is in a box in a different room), two card-edge connectors, one about an inch or so and the other about four inches or so. Both cards require that type of slot. The other three slots have only one card-edge connector each, at approximately one inch long, and one of those is blocked by the bulk of the video card (part of the heat-sink hardware, as I recall, perhaps a fan). Which is what by name is beyond me. I`m a software guy, not a hardware guy. I`m lucky I was able to force myself to become marginally comfortable handling the innards when needed, and it was certainly needed.

Yes, I understand that these multi-standard slots can host cards that do not use the additional edge connectors; it just doesn`t work the other way around, which is what I currently need. Early transitional model? Well, @KotangaGirl did say that the motherboard video was about ten generations behind, in additional to not having had a good rep for games even when it was new. That appears to fit well with the slot configuration being "an early transitional model".

By the way, after Trainz went Poof on me, I ran a DBR first thing after restarting the program, and I`m currently engaged in what looks to be an all-night download of four (4) assets (the four largest on my list, currently). I`m currently feeling like the victim of a tilt-a-whirl, so I don`t feel like working on much of anything at the moment. I`ve been engaged in playing Microsoft Solitaire Collection while waiting between bursts of activity on the forums. I`m up to level 72 on four of the five, and less than one game from level 72 on the other game. Keeps my mind occupied when I`m not feeling up to having it operate in high gear.
 
I doubt it, but I cannot guarantee not, other than to say that all of the files appear to have all the appropriate permissions bits set correctly. I have checked this, and can report that even as root, several tests failed. Admittedly, this was before I learned about wineconsole, but still....

As for the slots, the one slot contains, as best as I can recall without the services of a screwdriver (and being admittedly to lazy to get up and check the audio card that is in a box in a different room), two card-edge connectors, one about an inch or so and the other about four inches or so. Both cards require that type of slot. The other three slots have only one card-edge connector each, at approximately one inch long, and one of those is blocked by the bulk of the video card (part of the heat-sink hardware, as I recall, perhaps a fan). Which is what by name is beyond me. I`m a software guy, not a hardware guy. I`m lucky I was able to force myself to become marginally comfortable handling the innards when needed, and it was certainly needed.

Yes, I understand that these multi-standard slots can host cards that do not use the additional edge connectors; it just doesn`t work the other way around, which is what I currently need. Early transitional model? Well, @KotangaGirl did say that the motherboard video was about ten generations behind, in additional to not having had a good rep for games even when it was new. That appears to fit well with the slot configuration being "an early transitional model".

By the way, after Trainz went Poof on me, I ran a DBR first thing after restarting the program, and I`m currently engaged in what looks to be an all-night download of four (4) assets (the four largest on my list, currently). I`m currently feeling like the victim of a tilt-a-whirl, so I don`t feel like working on much of anything at the moment. I`ve been engaged in playing Microsoft Solitaire Collection while waiting between bursts of activity on the forums. I`m up to level 72 on four of the five, and less than one game from level 72 on the other game. Keeps my mind occupied when I`m not feeling up to having it operate in high gear.
I lost my PCIe-4 slot to my video card as well on my system. The short slot is still difficult to get to, though due to the video card still being in the way even though there's enough room to plug in another card, it's really, really tight and difficult to get my fat fingers in there.

I've had that tilt-a-whirl thing going on myself. It has left me for a loop so to speak and I've got some tinnitus with it. I've got you beat with MS Solitaire, hehe Free Cell is at 2120 games, 99% wins. This what happens when I talk on the phone...

Anyway, after the DBR check for faulty assets. View errors and warnings, and they should disappear. If you load up a route again, revert any changes because saving can cause the route to become corrupted.
 
I have tinnitus what sometimes feels like 25/8, but my nausea has been stronger than my vertigo. I`ve only been playing MSC for about four months, +/-, and the only level the program lets me play at is usually trivial to beat.

Fair enough, @KotangaGirl, fair enough. I take it that your issues are different from mine. Asperger`s.

My video card blocks the adjacent slot 100%; the best I could do there is one of those dummy "cards" that bring wires from elsewhere to the external openings. I have had cards with that kind of extra, but not in this system.

The only route that I ever load for anything other than running it in Driver is my own route, which currently consists of one baseboard, one navigational beacon, and about eighteen or so perfectly straight, perfectly parallel pieces of fixed track, the longest I could find, which extend off the west edge of the single baseboard, probably far enough to terminate on the non-existent baseboard two positions farther west.

The idea was to connect the east end of the tracks with a series of junctions that narrow down to a four-track eastbound main line, with a reversing loop around the west end. I can no longer find the four-track concrete-tie Auran tracks that I had used to build the original, so I had to use what I could find.

The eastern approach in the original connected to another four-track main line with a wye, with the four-track approach track effectively forming a spur instead of the main line it was built to resemble. In that original, I had carefully placed a number of triggers that had been "wired" to throw any junction that was approached from the frog end by a train on the track that was currently blocked by the junction.

I had even built a "double-slip" configuration rigged to allow a train entering on any of the four tracks to exit the slip on any of the four tracks on the other end. Not only was this also protected by auto-throw triggers, it was also rigged such that manually throwing any junction would automatically throw the other junctions to provide a clear path through. The double-slip configuration itself was rigged, as best as I can recall, to always be in either an X configuration or a = configuration. Unfortunately, I had yet to figure how to keep two trains from crossing over at the same time, driving through one-another unrealistically. Each end of the central slip abutted two cross-overs (for a total of four), allowing the outer two tracks access to the inner two and vice-versa, with the slip between the two inner tracks (and of course also between the cross-overs, which were also rigged to always provide a clear path through and to automatically unblock any train approaching from the "wrong" direction). I had lots of miscellaneous rail-cars set on the inner field of parallel tracks, awaiting a switcher to stitch together an out-bound train.

Yes, I`m describing a single-ended flat classification yard. I had added some engine-maintenance sheds and other buildings, including a centrally-located tower, mostly for "color", but I had managed to rig up the sheds as drivable destinations (for the drive-to command), too.

At one end of the route, I was building my own portal. It was able to materialize individual vehicles no problem, and I had gotten it to wait for the train to clear the trigger before materializing and coupling the next vehicle. I had it almost working right, just before I gave up Trainz that time. With only minor changes, my code would have been able to turn any Trackside object into a portal (including rolling stock!).

I also had a partially-animated farm and the Auran animated shipping port industry, some logging operations, and a pier with passenger station for ships to call at, and some other stuff, but very little scenery.

On what I think was a separate route, I had tried to build a semi-functioning city with drivable road vehicles and houses and such. I even tried to experiment with a drivable pedestrian for the sidewalks. Unfortunately, these things all floated at different elevations above the tracks, which looked silly.

I am trying to re-create a passing semblance of this on my new Trainz22PE (123801), but the laptop was very slow with a tiny screen, and the Linux system wasn`t working yet. I was also working on a massive scripting project that I am also attempting to create a semblance of, but the tiny screen made editing the script code an exercise in frustration after using my large-screen monitor for so long.

Now that I`ve got Trainz running on Linux, I intend to resume building those semblances of Trainz Past. The attempt to run TrainzUtil from a Linux program`s execute-shell-command is intended to integrate JEdit as a Trainz scripting editor, and possibly as a partial replacement for Content Manager. As such, I certainly need to be able to execute a single TrainzUtil command at a time and capture the output into the editor, or it just doesn`t work at all conveniently. Scripting the editor to process the output afterwards should be easy (for me, anyway), and fun, compared to getting that one last prerequisite to work.

Thinking ahead, I find myself wondering if there is any way to use TrainzUtil to launch any given session in Driver. Launching one in Surveyor would also be useful.
 
Fair enough, @KotangaGirl, fair enough. I take it that your issues are different from mine. Asperger`s.
A rare neurodivergent condition from childhood that I won't go into on an open forum and cognitive damage due to type 1 narcolepsy. LongCOVID gifted me tinnitus, but fortunately it's fairly mild and not too annoying.
 
Meh, I had to reboot to get a flaky mouse to work.

Anyway, during the last few hours since my previous post, I have achieved the partial success of running a Windows command from the Bash Shell command line. Hooray! I did this by searching the WineHQ forums for "run console command" and selecting what turned out to be a suitable thread. I can post technical details for anyone who wants them, but I won`t bore you with them if nobody asks for them.

There are still some unresolved issues, however. In particular:
* I still get my output in a Wine console window. I haven`t figured out yet how to get the output in the Bash console window. (The documented method appears to not work.)
* I have yet to figure out how to get the one console command to run in the correct Wine environment. (I think I`ve been using the relevant environment variable(s) incorrectly.)

There are undoubtedly other issues, but these are all I can think of at the moment.

I have also had a couple of notions bouncing around my head for a few days regarding the need to manually refresh the Content Manager windows, but I don`t feel like investigating that at the moment. I have a programmable hotkey program that allows using Python code to manipulate other programs` windows. I might be able to do something with that. @KotangaGirl, could you please ask your daughter to amplify on her earlier comments regarding the difficulties of rewriting the graphics code that you mentioned earlier? Something that you relayed has struck a chord with something else that I`ve read recently, and it has gotten me to wondering about the possible connection(s).

Thank you. I didn`t ask for details, and I won`t press for them; I merely presumed that it was not what I have. You have confirmed that for me; if that`s all you`re comfortable disclosing publicly, it is more than sufficient for me.
 
@KotangaGirl, could you please ask your daughter to amplify on her earlier comments regarding the difficulties of rewriting the graphics code that you mentioned earlier? Something that you relayed has struck a chord with something else that I`ve read recently, and it has gotten me to wondering about the possible connection(s).
My daughter is going to be away so I won't be able to ask her until she gets back. From memory the issue was around N3V's use of OpenGL to run Content Manager as well as their Trainz Store menus.
 
Yes. Fine. No hurry. I read somewhere recently about how Wine for Linux translates the graphics requests from the client code into OpenGL. I would think that translating OpenGL to OpenGL would work much better than whatever is happening behind the Content Manager. I don`t recall just where I read this, but the bulk of that two hours I mentioned above was spent reading about Wine on Wikipedia. Even if that is not where I got this, the article was still an interesting read.
 
Thank you, @wilts747. To the best of my ability to determine, however, the issue with where the output goes lies in the wineconsole executable and not in any Bash misusage. I would expect identical results regardless of how I executed the wineconsole command. Likewise, the issue with the command executing in the wrong Wine environment appears to be that I do not know what to set the environment variable to, not in failing to set it.

The first issue can be overcome by using redirection to direct the output into a file or pipe, if need be. I`m sure that I can handle that, but I was hoping that I could just tell the wineconsole command to use the host shell window, as the man page tells me is possible, as that would make capturing the output trivial. According to the man page, --backend=curses should set this mode, but I have yet to see it work.

The second issue apparently can only be fixed by telling wineconsole which wine settings to use, which is done by setting an environment variable to the path of the directory containing them. The trouble is that I have yet to hit on the correct directory to name there. The list of candidates is very short, however, so I`m bound to hit on it sooner or later. Can you tell me how to determine what directory Lutris tells Wine to store its settings in? That is apparently the directory that I need to place in the environment variable. I have just had an idea that might be able to cause Lutris to tell me directly, but I have yet to try it, and it may not work.
 
Sorry but I can't answer that one, generally if it does what is needed I leave well enough alone. That said Wine variables are usually stored in the Wine prefix which can be anywhere after the Wine top directory. However as you specify the version of Wine you wish to use in Lutris I would have thought it would then need to be in that version of Wine's prefix i.e. the sub-directories of:

home/.local/share/Lutris/Runners/Wine/Wine-ge-8.26-84_64/

However if you check the attributes of these sub-directories then run Trainz none actually change with the exception of:

home/.local/share/Lutris/pga.db

Which I have yet to have a closer look at, or the Lutris Trainz configuration files.

Peter
 
I have managed to solve the first of those two remaining issues, by running wine instead of wineconsole.

As for the second, I agree that it has to be somewhere in the vicinity of the directory that contains the entire Trainz installation. I suspect the correct directory is the one specified to Lutris when the target game is installed, but I`ve been to busy with other stuff lately to do much testing. This is the single remaining issue, although I obviously cannot guarantee that no others will appear after I solve this one.

A great big Thank you to everyone who has helped me thus far. Much appreciated.

Edit: I think that I found that last answer, but now I get a different error:

0228:err:esync:esync_init Server is running with WINEESYNC but this process is not, please enable WINEESYNC or restart wineserver.

The command I used is

env WINEPREFIX=/home/{RedactedUserName}/Games/trainz22pe/ /home/{RedactedUserName}/.local/share/lutris/runners/wine/wine-ge-8-26-x86_64/bin/wine Games/trainz22pe/drive_c/Program\ Files/N3V\ Games/Trainz\ Railroad\ Simulator\ 2022Trainz22PE/TrainzUtil.exe help
 
Last edited:
My supplier has provided me with an alternate tower, a Dell Inspiron that has a different NVIDIA card in it and motherboard audio that supposedly works. As I discovered after most of the below, the list of available proprietary drivers available for this card is considerably longer than for the card in the linovo.

I performed some surgery and transplanted my SSD card, the internally-mounted one with my Trainzbase on it, into the replacement tower, and tried running Trainz. Still no audio, so I`m beginning to wonder if my speakers have gone bad instead of the lenovo motherboard audio, except that my diagnostics claim that the lenovo doesn`t even have audio circutry, which puzzles me. As far as I know, the Inspiron has not reported same. The program runs on the Inspiron, but seems even slower than on the laptop, and has crashed to desktop several times. I did a Rebuild Database after each crash, except the last, after which I ran and Extended Database Rebuild. When that finishes, I plan on running a TrainsUtil precache command from the Developer menu, followed by another attempt to run the game. If this doesn`t work reasonably well, I`ll be forced to seriously consider going back to the lenovo tower.

Meanwhile, I take it that nobody has any insight about how to deal with the WINEESYNC issue, meaning that I`ll have to research it myself. So be it. I can do that.
 
Go here to ensure you have all the drivers:

Put in the Service Tag Number or serial number for the computer to get the proper drivers for your Inspiron computer, or search by model.

You need to reinstall or install drivers for the audio that's on the motherboard. On the Dell systems, they use Realtek audio on the motherboards.
 
Linux is usually pretty good about not needing proprietary drivers, yet there are provisions for using them when needed. When I looked at the list in the program that manages them, there was nothing to indicate which driver I should use, or at least nothing that I noticed. No card model names or numbers, just driver version numbers. Linux had no difficulty providing audio through these same speakers on the Realtek motherboard audio system in my boot(shoe)-box computer without custom drivers. I wouldn`t know where to go for them anyway, other than where I go for video drivers. The program is supposed to manage proprietary drivers, but nothing I`ve seen specifies that they have to be video drivers. I don`t think that I would know how to install proprietary drivers of any stripe without it, and it does not mention any audio drivers being available. What it does mention are six "NVIDIA driver metapackage"s, my card, and the software driver, as follows:

* NVIDIA Corporation: GK107 (GeForce GTX 650)
* NVIDIA driver metapackage from nvidia-driver-470 (proprietary, tested)
* NVIDIA Server Driver metapackage from nvidia-driver-470-server (proprietary)
* NVIDIA driver metapackage from nvidia-driver-390 (proprietary)
* NVIDIA Server Driver metapackage from nvidia-driver-450-server (proprietary)
* NVIDIA binary driver - version 340.108 from nvidia-340 (proprietary)
* NVIDIA Server Driver metapackage from nvidia-driver-418-server (proprietary)
* X.Org X Server - Nouveau display driver from xserver-xorg-video-nouveau (open source)

The NVIDIA card in the lenovo tower has only two proprietary drivers on offer (I forget what version numbers they had, but the lower numbered one was labeled "tested" and the higher numbered one was not), and the X.Org driver seemed to work better than the two from NVIDIA.

In particular, with the (tested?) NVIDIA driver installed, I was unable to boot to desktop on the lenovo. I had to take my portable Linux to the Dell laptop to get it to where I could uninstall enough NVIDIA stuff to allow the lenovo to boot to desktop.

Edit: Status update: The precache command is running, and seems to be about 1/4 finished.

Edit 2: Status update: The steam loco on the first page of the game window has some green-and-white texture issues. I`ve let it sit, and they have not cleared up. I do not recall seeing these issues on this page before, not even on the several times I`ve started the window on the Inspiron tower. Trying the same tutorial route that crashed on me earlier today.

Edit 3: Status update: Trainz crashed again, when I wasn`t looking, so I don`t know what killed it this time. Meanwhile, I have successfully run TrainzUtil.exe from my Bash shell, as follows:
Code:
env WINEESYNC=1 WINEPREFIX=~/Games/trainz22pe/ ~/.local/share/lutris/runners/wine/wine-ge-8-26-x86_64/bin/wine ~/Games/trainz22pe/drive_c/Program\ Files/N3V\ Games/Trainz\ Railroad\ Simulator\ 2022Trainz22PE/TrainzUtil.exe help
I tried this twice, once from my home directory, and once from where TrainzUtil.exe is. It only worked when the current directory was set to the Trainz install directory. I do not know what is relevant, but I got the TrainsUtil.exe help message to display in my console window. I can now begin configuring JEdit to use TrainzUtil.exe, but I`m still having issues with having the game itself run.
 
Last edited:
Back
Top