Caught you, you sneaky buggers!
Oct. 19th, 2022 04:00 pmI've been tweaking Train Sim to my preferences ever since I got it, mostly the way it lays out your choice of trains to run, which is set up as a hierarchical choice of class of train (for instance a Class 158 Express Sprinter, or a German DB BR101), and then the specific train 'consist' (eg two linked 4 coach Class 158s run by London Midland). Which makes it slightly annoying if they then publish DLC which variously titles the same train class in different ways, for example the Class 158 as a Class 158 Sprinter, Class 158 Express Sprinter, and Class 158 EMU, splitting it into multiple folders. A handful of DLC even had a separate folder per individual consist. So as the files that arrange this are editable (they're a compiled HTML, but you get the compiler/decompiler) I've been changing them to consistent names/my preferences. Only sometimes it doesn't work. And it wasn't obvious why.
My working hypothesis was there was some sort of hidden database of DLC train names as it didn't happen with fan developed freebies, but then one of those turned up with the same issue and in poking it to find out why I stumbled onto the answer. There is (sometimes) another file associated with the trains called <class name>metadata. I though that was just linking the train to its various sub-folders, but it turns out to be more general project header, and it has a tag in there that completely overwrites the class tag in the individual train file. And to make it even more confusing not only is it sometimes there and sometimes not, but sometimes, for DLC that contains both a route and trains, there isn't separate metadata for some of the trains, but there may be metadata for some of them buried in the metadata for the route. If they'd deliberately set it up to be confusing and annoying they couldn't have done a better job.
I took a pass through the Metadata files yesterday, it works, and I've eliminated something like 40 duplicate folders (and I'm not finished yet). Even better, it seems to make it load faster!
I did once find a similar setup in code at work, the main thread of code being overridden by a completely undocumented hidden one. Worryingly that one was deciding whether or not to drop a bomb (though at least it would fail by not dropping the bomb rather than vice versa).
But it works. Well, most of the time it works. I'm really hoping the places it doesn't work are ones where I've screwed up the fix, because if they aren't then there's a second even further hidden level of naming. *facepalm*