How To Find The Number Of Scenarios I Have Installed

Discussion in 'General Discussion' started by Spamcan, Mar 16, 2024.

  1. Spamcan

    Spamcan New Member

    Joined:
    Feb 12, 2022
    Messages:
    5
    Likes Received:
    1
    Hello, Is there a way i can check the number of scenarios i have installed in tsc
     
  2. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    In your Railworks folder is NameMyRoute.exe run that program and it will create a list of all routes on your computer and a list of the number of scenarios in each route.

    The output is in a text file that can be copied and put in to Excel
    Screenshot (352).png
    This is what I got and 00000007-000-000-000-000000000000 - Hedborough North has 14 scenarios

    You would have to look at each route separately

    Peter
     
  3. Spikee1975

    Spikee1975 Guest

    Another way would be to unserz SDBCache.bin, then check how many lines the <Scenario> xml node contains and divide this number by 82 (lines per scenario).

    I just checked and I've got 8,144 scenarios in 328 routes. (20 MB SDBCache.bin)
     
    Last edited by a moderator: Mar 17, 2024
  4. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    I looked at that but I had no idea where something called <Scenario>xml was
     
  5. Spikee1975

    Spikee1975 Guest

    The file lists the routes first, the next node is the scenarios, and then QD start / destins.

    example sdbcache node structure
    2024-03-17 15_10_45-Window.png
     
    Last edited by a moderator: Mar 17, 2024
  6. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,806
    Likes Received:
    1,817
    Hmm, I've never thought of unserz'ing the SDBCache, guess where I'm going right now... brb.
     
  7. Spikee1975

    Spikee1975 Guest

    And as TSC is using this for the Drive menu (else it would need to access the storage device for each route selected, and couldn't offer sorting), when you have missing routes in QD it's due to corruption in the <StartDestMapping> node (likely due to a crash) which can be recovered by just deleting the cache file, TSC will then rescan all route folders and gather completion and score data from your Steam career.xml to rebuild the cache.
     
    Last edited by a moderator: Mar 17, 2024
  8. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    As usual I'm doing something wrong as it only finds ONE example of <Scenario> with the < >
    I was just using Notepad and looking for that word

    Using Notepad++ and without the < & > it counts 102050 instances - divide by 82 and I get 1,244.5
     
    Last edited: Mar 17, 2024
  9. Spikee1975

    Spikee1975 Guest

    That's ok, there's only one <Scenario> node. It ends at </Scenario> as per xml convention. Count the lines in between (Notepad++ has them numbered) and divide them by 82.

    If the result is non-integer, that only means one or more scenarios have linefeeds in the scenario description text (which can be achieved by manually editing ScenarioProperties.xml, as the Editor itself doesn't allow CR/LF input in Description/Briefing), means some scenarios may take up more than 82 lines in the cache.

    Edit: Exact and simplest way. We don't need to know how many lines an entry has. As each scenario entry ends with </sSDScenario>, let's just search for the number of occurances of that tag.

    2024-03-17 15_44_02-.png

    So I've got 7,667 scenarios.
     
    Last edited by a moderator: Mar 17, 2024
  10. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    So <Scenario> is on 962 - </Scenario> is on 260980 take the 962 from that and I get 260018
    Should I have taken another two to make it 260016

    Divide by 82 and 3,170.9

    "if you want the exact number just close all nodes and count the lines with <sSDScenario..."

    Gives me 5082 matches :)
    But this is just the RW 72.3 version
     
    Last edited: Mar 17, 2024
  11. Spikee1975

    Spikee1975 Guest

    Exact method in edited post above, but roughly yeah
     
    Last edited by a moderator: Mar 17, 2024
  12. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    My current RW version gives 9086 matches :)
     
  13. Spikee1975

    Spikee1975 Guest

    You're there since day one :) though that absolutely doesn't match with the calculated result, it should be around 3,000?
     
  14. triznya.andras

    triznya.andras Well-Known Member

    Joined:
    Jun 29, 2019
    Messages:
    2,315
    Likes Received:
    2,760
    For science.
    With VS Code, searching for <sSDScenario or with / gives 3653 results for me.
    My very first scenario, which is Doncaster Works (free roam) for Doncaster Works (doh), starts at line 2204, ends at 2377. Next one till 2459.
    The reason for the difference is having multiple driveable locos in the free roam.
    In case of eTimetableScenarioClass, the player loco is optional OR [47+TEA] 6A11 Robeston - Theale is too old to have any.
    So I have 4707 scenario locomotives.
    It's pretty cool because I can search for Season 1 and I have 1968.

    I also have one scenario with season 4. I guess you can see it's workshop. :) good old extractor fail.
    upload_2024-3-17_16-44-11.png
    I also have four scenarios with weather 1920099668.

    Quite a few (official) scenarios have line breaks in ScenarioDesc.
    I did that myself by pasting the text in.

    It's easy to check scenario types. I have 41 timetabled, 911 standard, 1982 career, 252 free roam.
    146 routes so the rest more or less works for quick drives.

    Obviously, if you - for whatever reason - cannot reliably search for sSDScenario (and divide by two), you could also search for a child node, say, ScenarioClass, from my picture.
     
    • Like Like x 1
  15. Spikee1975

    Spikee1975 Guest

    I've got 1,000 scenarios from Not.Silent only... just figured out that's a word play on New Zealand where he's from. :)
     
    • Like Like x 1
  16. Spamcan

    Spamcan New Member

    Joined:
    Feb 12, 2022
    Messages:
    5
    Likes Received:
    1
    Thanks for your replys (so far) I`ll need to get my age addled brain round the tech.
     
  17. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    I don't have everything I have bought installed and my installation is split between the current version - mainly UK stuff - and my v72.3 which has mainly European stuff.

    Some routes I have because I bought TS20xx for a year and that gave me something I have not used
    Screenshot  1.png
    Screenshot 2.png
    Screenshot 3.png
    Screenshot 4.png
    Silly really

    Strange dates for some DLC as it says the Academy was installed 2011?
     
  18. Spikee1975

    Spikee1975 Guest

    Must be a mistake in the database, it came with TS2015 on Sep 18th, 2014. Or your PC was set to the wrong date :D

    Mine shows the correct date, when I purchased and installed TS2016. The DB BR 103 was my first DLC... and soon replaced by the vR store version :)
    2024-03-17 18_16_43-.png
     
    Last edited by a moderator: Mar 17, 2024
  19. triznya.andras

    triznya.andras Well-Known Member

    Joined:
    Jun 29, 2019
    Messages:
    2,315
    Likes Received:
    2,760
    The column is "Added". Did you buy the game on Christmas Eve 2011? :)
    The column shows the license date, which is the date of acquiring the package it now belongs to.
    In a similar fashion I obtained the Mk1 coach pack when I purchased Woodhead. Except it was added to it many years later.
    If you sort by Added it clarifies itself.

    (I would assume they added the Academy to every single core license.)

    By the way, I didn't check, but the Scenario Cache might include entries for played, then removed scenarios. To keep track of how many you played. (Can be obtained from Player Profile but anyway.) Similar to how the menus hide scenarios for missing routes, but searching by title reveals them. (Seebergbahn, for example.)
     
    Last edited: Mar 17, 2024
  20. Peter Hayes

    Peter Hayes Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    814
    Likes Received:
    328
    Scenarios in all routes.jpg To get a rough idea I use the Windows 10 search function and search in the \STEAM\steamapps\common\RailWorks\Content\Routes folder for scenario.bin.MD5 or scenarioProperties.xml.MD5 files. This is a fairly crude method (hoping each scenario file has a .MD5 checksum in its properties) but it is fast, it correlates reasonably well when using TS-Tools Route Building tools (see pic below) and listing all scenarios in all routes or manually counting them.
     
    Last edited: Mar 17, 2024
  21. Spikee1975

    Spikee1975 Guest

    That's the roughest method, many scenarios especially older ones don't have the MD5 file. Also Windows can't look inside .ap files and will not count the stuff in MainContent.ap or the scenario packs. And I have the habit to keep things nice and clean, so when Not.SIlent releases a 10-part scenario suite for WCMLS for example, I put these together in an .ap and name it NS-WCMLS_Scenarios.ap.

    triznya.andras The cache is created by crawling the routes folder. Only what is in the game should appear there, to be safe delete and let the game rebuild SDBCache.bin to reflect the current state. If you have deleted a scenario it won't appear in the cache - how should it?

    Cache creation pseudo code simplified:

    FOR EACH folder in Content\Routes
    cd \Scenarios (*.ap\Scenarios via zlib)
    FOR EACH folder in Scenarios
    READ ScenarioProperties.xml [GUID,Description,Loco, etc]
    IF EXISTS
    Scenario\GUID in Career.xml
    READ [Score, etc.] from career.xml
    SELECT MEDAL [compare score with medal defs in ScenarioProperties.xml]
    ENDIF
    WRITE <sSDScenario d:id=123456789> to SDBCache.xml
    ID+x
    NEXT
    NEXT
    SERZ SDBCache.xml
    CALCULATE .MD5
    WRITE SDBCache.bin.MD5


    That' why rebulding that cache takes so long. (Funnily RVDBCache, which is used by Custom Consist Editor, gets rebuilt every time you're using the consist editor automatically, so it is only valid for the current session).

    Though TSC is creating a WriteCache folder when launched, to save changed data at a later point in case of an irregular program exit, corruption can't be always ruled out after a crash (which have become very rare under v75.8a). I'm deleting the SDBCache once a week and let it rebuild while having my morning coffee.

    The file that stores each scenario ever played/started is Career.xml in your Steam\userdata (the file stores your progress and that gets synced with the cloud in case you're using Steam cloud.) This file is the most precious one (SDBCache is just - a cache, no original data in here), and I advise to make a backup of the Steam\userdata 24010 folder regularly. Career.xml gets updated on starting/finishing a scenario. Stuff you haven't played will not appear in there.

    Searching for the closing "</sSDscenario" tag seems to be the most exact way to count # scenarios.
     
    Last edited by a moderator: Mar 18, 2024
  22. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    10,072
    Likes Received:
    3,142
    I did get the game one Christmas but the Academy added date is 4 years before it was released
     
  23. triznya.andras

    triznya.andras Well-Known Member

    Joined:
    Jun 29, 2019
    Messages:
    2,315
    Likes Received:
    2,760
    Yes, that's how it works. It's what I tried to explain :)
    It shows the date of acquiring the package, not the app.
    For example, if you have this (https://steamdb.info/sub/11664/apps/), check the Hitachi Class 801. I'm guessing this because you also have HSC.

    My example - note the Mk1 Coaches.
    upload_2024-3-18_14-54-49.png
    This is the change that added it for me - cannot prove anymore due to last November's wipe, but anyway.
    upload_2024-3-18_14-55-49.png
    I see that you say "before released" and that's slightly different scenario from mine, but I think the point is clear - package acquiry date.
     
  24. Pookeyhead

    Pookeyhead Well-Known Member

    Joined:
    Dec 7, 2018
    Messages:
    4,296
    Likes Received:
    2,699
    I could have sworn I had more than this installed.... not that I'll ever play all of 3000 scenarios of course.
    gsdfgsdfgsdfg.JPG
     

Share This Page