Spikee's Bugfixing Thread

Discussion in 'Technical Reports' started by Spikee1975, Nov 26, 2024.

  1. Spikee1975

    Spikee1975 Guest

    After having been a real annoyance to the great mindenjohn and finding technical issues such as wrong asset paths in freeware US routes (RSC\ShermanHill\ShermanHillAssets\Scenery...), I thought I'd make a thread on my findings and solutions. (You can't properly share images in private messages).

    I was downloading the Pogwassek 60's route from RWA. After having hunted down the required assets, some "ghost" items left questions. The reason is not clear to me, but it might have something to do with editing the route and saving it while a used asset pack is missing on the author's end.

    As I'm a visual guy, here's what happens.

    1. Replacing the missing.GeoPcDx with an OxfoPadd chimney Geo, so I can better spot missing stuff. This is what I found here on Pogwassek:

    2024-11-26 02_35_22-Train Simulator (x64).png

    On double clicking, a valid relative path and asset filename shows up. Sadly that flyout never shows the Provider from where the asset is from (suggested that many times.)

    So I'm opening the scenery tile the editor displays in the bottom left status bar.

    I'm searching for the asset name.
    2024-11-26 02_36_10-.png
    And the thing is, there's no Provider/Product in here. Luckily, the asset prefix "GX" points to G-TraX assets. Few seconds later I could locate them and all the rest in that tile in Boston-Albany.

    Entering the correct data:
    2024-11-26 02_36_41-.png


    Serzed the tile to .bin again, reloaded the route and the assets are showing up.
    2024-11-26 02_42_16-Train Simulator (x64).png

    I'll then fly around until the next candidates pop into view :)
    2024-11-26 03_56_18-Train Simulator (x64).png


    I had to do this for a massive amount of tiles on the lovely South Kaiser & Trent Mountain V3 route - including tracks.bin - batteries of chimneys there!, as it all started with someone having mistakenly extracted assets into an additional folder named as the .ap - which doen't really hurt for yourself (other than now having duplicate assets on a shifted hierarchy level - but as soon as you are building routes with that asset folder structure, these are bound to fail for other users. And as the editor shows you the DisplayNames in the pick list - if they are the same it will only ever show one, you don't even know which of the two it's using on the route unless you look at the tile files.

    After two days, South Kaiser has now been fixed to run on the correct asset folder structure - there were transfer points from the ELAP referenced to the USLAP, not hard to tell why. In the early days, people had mixed the assets, built routes using that structure. Fixed all by editing xml, no change was made using the World Editor.

    The nice thing is, TSC has become so stable that you can do all of this in the background, Alt-Tabbing, updating tiles, just reload the route.

    When extracting assets, the contents of the .ap belong to the Product folder directly - never a subfolder "ShermanHillAssets" or "HiLineAssets". An .ap is NOT a folder, but a transparent container and never part of the path. This is a fundamental thing and allows modding without overwriting. Your file manager may show it as a path, but that's not how the game sees it - ap's get mounted (and locked at runtime) by zlib.dll and TSC does not see them - it only sees their contents!

    I do now understand the issues some people have reported with missing assets or needing to unpack assets for them to show up. This is the cause. The error that starts with "Extract here..." spreads.

    I'll put more findings in this thread, this was mainly for John as I think he's starting to wonder what I was all about permanently telling him about issues he didn't have. :)

    Fun Fact: Even JT's Kyle Line suffers from that in a few spots. They have used a small hut, a duplicate of an existing asset named "source.bin" which was left out of the distributed assets, and some cars from the ELAP referenced wrongly in RailSimulatorUS. (Fixed of course) ;)
     
    Last edited by a moderator: Nov 26, 2024
    • Like Like x 2
  2. Spikee1975

    Spikee1975 Guest

    ... continued.

    And here I've just hit the issue described. This asset path is invalid as it is a custom one on the author's end only.

    2024-11-26 03_57_44-Train Simulator (x64).png
    2024-11-26 03_59_15-.png
    2024-11-26 04_00_27-Train Simulator (x64).png
    2024-11-26 04_01_52-.png

    Removed "BostonAlbanyAssets\" - fixed.
    2024-11-26 04_04_57-Train Simulator (x64).png
     
    Last edited by a moderator: Nov 26, 2024
    • Like Like x 2
  3. Spikee1975

    Spikee1975 Guest

    Then, there is stuff I sometimes just need to change to my needs. These are the "minor" issues. Like a SOO repaint for the F3, where the ND version couldn't be placed because it is referencing a different cab geo.

    This is requesting a WACampbell\RouteObjects\Scenery\Vehicles\1946_pontiac_grey.xml

    What I have is this - maybe this asset was distributed in another form. I suspect it is the same, so I can decide to either duplicate the asset (always change its internal name) or change the reference.

    The Pontiac has its own folder here:
    2024-11-26 04_11_27-Train Simulator (x64).png

    So I'm changin the reference.
    2024-11-26 04_15_23-Train Simulator (x64).png

    When all is done, I'll pack all the route data in its own MainContent.ap for final preservation. Further changes will produce tile folders outside of the .ap which can just be deleted in case of unwanted changes.

    It's time to play now:
    2024-11-26 05_45_04-Train Simulator (x64).png
     
    Last edited by a moderator: Nov 26, 2024
    • Like Like x 2
  4. Spikee1975

    Spikee1975 Guest

    Now onto the next - a scenario complains about a missing marker named "Destination1".

    2024-11-26 09_09_27-Train Simulator (x64).png
    If I see such an error the first thing is to look why that message appears. The scenario calls a marker named "Destination1". Before doing anything in the editor which could break the scenario at this stage, let's look at the files.

    Opening the scenario.bin which holds the service instructions:
    2024-11-26 09_11_55-.png

    This is a custom scenario based marker. These are stored in ScenarioNetworkProperties. So let's see if it's there:
    2024-11-26 09_13_07-.png

    It's not. That's the source of the correct error message. TS scan tracks.bin and ScenarioNetworkProperties for all markers referenced in a scenario, and outputs the message that it cannot find that place.

    But I see a marker that I couldn't find in the scenario timetable: (S) Switcher reverse point
    This file only holds two markers, a drop off marker which is used in the scenario and this one. So I will change the scenario to use this one instead and see what's happening.
    2024-11-26 09_15_34-.png

    Restarting the scenario now shows no errors at all. Instruction #5 is now valid again. :)
    2024-11-26 09_17_25-Train Simulator (x64).png

    UPDATE: On playing the scenario, the marker is not at a place that would make sense. "Destination1" must be replaced by "Butler Wye South" in the editor. Likely this scenario was made on a different version of the route.
     
    Last edited by a moderator: Nov 26, 2024
    • Like Like x 2
  5. mindenjohn

    mindenjohn Well-Known Member

    Joined:
    Aug 19, 2022
    Messages:
    514
    Likes Received:
    389
    Not an annoyance to me, still learning at 76. How do I replace milk bottles with the chimneys? Don't tell me - have the milk delivered by a steeplejack!
     
    • Like Like x 1
  6. Spikee1975

    Spikee1975 Guest

    This whole thing is packed with interesting quirks.

    See this boxcar? It changes textures when moving away pretty quickly. Where does the second texture come from?

    2024-11-26 11_48_03-Train Simulator (x64).png
    2024-11-26 11_48_15-Train Simulator (x64).png

    A look into the Geo file of that repaint reveals it jumps to the parent folder and into the base folder to load its textures in some LODs.
    2024-11-26 11_45_27-.png

    Replacing the paths after making sure the needed textures are in the repaint folder fixes this.
    2024-11-26 11_45_47-.png

    Et voilà!
    2024-11-26 11_44_38-Train Simulator (x64).png
     
    Last edited by a moderator: Nov 26, 2024
    • Like Like x 2
  7. Spikee1975

    Spikee1975 Guest

    Here is the fixed Geo for that boxcar. Only the Loaded one is affected.

    John, for the chimney I am copying oxfo_Padd_FactChimney02.GeoPcDx from Kuju\RailSimulator\Scenery\Buildings to Kuju\RailSimulatorCore\System\Missing.GeoPcDx - rename the original first so you can swap them on demand. I have deliberately not copied the texture along, so it really stands out.

    For example, you will see chimneys on GN Cascadian, but that's because according to Michael, at that time the editor was very unstable when they backdated Stevens Pass, so they decided to leave the modern houses on the Scenery tiles and just remove the assets. In that case, it's not an error and you won't spot the milk bottles.
     

    Attached Files:

    Last edited by a moderator: Nov 26, 2024
    • Like Like x 1
  8. mindenjohn

    mindenjohn Well-Known Member

    Joined:
    Aug 19, 2022
    Messages:
    514
    Likes Received:
    389
    Vielen Danke.
     
    • Like Like x 1
  9. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    9,592
    Likes Received:
    3,054
    • Like Like x 1
  10. mindenjohn

    mindenjohn Well-Known Member

    Joined:
    Aug 19, 2022
    Messages:
    514
    Likes Received:
    389
    Thank you.
     
  11. Spikee1975

    Spikee1975 Guest

    Skip the last "e". Feelin' Dunk :D
     
    • Like Like x 1
  12. Spikee1975

    Spikee1975 Guest

    While fixing the freeware hungarian route "MAV 70", I came across the issue of textures not loading. We had a discussion about french assets using special characters in filenames not loading.

    Here's the thing. This happens when files containing special characters are copied between PCs with different regional settings. It still looks correct on your end, but internally isn't. The only way to safely transfer these files would be to zip them before copying them.

    A house on MAV70 without textures reveals this. Note in the Geo the same filename is visible, but the OS handles it differently, possibly that's Windows UTF-16 vs file UTF-8 here. The codepages do not match seemingly. So, keep it to US-ASCII boys! Motorhead not Motörhead :D

    2024-12-13 16_00_34-Train Simulator (x64).png

    To fix this we have to rename the texture and its reference in the Geo (in all Geos using it!). An "A" is always an "A" in all codepages, the first 7 bits (0-127) are commonly mapped everywhere. (Ok, not on the C64.)

    So I'd advise using zip for transferring files that are used by a game engine. While the OS is making sure you won't notice anything in a normal document file, game files need to be preserved in their exact encoding on filesystem level, .ap and .zip do this because their own filenames do not matter at all while the content is protected from filesystem localisation and is always binary equal on transmitter and receiver end.

    I think that explains your issues 21c164fightercommand
     
    Last edited by a moderator: Dec 13, 2024
  13. ZaphodScotsman

    ZaphodScotsman New Member

    Joined:
    Oct 1, 2021
    Messages:
    5
    Likes Received:
    0
    I'm having trouble with this method: whenever I try to open it with notepad++, there are a bunch of strange characters. Here's an example:

    ©[ €? €? €? ȩ[ õÁ> 묿 €? 묿 € õÁ> ϩ[ ÿÿÿÿ O‘žC!"#$% þÿÿÿ ø‰݃!"#&'()*+,ªzn - ./0ŠŒi 123 4 5 6 7< 8= 9:;M <=> 4 5 6 7/ 8/ 9:;/ <?@N A B C DjIgD§ͼ0לwօFO GHIvn إz

    Can you please tell me how I can make it look like the way yours does, without all this clutter and whatnot?
     
  14. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    9,592
    Likes Received:
    3,054
    Don't use Notepad++
    Use Notepad.
     
  15. kilt46

    kilt46 Well-Known Member

    Joined:
    Jan 23, 2022
    Messages:
    895
    Likes Received:
    452
    Notepad++ is much better than plain notepad. If you are seeing noise in the data is because it is a binary file and needs converting using the SERZ tool
     
    • Helpful Helpful x 1
  16. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    9,592
    Likes Received:
    3,054
    Why is Notepad++ better than Notepad for TS Files?
     
  17. kilt46

    kilt46 Well-Known Member

    Joined:
    Jan 23, 2022
    Messages:
    895
    Likes Received:
    452
    Notepad++ allows for structured find and replace. If you wish to see all instances of a text simply Ctrl+F and you will see a list of them all at the bottom. Click on each one to navigate to that instance. This makes change management much easier to perform and see. It also color codes indentations if you are wishing to view nested commands.
     
    • Like Like x 1
  18. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    9,592
    Likes Received:
    3,054
    I will have to try that next time - thanks for the info
     

Share This Page