PDA

View Full Version : Trainzutil



andi06
June 9th, 2015, 06:53 AM
If I call trainzutil when the gui isn't running I get a 'GUI not running' error.

Is it possible to add a 'Trainzutil start' command that will open the Launcher if it isn't already running rather than having to look for the error and then call TANE?

WindWalkr
June 9th, 2015, 08:55 AM
Yes; this is planned.

chris

WindWalkr
June 9th, 2015, 08:56 AM
I should note that it's also possible for you to implement this yourself in the meantime; if you get that error then you can launch TANE yourself.

chris

andi06
June 9th, 2015, 09:25 AM
Yes, but I'm conscious that every time I get this wrong I'm queueing up another launcher instance :-)

WindWalkr
June 9th, 2015, 07:26 PM
Yeah, it's not an easy thing to get exactly right. There's no simple way to determine whether a given process is starting up, shutting down, hung, etc. You can approximate it for the most part, however. May be worth walking the process table to check for a duplicate executable.

chris

andi06
June 11th, 2015, 03:14 AM
Are you also planning a facility to backup the enabled/disabled status of assets? - or can this already be done in some way.

WindWalkr
June 12th, 2015, 08:11 PM
No; we don't have any current plans in that direction. Our general policy for backups is that a user should either use a full-disk backup (preferred in general anyway) or back up the entirety of the userdata folder (if they don't care about anything on their system except Trainz.)

chris

andi06
June 13th, 2015, 05:04 AM
Our general policy for backups is that a user should either use a full-disk backup (preferred in general anyway) or back up the entirety of the userdata folder.
Ah the Microsoft school of paternalism!

The problems are that when things like this and keywords fall over the backup is likely to be less than complete unless it is taken after every CM session, and in any case don't you think that its overkill to restore several gigabytes (which will be out of date by at least a few hours) simply to get back a boolean setting on a few hundred assets?

In practice we can already do this:

Save Disabled State
1. Open a CM session with the filter 'Installed AND Enabled=false', Control-A and Copy Details.
2. Paste the copied data into a text editor.
3. Because CM can't read its own clipboard format you need to convert the pasted text to a comma separated list of kuids only, most decent editors have a macro function that will do this. Save the file as DisabledAssets.txt.

Restore Disabled State
1. Open the previously saved file in a text editor, Control-A and Copy.
2. Open a CM window and select Custom/Asset KUID
3. Paste the copied text string into the query box, this will restore the saved CM window contents.
4. Control-A, right-click and select Disable.

This is infinitely preferable to a Saved Filter for two reasons:
1. Saved Filters have the regrettable tendency to go missing at the same time as the disabled status.
2. You don't tell us where or how they are being saved - Microsoft and Paternalism again :-)

This is potentially powerful stuff. What you need to do is to make it easier by allowing CM windows to read their own clipboard format and by enabling:

CMListWidget.SaveToFile
CMListWidget.LoadFromFile

I say enabling because these are almost certainly native functions of the list widget you are using.

To take this only very slightly further you should add the ability to populate the Picklist from a disc file, in game as well as in CM. The Picklist is crucial because it can be used to define a set of assets in a way which is completely independent of the list hierarchy, that is it allows us to select an asset without having to remember whether its a traincar, spline, scenery or trackside item etc.

CM in TANE is, in my opinion, a huge improvement on TS12. Your problem is that few people think so because its presentation is so crude and some key features are missing.

WindWalkr
June 13th, 2015, 06:50 AM
..don't you think that its overkill to restore several gigabytes (which will be out of date by at least a few hours) simply to get back a boolean setting on a few hundred assets?

I don't think that it's a common case that you'll lose a few hundred booleans by themselves.



CM in TANE is, in my opinion, a huge improvement on TS12. Your problem is that few people think so because its presentation is so crude and some key features are missing.

I'm well aware of this. Unfortunately, it's difficult to spend massive resources for improvements on a feature that is only really utilised by a small percentage of our user-base. You'll find that it will be slowly improved over time, but we're not going to try to tackle everything at once. Hopefully each generation is a notable improvement on the previous.

chris

andi06
June 13th, 2015, 12:09 PM
I don't think that it's a common case that you'll lose a few hundred booleans by themselves.
Its happened to me three times in the past few days when TANE has dropped out straight to the Desktop (no visible errors and no crash dump)


it's difficult to spend massive resources for improvements on a feature that is only really utilised by a small percentage of our user-base.

You'll find that it will be slowly improved over time, but we're not going to try to tackle everything at once.
Fair enough to both of these statements however might I point out:


Externally accessible Picklist support is likely to be widely used by anyone who becomes aware of it.
With the improvements you have already made to trainzutil (especially variable support in batch files) and if the right hooks are provided then I will be able to provide many of these facilities from AssetX - if I can get it right you will never need to provide them at all!
List read/write support to a text file doesn't require massive resources, Copy Details is already half way to SaveToFile.

WindWalkr
June 13th, 2015, 10:09 PM
Its happened to me three times in the past few days when TANE has dropped out straight to the Desktop (no visible errors and no crash dump)

I think that we should look into this further then, because that would indicate that you've lost both the database and its backup, somehow. They should never be manipulated at the same time, so one of them should always be in a workable state and your data should be preserved. Actual disk corruption (ie. power drops out while data is still in flight) can of course cause anything, but a simple application crash should not.

If this type of crash happens again, please check for the presence of the <userdata>/assets.tdx and <userdata>/cache/assets.bku - even back up those two files in case they're corrupted somehow rather than missing outright. Hopefully we can catch what is going on.




Externally accessible Picklist support is likely to be widely used by anyone who becomes aware of it.

Agreed, and it is definitely on our shortlist.



With the improvements you have already made to trainzutil (especially variable support in batch files) and if the right hooks are provided then I will be able to provide many of these facilities from AssetX - if I can get it right you will never need to provide them at all!

Suits me. I definitely don't think it's the right kind of thing to implement in Trainz itself.



List read/write support to a text file doesn't require massive resources, Copy Details is already half way to SaveToFile.

Everything takes time. Not necessarily a massive amount of time, but when you add up the design, initial implementation, internal testing, external testing, rework based on feedback- yeah, it's not negligible regardless of how "small" the feature is. For a feature which is useful to a small number of people, which implements a workflow which can already be emulated by hand easily enough (ie. copy/paste) and which at least partially duplicates picklist functionality, it's definitely not something that I'm personally in a rush for (as opposed to, eg. fixing some of the other issues reported in this forum.)

chris

andi06
June 14th, 2015, 02:55 AM
I think that we should look into this further then, because that would indicate that you've lost both the database and its backup, somehow. They should never be manipulated at the same time, so one of them should always be in a workable state and your data should be preserved. Actual disk corruption (ie. power drops out while data is still in flight) can of course cause anything, but a simple application crash should not.

If this type of crash happens again, please check for the presence of the <userdata>/assets.tdx and <userdata>/cache/assets.bku - even back up those two files in case they're corrupted somehow rather than missing outright. Hopefully we can catch what is going on.
I will look at these.

The evidence against TANE for my crashes is circumstantial at present (just because my PC is falling over when I'm running TANE doesn't mean that TANE is the cause) but posts on Centercode do suggest that I'm not alone. Occasionally I'm dropping out to a blue screen - are the Windows crash dumps any help to you?

WindWalkr
June 14th, 2015, 03:40 AM
Occasionally I'm dropping out to a blue screen - are the Windows crash dumps any help to you?

No; once you manage to take down the OS, you're looking at a kernel-level bug (probably the GPU driver, but possibly something else.) Nothing we can really do to help there, unless it's completely reproducible across multiple machines - and in that case we can (1) forward the report with repro to the appropriate people at the company in question, and/or (2) develop our own workaround by changing the requests we push to the hardware.

chris