I am wondering if deleting .ap files can be done to save space on my SSD, will it harm my install ? I have all .ap files unpacked, so the sim should then read the unpacked files, correct ? I understand that if I have to verify my files then Steam will download the .ap files all over again, but will it do this with a regular update of the game ? My thought was to copy all of my .ap files to a usb stick so that I could get them there if I needed them, as stated; to save space on my SSD
Why on earth would you unpack all your .ap files? Totally unnecessary. And no, you do not need to unpack an .ap for ANY modification, all you need to do is extract/duplicate the files you need from within the .ap archive (using 7zip, winzip or winrar) keeping the same folder/file structure. Not an easy task now you've done it this way but I genuinely recommend leaving the .ap's alone and getting rid of the extracted files and re-install all your modifications correctly if you want to save space, this way you also have the added benefit of being able to remove most* modifications without needing to verify game files or replace from backups, just delete what's outside of the .ap archive and the modification is gone. *The kuju folders being the exception to the rule because they aren't .ap archives and there are a few modifications that add/alter files in those folders. Same can be done with routes in your route folder too, it's a good way to keep track of and maintain third party scenarios and route upgrades.
Oh my. You're in for a lot of trouble. You'll lose track of mods in case you want to remove them, needing to make backups of bin files instead of just placing modded files outside of the .ap. Also your routes are protected against accidental manipulation (pressed Ctrl+E and clicked an asset in world editor? It will save the changes unless you Alt+F4 the game.). Having the route in its MainContent.ap, you'll only have to delete the fresh folders outside containing your changes. Just an example. You're aware that 100 files à 10kb take up more physical space than one 1000kb file due to filesystems having clusters as a minimum size per file? By default, most SSDs use a cluster size of 4kb, meaning even a file only 900 bytes of size will take up 4kb on your device. A 10kb file takes up three clusters which then would be 12kb. And TSC has hundreds of thousands of files, if you've got a decent library. And it increases loading times, as TSC uses a built in zlib "virtual" filesystem for quick access to contents inside .ap files. It may not be noticeable on SSDs, yes, but I've made a comparison on an HDD where an .ap is loaded 5 times quicker than the unpacked contents (an ap file is like a UNIX tarball, it's a bundle of files that are uncompressed, in zip format). Bigger files transfer faster than thousands of single files of the same size in total. That's true for the PCI bus as well as for TCP/IP. I've tested LAN transfer of an .ap file packed vs. unpacked. The packed (remember there's zero compression involved) file is transferred ten times faster than the single files. And, a Steam verfication will totally destroy your installation and redownload everything. Just don't do it. There is not a single reason for doing so. ap files save space, speed up loading and help keeping things organised. They were introduced in TS2014 for a good reason. And all modern games use big archives instead of millions of files. Unreal uses huge .pak files while having super fast loading times. More files = more workload for the filesystem journal. It's like instead of buying a sixpack, you buy each beer separately, bring it home, and buy the next one.
Yes and no, the reason I unpack is because older routes will have missing assets if they are in .ap format, so unpacking is needed
But then what about routes where I get missing assets if they are not extracted, e.g Marsdonshire and B&O Kingwood, these routes get milk bottles all over, and Kingwood won't even load the rolling stock properly if left in .ap, these aren't the only routes, just the ones I remembered from the top of my head ?
Marsdonshire is a COMPLETE Route from Just Trains The ONLY other item you need is the European Loco & Asset Pack. If you have milk bottles on the route go to your Just Trains account and download the latest version. B&O Kingwood as also a complete route downloaded thru Steam. If you have missing assets try turning up your Scenery Density to FULL
Heh..that's odd, the last time I had TS installed I unpacked the routes in question and then the scenery assets showed up..or so I thought, I must have fiddled with some other settings while I did it back then, because when moving the slider like you suggested there is no missing assets. I obviously did that back then to without realising it. THANK YOU, problem is then solved with both space and route scenery
I'm guily of removing the .ap files at times but if you are making any changes you can extract the files you want to change from the .ap and the software will priortize the extracted file contents over the .ap if there are differences.
Since he mentions .ap files I'd guess he has Marsdonshire via Steam, in which case his JustTrains account (if he has one) won't be of any help (I am pretty certain the downloads directly from JustTrains do not use .ap files, none of the add ons I have purchased directly from JT do)
As mentioned by other people If you remove the ap files than Steam will place them back in the folder and might delete anything else in that folder
But there's nothing stopping anyone archiving them into .ap's so that they then take advantage of the fastloading introduced last year (or was it longer ago now)
Careful with that Axe Eugene! While we're at it, I'd like to clear up some misconceptions about .ap files. 1. An .ap file does not simply get loaded into memory I saw someone on Rail-Sim.de stating he had unpacked all ap files because he was low on RAM and didn't want to have TSC load the complete files into memory. This is not how it works. Think of it as a virtual filesystem - like mounting an ISO to emulate a CD-ROM. The zlib.dll accesses requested files from the storage device - not from RAM, but it will transfer single files to RAM if requested by the game. One indicator for that is that Windows will put a lock on the file while TSC is running. You can delete or change loose files in the RailWorks folder at runtime, but not an .ap - as it is a "mounted" device. 2. Restrictions to the virtual zlib ap filesystem So, the contents of an .ap are not just simply placed into RAM as a whole. The zlib.dll handles the I/O. An .ap is a zip file packed with the compression "zero" flag. (On a note, an .rwp file is a compressed zip file, additionally containing a chunk with two fields, Author and License. While zip ignores these, Utilities.exe reads these values.) Have you wondered why Pegnitztalbahn for example comes with two asset folders? One containing an .ap, and another one containing the signals in loose files. The reason is, zlib has restrictions: - A script that references another script (via "Include") will only work if Windows does the file I/O. These references do not work inside .ap files. - It cannot handle non 7-bit ASCII filename characters. A Gebüsch.bin (we demand a... shrubbery! ) asset will show as missing in game. This is an often ignored golden rule of coding and content creation to never use special characters in filenames (that's what the localized <DisplayName> fields inside the blueprint are for. Even in 2023, character encoding is still an issue and source of trouble. Stick to ASCII! - Movie files must be streamed directly using OS API calls - .ogv files inside aps will not play. Note that currently TSC does not support playing video files anymore - it was a source of complications and possible OOMs. For example the Canadian Mountain Passes tutorials will skip the videos now - and those scenarios were shipped outside of the MainContent.ap file. 3. An exception to the advice not to unpack ap files ... is RailWorks\Assets\CastleRock\CastleRockAssets.ap This is not due to the archive being corrupt - it is packed in the wrong folder hierarchy level. So unpack these! I have reported this a few times, but the depot hasn't been updated yet. The correct hierarchy is RailWorks\Assets\Provider\Product\ProductAssets.ap. CastleRock assets have included the "Product" folder itself inside the .ap, which is "Scenery". 4. The Just Trains issues Just Trains DLC can be obtained from JT directly, or from Steam. The Steam version uses mostly .ap files. Mixing Steam with JT distributions can lead to duplicate assets being included in an .ap, and as loose file outside. Also, if you see two .ap files inside the same Product folder (check your Assets\JustTrains folder), the game will crash as it cannot decide which file to use if two .ap files contain the same files*. Therefore, they need to be unpacked. You will then have to decide which file to overwrite and which to keep. I can assist you on that - I've made all JT DLC running trouble free on my end - it was some work though. The issue is JT uses a lot of shared assets spread over various folders. Depending on installation order, you may end up with old files overwriting newer ones. DTG has better policy, as usually a route contains all its assets in a dedicated folder. 5. Funny things will happen... ...when you put ".ap" into a file or folder name. I've once renamed a TimeOfDay folder from the APSWEP to TimeOfDay.AP - don't do that. It will be treated as an archive and the game will crash. 6. Conclusion Basically, if it comes as an .ap, leave it like that, if it comes as loose files, leave it like that. Exceptions above, CastleRock and JustTrains. And a personal advice: If TSC is a hobby for you like it is for me, it is best to run the game from a dedicated SSD. I've almost reached one terabyte of data for TSC. Cheers and Merry Christmas! * This is only true for assets, the route folders can contain multiple .ap files with overlapping content. I use to pack my scenario patches into an .ap, by choosing a corresponding filename I can make sure it gets loaded on top of the original scenario files in the .ap. Nice thing about it it's very transparent, as I can name that .ap as I wish, for example "NSCoalCareerScenarioFixes.ap". Or I can make scenery changes to a route (replacing foliage for example), then pack the freshly generated "Scenery" folder into its own .ap and name it "MyFoliageUpdate.ap". To revert to default, all I need to do now is to rename that .ap to .bak or whatever. In an asset folder, two .ap files with overlapping content will crash the cache generator, leaving a zero byte blueprints.pak as an indicator that there's something wrong.
Just have time on my side atm. A lot ot trial and error led to this. Back on my Windows7 machine using a HDD, the loading times differences were huge, so I just started packing everything into .aps. Kuju\RailSimulator. Result - the german signals stopped working, all lit up. I took them out and tried to figure out why. Then I saw DTG distributing some of their RailNetwork\Signals folders loosely too. It was clear it had something to do with file access. That ruled out the idea of the .ap content just getting loaded into memory like normal files. Then, I had a lot of missing textures on the SBB Route 1 Pfaeffikon - Landquart. I clicked the assets in the route editor, checked their bins and GeoPcDx files for the used textures - and all missing stuff had one thing in common. Umlauts in their filenames, or commas. So I've put together a PowerShell script which checks asset folders for these, so I know they shouldn't be packed. ... see you at level Eleven mate
This thread turned out very educational..thank you all of you Since I had a fresh install of TS I just uninstalled it, deleted the unpacked files and reinstalled it. Everything is in .ap files that came in .ap files and everything works perfectly. I have a follow up question: it was mentioned that if I made a modification I would leave this modification outside the .ap so it could easily be deleted. Could anyone explain how this would be done, how it would look, preferably with examples..the monkey see monkey do quote applies to me
For my example I've opened WCML - South by DTG.. I've also opened the .ap with 7zip to show its contents and to also show that the modified files outside of the .ap are duplicates (in name not content) of some of the files found within the .ap archive. Quite simply everything that is inside the .ap (as shown in the 7zip window) is original as DTG supplied it, everything outside is a modification in this case some Armstrong Powerhouse content and a Class 323 modification that fixed the terrible DTG sounds and added a few other features. If I was having issues with say that Class 323 modification then I could simply remove the files that were added when I installed the modification i.e. the files that are outside the .ap archive and then the 323 would default once again to what was in the .ap archive (the best way to see what is added by a modification is to see what's in the downloaded zip, again 7zip's your friend).