Tips For Compulsive Beginners (by A Compulsive Beginner)

Discussion in 'General Discussion' started by anthonychisnall, Apr 26, 2024.

  1. anthonychisnall

    anthonychisnall New Member

    Joined:
    Mar 7, 2024
    Messages:
    4
    Likes Received:
    2
    This is my first post on the forum. I bought Train Simulator a couple of months ago, and I want to post a report of my experience in order to help other newbies, while all the confusion and knowledge of pinch-points is still fresh. I should say for the record that I really like to know how everything works, and like to have everything… just… so. I need all my scenario names to follow my own conventions, I want to be able to edit scenarios if I think, for example, the timings are too tight (or too easy!), I want to be able to replace loco and route thumbnails with better ones… basically I’m a control freak!

    I’ve encountered a number of issues – happily all of which I think are now resolved – and I’ve made a few ‘note-to-self’ guides to help me through setup and familiarisation that I think will be of benefit. I’ll just add before I start that my installation lives within Steam, on a PC, and some of my notes are specifically related to the Steam side of things. Whenever I refer to paths, please note that my game drive is labelled “X”, and my root Steam folder is located at X:\SteamLibrary. All file references are made within that context. I also assume you’re good at keeping safe backups of your data, know how to un-compress zip files, know how to edit an xml file, have Notepad++ installed, and have a good working understanding of PC management generally. I welcome correction by others with more experience than me if anything below is factually incorrect. I also haven’t owned the game for long enough to learn whether or not anything I’m going to discuss gets subverted by updates or versioning. I’m only interested in right now. I want the game under my control right now, and this is how I’ve managed it.

    So, without further ado, here goes:

    TS uses compression to store many of its files. If you want to perform some of the edits I’m going to talk about today, you’ll need to un-compress those files. They have the extension ‘.ap’, but this is literally just a zip file that’s been renamed. Whenever you find a .ap file, you can rename it to ‘.zip’, and extract it using ‘Extract Here’ (i.e. extract in place.) If you do so, feel free to delete the .ap file (standard backup disclaimers apply). Not only does this ensure that TS will never read from the ap file, it saves a bit of space (of course it goes without saying that uncompressed files take up more space than compressed ones).

    All of your routes are located at X:\SteamLibrary\steamapps\common\RailWorks\Content\Routes. Each route has its own unique identifier – so, for example, the Great Western Mainline route’s ID is 00000001-0000-0000-0000-000000000000. Inside each of these routes is a ‘Scenarios’ folder. These scenarios also have long-form IDs. So, I’m currently looking at a scenario with the ID 01d448c2-74bd-4ae0-9df6-43ebdc3c9539. I open that folder, and double-click a file called ‘ScenarioProperties.xml’. I can see that the scenario is entitled ‘Oxford in Autumn’. (Quick reminder: if you see a ‘.ap’ instead – anywhere – you can just un-compress it to see what’s really inside.)

    All of your other main content (trains, scenery, etc) is located at X:\SteamLibrary\steamapps\common\RailWorks\Assets. However, Assets are stored inside sub-folders with their producer’s name. So, Dovetail Games has a folder called ‘DTG’, but other very important folders include ‘RSC’ (RailSimulator.com) and RSDL (RailSimulator Development Ltd) (both old names for DTC, apparently), DTM (Digital Train Model), Kujo (a major third-party supplier), and so on. When it comes to editing scenarios this makes finding products VERY difficult. You have to know where to look… or at least have decent searching chops to succeed.

    There’s a 3rd Party tool called TS Tools, into which I’ve only just started to dip, but it appears to be very powerful and provides a huge range of editing options. The changes I’m going to discuss today will all be done by hand, but I just wanted to point out that this tool probably does most things better than doing them manually. It’s just that I really want to understand what’s happening, so prefer to do it myself. (BTW, if you ever run TS Tools, make sure to run it As Administrator. It doesn’t work properly for me if I don’t.)

    If you want to edit scenarios that come with core content, and have them change forever, (including renaming them) not only will you need to extract the .ap file first, but you’ll also need to set the entire ‘Scenarios’ folder to ‘Writable’. (If you rely JUST on the Rename feature of the Build screen you'll lose any changes if you ever rebuild your application cache. More on this later.) It’s actually only the ScenarioProperties.xml file that you really need to change for the most part, but I found it easier to just do the whole folder. So… right-click on the ‘Scenarios’ folder in your route of choice, un-tick the ‘Read Only’ check box, click OK and ensure that the change is applied to all files and subfolders. From this point onwards you can be confident that any changes you make will work… with one exception: if you want to edit a Career scenario in core content, these files are Save-Disabled. This is totally reasonable: these scores are recorded centrally, and we wouldn’t want cheaters making their version of the scenario easier (but… why… would… you… oh never mind). If you want to edit a core Career scenario, and discover you can’t, (I’ll talk about an example of scenario editing later), you need to clone the scenario first. (This is basic game functionality so I won’t say any more than the Clone feature is in the ‘Build’ menu.) Once you’ve cloned a scenario you can do whatever you want with it. You can also delete the original (core) scenario if you don’t want duplicates. (This is the last time I’ll make any reference to deleting stuff without backups… caveat emptor… blah blah… I’m presuming you know what you’re doing.)

    In X:\SteamLibrary\steamapps\common\RailWorks\Content you’ll find 3 .bin files and 3 .MD5 files. Together, these represent your whole current game state*, and together they're called The Cache. They are entirely generated from the underlying routes and assets, and can be freely rebuilt. I regularly delete all 6 of them and have TS rebuild its database from scratch with absolutely no ill-effect. You’ll find that all the routes and scenarios comes back every time. If you want to be able to do this, however, you’ll need to make sure all your ‘clean-ups’ are done on writable files (see above).

    *The one game state I’ve encountered outside these cache files is your progression – i.e. the stars and ticks that appear beside each scenario. They are located at C:\Program Files (x86)\Steam\userdata\<your_steam_id>\24010\remote\career.xml. You can edit this file. First, find the unique ID for the scenario. I’m currently looking at a scenario with the ID cbb1c647-b446-41a7-841b-68a24cd8000d called ‘A Cold Winters[sic] Evening’ from North Somerset Railway. If I open career.xml and search for that ID I find a ‘cScenarioCareer’ node marked ‘CompletedSuccessfully’. I can set that to ‘NotCompleted’ (or vice-versa). I can also change the ‘LastScore’ and 'BestScore' to 1000. Why would I want to? Well, once I’ve completed a scenario I don’t go back to it. There’s so much content that I use those ticks or stars to say ‘completed’. If I’ve completed it but really enjoyed it I’ll reduce the score to 0 and reset it to ‘NotCompleted’. I’m in complete control. BUT… it only works in Career Mode. Standard Mode doesn’t have scoring.

    So… let’s convert a Standard Scenario to Career and see how that goes…

    (I know TS Tools can do this, but I’m going to do it manually.) Open the ScenarioProperties.xml file in Notepad++ and search for ‘ScenarioClass’. Change eStandardScenarioClass to eCareerScenarioClass. (Other classes are FreeRoam and Tutorial. I’ve come across Relay and Timetabled too, but they appear to be deprecated.) This is the primary tag that determines where the scenario will appear in TS. Save the xml file, and relaunch TS. Technically, that’s done the job – the scenario is now a career scenario, but we need to fix the scoring. Go to the Build menu, find the Scenario, and click ‘Edit’…

    Now then. A warning. The Scenario Editor is very powerful, but… absolutely hideous. You have to know exactly what you’re doing, or you’ll accomplish nothing. I cannot imagine how I could have learned what little I currently know without watching YouTube videos. There is a manual that comes with the game (http://tscdevdocs.co.uk/reference-manual/scenario-editor.html) but it’s dense. Seriously, YouTube is your friend. Anyhow, first thing is to pin all your Scenario Editor toolboxes to the edge of the screen. The one you want at the moment is on the right hand side, and is only visible when you first enter the scenario editor. That's right - it disappears as soon as you do anything (get it back by double clicking the scenario marker… but it’s better off to just do the edit as soon as the scenario editor opens.) In this right hand toolbox, click the train icon at the top, then find an orange arrow called ‘Arrival Points’. Set that to 1000/<num scoring moments>.

    Q: What’s a scoring moment? A: It’s a Timetabled Marker.

    Q: What’s a Timetabled Marker?

    So… you need to know how many moments there are in this scenario when you score points. To get that information, abandon what you’re currently doing, and instead go to the toolbox at the top LEFT. Make sure ‘Scenario Tools’ is highlighted at the very top (train icon), then click ‘Timetable View’ (it has a clock symbol). This pops up an editor inside the editor (yup). In the left hand pane you can view all the consists for the current scenario. Open the dropdown box at the top of the pane and find the consist suffixed (P). This is the player train. Now look at the right hand pane, and hopefully you’ll see some clocks. (If you don’t, this scenario has no timed moments. This is actually where you can ADD timed moments, but let’s not get distracted, um, again.) Count the clocks. That’s the number you need for your equation above. So, if there are 5 timed stops, 1000/5=200. Now that you know what number needs to go into ‘ArrivalPoints’, you need to get back there. Good luck with that. If you can see a big Orange Square, try double-clicking that. If that’s the main Scenario Marker, that will do the job, otherwise you need to get out of the editor and come back in. But… there’s no way to actually escape the editor! You have to click ‘Play’ (the big orange arrow bottom right), wait for the scenario to start, then exit out of the scenario and head back into the editor. God help you if you inadvertently edit the route instead of the scenario – I have yet to find a way to escape this hell short of Task Manager-killing TS and restarting to whole thing from scratch. Anyway, now that you’ve allocated points equally to each of the scoring moments, when you run the scenario in career mode you’ll have the chance to score 1000 points and get that little dopamine rush.

    The thumbnails that appear for the routes in the Main Game tabs can be edited. The images for those thumbnails are stored in X:\SteamLibrary\steamapps\common\RailWorks\Content\Routes\<route_id>\RouteInformation. It’s a png file that must be 256x128 and called ‘image.png’. I had an issue with Faversham High Speed where it wasn’t displaying a thumbnail, but I downloaded an image, cropped it to size, put it in that folder, and all was well.

    Thumbnails for locos are harder to track down (some of the in-game thumbnails are rubbish, so I wanted to change them). For locos, you need to find the path. An easy way to do this is to pick on your loco of choice, find a scenario that uses that loco, head over to the Build Menu, find the scenario, make a note of its ID, then open its ScenarioProperties.xml file from the Routes\Scenarios folder. Search for ‘<PlayerDriver d:type="bool">1</PlayerDriver>’, then scroll up a bit to determine its path. I’m looking at an xml file now, and can see FilePath = ‘DTG\NorthSomerset\RailVehicles\Diesel\Class_117\Default\Engine’. As it happens that’s in a .ap file at the moment, so I’ll just un-compress it. Hang on… OK done that, (and deleted the original .ap file) now I head into the Engine folder, and find LocoInformation. Open that, and there’s the image.png. I can now overwrite that with whatever I want.

    If you download Workshop Scenarios, be very careful installing them. Follow these rules:

    1. Subscribe to the scenario using Steam (NOT in TS itself). ONLY SUBSCRIBE TO ONE SCENARIO AT A TIME.

    2. Open TS.

    3. Open Drive/Workshop/Subscribed, and wait a second or two. The new scenario should appear at the top of the Subscribed list. Verify that you can Drive the scenario (button at bottom right.) On a small number of occasions I’ve downloaded a scenario that says ‘you don’t need such-and-such to run this scenario’, and when I’ve looked in the subs list it’s marked as not drivable because TS thinks a component is missing. If you get this, more often than not the scenario WILL run, but you’ll have to do it from the Career or Standard pages. One way or another… and I can’t stress this enough… verify with your eyeballs that the scenario actually runs.

    4. Head over to the Build tab, find the scenario, and rename it if you want to. I hate square-bracket prefixes and such-like. Capitalisation must also be according to my own personal rules. I have lots of other little nice-to-haves – (Pt.1) is, for example, my 'Part' terminology of choice.

    5. Close TS.

    6. Open Explorer and go to X:\SteamLibrary\steamapps\workshop\content\24010. You’ll find a folder containing a zip file for the scenario you just downloaded. DELETE THE WHOLE FOLDER.

    7. Relaunch TS, and all will be well.

    Why do you have to do this? Well, apparently if you try to download more than one scenario at a time, TS and Steam fall over eachother and very often the ScenarioProperties file that gets written to your Scenarios folder gets corrupted. Basically TS opens the zip file that Steam has downloaded to your machine, tries to add some Workshop IDs to the xml file, gets it wrong, and corrupts the xml file. This results in garbled text in your scenario, and other unpredictable results. The kicker is that if you download files one a time the bug doesn’t manifest. BUT: sometimes, TS just crashes (randomly) for absolutely no reason at all (of course, there IS a reason, but there might as well not be if I can’t do anything about it). If it does, from this point onwards the Workshop integration appears to get broken, and even if you think you’re only downloading one scenario, TS thinks something else, and problems ensue. If you ensure that your Steam download folder is ALWAYS EMPTY there’s no possibility that the queue bug can ever manifest. Once the scenario is safely tucked away in the TS Scenarios folder, you don’t need your Steam copy any more, so it’s safe to delete.

    You can verify that none of your Scenarios are corrupt by using NameMyRoute.exe. This lovely little app lives in the root RailWorks folder of your installation (X:\SteamLibrary\steamapps\common\RailWorks). It scans your Routes folder and gives you a complete report of all your routes and scenarios. Great for ID matching, and has the added benefit of telling you if any of your scenarios contain corrupted properties (it reports invalid xml). This is also a great reason for uncompressing all your .ap files – NameMyRoute can then see the data.

    If you want to make a timed scenario easier/harder, edit the scenario, then get yourself to the point where you can see all the timetabled points (see above). More often than not it’s going to be a set of ‘Pick Up Passengers’ Instructions. Click on the icon next to one of them (it looks like 2 people) and you see a big % icon with a number (very often 75%). This is how you edit times (NOT by manually changing the arrival and departure times. To be honest, the documentation says you CAN edit departure times, but I’ve not got it to work). Anyway – change the performance. It works. The higher the number, the tighter the time constraint (and vice versa.) I mostly want a relaxed, stress-free experience, with just a hint of constraint to ensure there’s some modicum of challenge, so if a scenario is too tight, I’d rather reduce this performance value and score 1000 points than try not to look at the score at all. Don’t ask me to explain or justify this – I know it’s irrational. Doesn’t change the fact that it’s true. Why don’t I just run everything in Standard Mode? You might ask. I tried. It’s not the same. Why? You ask. I did just say I don’t know, so I don’t know what else to tell you. Sorry, back to the point: I’ve found that the best way to reset performances is to turn off ALL of the Timetabled flags, change all the Performance values, then re-enable all the Timetabled flags, one at a time, chronologically. It seems to help the timings be calculated correctly.

    Get Good at finding Master Keys in your locos. Some locos (the Class142 is a good example) are incredibly difficult to find without the aid of the manual – often buried to the left of the driver in a dark and dingy part of the cab. I understand that this is true to reality, but, damn, it’s embarrassing not to even be able to start the engine without resorting to the manual. In fact, get used to having the manual open by your side. I have a second monitor, so I have the manual open on the ‘controls’ page for the loco I’m driving, but a print-out is obviously handy too.

    Watch out for stealth DSD (Driver’s Safety Device). Some locos have it enabled by default and it’s quite the shock to get siren-ed at for no seeming reason. Have ctrl-d poised for those traumatic occasions.

    Don’t try to drive a steam train without reading a bit about how to drive steam trains. You don’t just gun it to 100% and sit back. There’s lots of great advice out there on how to balance all the various controls and valves, and it’s quite satisfying when you complete your first uphill climb without grinding to a halt, but it’s much harder than other types of loco to manage.

    Now that I have TS completely under my control, I will take regular backups of the entire RailWorks directory (only retaining the latest one, obviously - it's absolutely huge!), plus the userdata folder from my Steam installation. If I ever come to do a full re-install from Steam, (on a new PC, for example), I don't need to rely on Steam backups, or rebuilding everything from scratch, including all my pain-staking renaming and scenario tinkering: I can simply do a full, clean reinstall of the app and all its DLC using the Steam Client - that will take care of all the licencing and formal stuff, then delete everything it's just done and replace it with my backed-up copy! Steam's happy, I'm happy, everyone's a winner.

    If I think of anything else I’ll post addenda, but that’ll do for now.

    Cheers,

    Anthony
     
    • Helpful Helpful x 2
    • Like Like x 1
  2. Spikee1975

    Spikee1975 Guest

    You are posting some dangerous and false information here, spreading myths that have already brought many players into trouble at some point, left with a highly corrupt and unmanageable installation - afraid to reinstall because they have lost track of what to backup.

    1. An .ap file is a zip file with ZERO compression - a container. Its contents are loaded and transferred up to ten times faster than loose single files by zlib.dll. (and actually takes up less space on disk than single files due to any small file occupying at least one cluster hence the difference between file size and SizeOnDisk). I have seen people suggesting the bigger an .ap, the more memory it would need. That's also false, as it's not simply transferred to memory but mounted and accessed through zlib's fast virtual filesystem, transparent for the game.

    Big files are faster than the same data in single files. It is like going to the supermarket and instead of buying a sixpack you buy and pay each bottle separately, bring it home and return to the store for the next one.

    2. When unpacking an ap, you will lose context of what is a modification and what is an original file. You can easily revert to defaults if trouble happens by removing all loose stuff next to the .ap

    3. You should only extract a needed file that's supposed to be modded, and put the modded version outside of the ap, in the corresponding path that's inside the ap.

    Also, mods will rely on the default file structure. YOU DO NOT UNPACK AP FILES FOR THE GAME.

    The only exception for this rule is the need to merge multiple .ap files due to wrong JustTrains file distribution, as different DLC install different Asset packs that crash the cache generator because it cannot decide which of the same file in multiple ap's in the same folder it must cache.

    For route files, the "MainContent.ap" has the advantage of faster tile loading and protecting content from accidental editing in the editor. All changes will be saved in new folders next to the ap and can easily be reverted. (and allow easy mod distribution as only changes need to be distributed.)

    This is a process valid for many games. You don't unpack .pak files for Unreal, or pk3 / .iwd files for older idTech based games. You place mods outside them to be then loaded on top by the engine, and can easily create backup trees containing all mods only.

    Please do better research before posting.

    Regards anyway, and welcome.

    Pete.
     
    Last edited by a moderator: Apr 26, 2024
    • Helpful Helpful x 4
    • Like Like x 2
  3. anthonychisnall

    anthonychisnall New Member

    Joined:
    Mar 7, 2024
    Messages:
    4
    Likes Received:
    2
    Hi Pete, thanks for your reply. As I tried to explain, I have a very specific requirement - I want to be able to configure the application exactly as I want. I'm fully aware that that's at my own risk, and I said that multiple times in my post. If I leave files in their ap form, and do a full reinstall from scratch, I'll lose all my edits. Taking control of the write-state of those files is the only way I can accomplish my goal. As far as I can tell from your reply, nothing I've said is actually wrong (I didn't know the ap file had zero compression, but it IS a zip file). Everything I've done has been determined empirically by my own observations - both with the application crashing and corrupting files, and with my losing edits when I perform a reinstall. If it didn't crash or corrupt files I wouldn't have needed to do anything I did (and very much didn't want to have to do. I was gutted when I discovered how unstable it was.)
    Finally, I'm not changing the file structure of the game in any way - I'm only uncompressing files in order to make them writable. Are there are mods that fundamentally require the files to be in their ap form and which won't work on uncompressed files?
    regards,
    Anthony
     
    • Like Like x 1
  4. Spikee1975

    Spikee1975 Guest

    You can easily save your edits because they are stored outside of the route, and only extract assets you need to change. Make a simple Assets backup tree syncing only your changed files. This way, after a possible reinstallation you will only need to drag your backup Asset folder onto the RailWorks folder. Modding is supported - but original files are preserved. That's how it's done since DOOM's IWAD / PWADs, so probably John Carmack can be considered as the father of modding while preserving.

    And you are changing the file structure. Some repaint installers will access an ap to copy GeoPcDx files using a script and supplied 7z.exe. They will fail if content is not there as expected.

    If you are using a mod that places "RailVehicles\Diesel\xyz\cab\cabcamera.bin" next to its ap, it works, and if you don't like it, just delete it. No need to make backup.bins and get lost. Troubleshooting and tech support will not be able to help.

    Example: Left Game, Right my mod Asset tree. Clean and easy to maintain. Railvehicles contains mods I've made for the engines. They supersede the files in the .ap in memory but not on disk - that's how it must be. I can disable them by just renaming that folder.
    2024-04-26 13_47_25-.png

    Using 7zFileManager (or FreeCommander), you can simply enter the .ap contents like a normal folder, copy what you want to mod to the right window, mod it, and then place it back next to the .ap

    I have provided scenario fixes in .ap format. If a user has unpacked the MainContent.ap, the scenario pack will not load as it is then superseded by the unpacked files. Then folks complain "it does not work" though it does.

    You can do what you want with your game, but please don't promote these methods.
     
    Last edited by a moderator: Apr 26, 2024
    • Like Like x 1
  5. anthonychisnall

    anthonychisnall New Member

    Joined:
    Mar 7, 2024
    Messages:
    4
    Likes Received:
    2
    My primary use case is editing scenarios. Let's say I want to change the name, and difficulty, of a scenario bundled within a route and stored in an ap file. Can that be done in a persistent manner without un-compressing the ap file (i.e. if I ever have to rebuild my cache, the changes will survive)?
     
  6. Spikee1975

    Spikee1975 Guest

    Yes. Access the .ap, select the scenario, copy its folder to outside of the ap to Scenario\<GUID>, make changes and back up the "scenarios" folder in the prepared backup folder structure (Content\Routes\Route GUID\Scenarios\)

    1.png
    2.png

    Then you only have to back up your scenarios folder.

    I've gone even further, packing (unsynced and directly transferred from the workshop folder, then unsubscribed) WS scenarios into .ap's sorted by author (Not.Silent's here)
    2024-04-26 14_03_59-.png
     
    Last edited by a moderator: Apr 26, 2024
    • Like Like x 1
  7. anthonychisnall

    anthonychisnall New Member

    Joined:
    Mar 7, 2024
    Messages:
    4
    Likes Received:
    2
    Ah, so I'm extracting part of the ap file itself and reconstituting it when I'm done? Yes, that would certainly work.
    I think I'll stick to my approach, though - I can see everything I want to see and edit it at a moment's notice. All the scenario xml files are right there, and I can edit them in Notepad++ instantly. If at some point I buy a mod that doesn't work because of my tinkering, well, I was warned.
    I do appreciate you taking the time to answer all my questions though - and your example of an ap file being strictly superior to an un-compressed file was genuinely useful, but for my own needs the solution I've settled on is perfect so I'll just stick with it.
    I'm a little disappointed you branded my post 'dangerous and false', since everything I've done and said has been laden with warnings and caveats, and was written with helpful intent.
    I have a very specific set of requirements that I stressed right at the outset, and which my approach addresses completely, but at this point it's best I just move on. Maybe another beginner in a similar fog of confusion as me, seeing scenarios displaying gobbledegook descriptions and not knowing why, will gain some value from my post.
    regards,
    Anthony
     
  8. Spikee1975

    Spikee1975 Guest

    I've additionally assigned "Serz.exe" as default app for .bin and .xml files. Just double click to convert.

    About the workshop issues (damaged when subscribed when TS is running, and hasn't finished installing one item, the xml manipulation inserting the WS tags can cause this corruption. That's why we are using the same approach by directly copying the zip contents in the Steamapps\workshop\24010 folder to TS and unsubscribing, avoiding xml corruption and startup delays due to Steam WS syncing these contents, which is unnecessary as TS Workshop does not allow updating content)
     
    Last edited by a moderator: Apr 26, 2024
    • Like Like x 1
  9. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    If you edit a scenario from within the game it saves that edited file(s) outside of the .ap archive---no need to extract anything!
     
  10. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    There's also no need to convert .bin file to .xml for editing, RW Tools/RS Tools will happily allow you to edit .bin files directly
     
  11. Spikee1975

    Spikee1975 Guest

    I don't use TSTools for that, as Notepad++ is much better for editing, searching and replacing.
     
  12. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    That external copy will be used by the game instead of the archived original.
     
  13. Spikee1975

    Spikee1975 Guest

    Anything duplicate file outside an .ap will be loaded on top and used by the game. Basics of modding.
     
    • Like Like x 1
  14. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    You might, and if that's how you like to do it who am I to argue?... but ... if we're attempting to clarify/explain things we really should bring as many methods as possible to the table
     
  15. Spikee1975

    Spikee1975 Guest

    Fair enough. That's tips and tricks now - I am just strongly opposed to promoting to unpack all .aps for the reasons given, which triggered my initial response. Mostly because people that follow this method eventually pop up with "why does this not work" "why are embankments missing" and it's hard and sometimes next to impossible to help them and get through the messed up files. That's why TechSupport must tell them to verify their files, have Steam redownloading the .aps, so both have the same base to go for troubleshooting.
     
    Last edited by a moderator: Apr 26, 2024
    • Like Like x 2
  16. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    Likewise... doing so opens up huge potential for problems down the line. At least he hasn't advocated replacing the archived files with edited versions... ;)

    No they're not...the cache is the .pak files; .MD5 files are more a hash tag check of the validity/status of the corresponding .bin/.xml file

    Delete the .bin and/or .xml files and the game reads the archived file in the .ap

    As Pete has already posted...dangerous and false information has been posted... why get upset about replies when you wrote:

     
    • Like Like x 1
  17. Spikee1975

    Spikee1975 Guest

    The "Cache" are the "blueprints.pak" files in each Assets\<Provider>\<Product> folder, a machine readable optimized data format the game engine works with. When being generated - the loading bar halts. Delete this file after adding content to an asset pack. When the game crashes without any error message this is most of the time at the point of cache generation. A blueprints.pak of 0 bytes points to the issue - sometimes multiple ap files with overlapping content - not allowed in an asset folder - only in Route folders as they are not using a cache. (The JustTrains problem. Buy SWEX and Cornish Main Line from Steam and together they'll crash. Needs unpacking or merging GreatWesternAssets.ap and CMLGreatWesternAssets.ap ;) )

    "SDBCache.bin" is the scenario database used for the Drive Menu (compiled using each ScenarioProperties.xml found plus career stats from Steam\Userdata\ID\24010\remote\Career.xml, which is the file that's stored in the cloud if enabled)

    "RVDCache.bin" is the RailVehicleDatabase the QD Consist Editor needs to compile the data. Scans ALL bin files available in your Asset folders recursively, looking for EngineBlueprints and ConsistBlueprints (preloads) - and crashes when hitting a corrupt bin, that's when people are reporting issues that the Consist Editor crashes at x % - bad data is the cause. This file gets rebuilt each time consist editor is launched.

    "TMCache.dat" - unknown to me

    "ConsistTemplates.bin" stores your own consists either made in Custom Consist Editor or saved in scenario editor using the consist save icon.

    Clear game cache function will only remove the assets cache blueprint.pak files to be rebuilt then.

    It's good to delete the SDBCache.bin from time to time, as especially after crashes corruption can happen ("Why are routes missing???"), even though TS stores changes in the "WriteCache" folder to apply them on next correct shutdown.
     
    Last edited by a moderator: Apr 26, 2024
    • Like Like x 1
    • Helpful Helpful x 1
  18. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    But not if you value the green ticks for completing scenarios
     
  19. Spikee1975

    Spikee1975 Guest

    They will not be lost, as a cache holds no original data per definition. It is just a compilation of data stored elsewhere.

    The Completion status is stored in Steam\userdata\id\24010\remote\career.xml, which is read upon cache generation. It then reads the score and completion status, checks the ScenarioProperties.xml medal defs, and applies the medal you're entitled to based on the score and saves that back into SDBCache.bin.

    If you wonder why Scenario Database generation takes so long, that's why. 15 minutes for a complete rebuild on my 8,000 scenarios installation. No checkmarks are lost if Steam doesn't corrupt or reset the Career.xml due to reasons only Steam knows.

    If your scores are lost then that is due to Steam Cloud Saves being active and failing to update Career.xml for whatever reason (been there... no cloud for me since then). Save that file and make backups!
     
    Last edited by a moderator: Apr 26, 2024
  20. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    Explain this then...

    " <Completion d:type="cDeltaString">CompletedSuccessfully</Completion>"

    a random line from my SDBCache.bin

    Changing that will remove the ticks.
    Have we stumbled across something that's the result of a pair of files being read, but neither of them being essential to the game running?

    I've 7174 scenarios and restoring SDBCache takes moments, will do a test rebuilding that career.cml file
     
    Last edited: Apr 26, 2024
  21. Spikee1975

    Spikee1975 Guest

    As I said, it's read from Career.xml and stored into the cache - but the source storage is Career.xml

    Career.xml + all ScenarioProperties.xml (Name, Player Engine) = SDBCache.bin

    As SDBCache.bin is used by the game, of course a change you make there will be reflected in the game. But it's not permanent - only Career.xml is! There is no transfer back from the cache to the career file. It only works one way.

    Upon completing a scenario, TS writes to both files. The Drive Menu only reads the cache.

    Editing a cache is the wrong way - edit its source of data and let it rebuild itself. Otherwise of course your checkmarks will be gone :)

    (But I made this error too in my early days :) )
     
    Last edited by a moderator: Apr 26, 2024
  22. Spikee1975

    Spikee1975 Guest

  23. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    It's pretty permanent on my set up...the career.xml is only 59kb in size--I have no interest in career mode--so removing that only leads to a minute(if that) extra time on the next load of the game. More testing required methinks!!...I love a good project.....
     
  24. Spikee1975

    Spikee1975 Guest

    Career.xml also holds completion for Standard scenarios. All your progress for each scenario you have played at least once is there.

    Again - editing the cache will revert your changes when deleting it - because it is only a cache that is not supposed to hold original information. Only the game should write to that file.

    Career.xml -> permanent storage
    SDBCache.bin -> temporary storage in a format for the Flash-based Drive Menu

    Permanent = survives cache cleaning :), to get back to your post which should be explained now.
     
    Last edited by a moderator: Apr 26, 2024
  25. Doomotron

    Doomotron Well-Known Member

    Joined:
    Oct 24, 2018
    Messages:
    3,859
    Likes Received:
    4,430
    Apologies if you've already answered this and I missed it, but what are the various MD5 files for? And when deleting the SDB Cache and other files, should I or should I not get rid of the MD5 version too?
     
  26. Spikee1975

    Spikee1975 Guest

    MD5 files are checksums, the file's checksum is calculated and stored in the MD5. This can help the program to detect corruption. It will be autogenerated once you delete the cache. Leaving or deleting an MD5 there makes no difference.

    The scenario editor also produces these MD5 files. If you remove the MD5 for a compiled ScenarioScript.luac it will fail to work, probably for preventing crashes due to byte manipulation.

    https://en.wikipedia.org/wiki/MD5
     
    Last edited by a moderator: Apr 26, 2024
    • Helpful Helpful x 2
    • Like Like x 1
  27. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    Spike, thanks for setting me straight regarding the "green ticks" ... much appreciated.
     
    • Like Like x 1
  28. Spikee1975

    Spikee1975 Guest

    You're welcome!
     
  29. Gary Padley

    Gary Padley Active Member

    Joined:
    Dec 10, 2016
    Messages:
    881
    Likes Received:
    239
    Do you mean Kuju?

    Kuju was the original developer of the game, released as Rail Simulator by Electronic Arts. Everything since has been based on that, with the original stock stock and routes still available as the European and US asset packs. Additionally they do come bundled with a number of route packages, see https://steamdb.info/app/208300/subs/ and https://steamdb.info/app/208306/subs/
     

Share This Page