Tutorial Let's Cook! Guide To Cooking And Packaging Projects In The Editor

Discussion in 'PC Editor Discussion' started by DTG Alex, Sep 18, 2024.

  1. DTG Alex

    DTG Alex Senior Community Manager Staff Member

    Joined:
    Jun 16, 2022
    Messages:
    1,561
    Likes Received:
    13,167
    Hello everyone,

    Update: We are aware of an issue with the PC Editor that is preventing cooking from working with the below method. Matt and the team are aware and will update once we can provide more information.

    Since we've introduced the functionality to cook and package up projects using the PC Editor, we've seen many requests for support on how to do this, so we wanted to share some useful documentation that will help (courtesy of DTG Matt).

    All the information will be shared below, or if you'd rather there is a PDF file attached to download too.

    Cooking and Packaging in TSW5 Editor
    There are three main steps needed to get content made in the editor into a shareable file that
    can be used by the game. The first of which is called ‘cooking’ this process involves essentially
    compiling any assets into a smaller format with only the information the game requires. The
    second is to create a .ugc (User Generated Content) file. This acts a bit like a definition for the
    mod and is used to instruct the add-on manager with what DLCs are required to use the mod.
    The final step is to package the mod, this part of the process takes all the cooked files and
    places them in a single .pak file that can easily be shared, and this is the type of file the game
    will look for when loading mods.

    Please note: This process requires some basic command line knowledge

    1. Cooking

    The first step is to cook the assets this can be done using the following command:

    TS2Prototype\Binaries\Win64\TrainSimWorldPublicEditor.exe TS2Prototype -run=Cook -
    TargetPlatform=WindowsNoEditor -dlcname=PLUGIN_NAME,DLC/PLUGIN_NAME

    Where PLUGIN_NAME should be replaced with the name of the plugin you want to cook. For
    example:

    “C:\Program Files\Epic
    Games\TrainSimWorld5MOD\TS2Prototype\Binaries\Win64\TrainSimWorldPublicEditor.exe”
    TS2Prototype -run=Cook -TargetPlatform=WindowsNoEditor -
    dlcname=TestScenario,DLC/TestScenario

    The plugin should be moved so that it is within the ‘DLC’ folder (Plugins/DLC).

    After running this command, a window will appear with a log of the cooking process, and this
    should eventually close once complete. It may be worth creating a batch file with this command in so the plugin can easily be cooked many times.

    [​IMG]

    All cooked files can then be found in the ‘Saved’ folder of the plugin.

    [​IMG]

    2. Create a UGC (User Generated Content) file
    The UGC file should be created in the content folder of a cooked plugin. This can be created
    using notepad and the contents should look something like this:

    {
    "ContentPath": "Plugins\/DLC\/PLUGIN_NAME\/Content\/",
    "DLCDependencies": [ "EastCoastway" ],
    "MountPoint": "\/PLUGIN_NAME\/",
    "Name": "PLUGIN_NAME"
    }

    The ‘ContentPath’, ‘MountPoint’, ‘Name’ values can all have PLUGIN_NAME swapped for
    whatever the name of the plugin was for your mod. For example:

    [​IMG]

    The DLCDependencies value should be changed so that it contains any DLC the mod uses. This
    is so that the add-on manager knows what content to also load when the mod is loaded.

    In the case above the plugin has a scenario that uses the class 377 from EastCoastway so
    EastCoastway must also be loaded for the scenario to work.

    When saving the file it must be placed in the Content folder of the cooked plugin and the
    filename must end with the .ugc ending.

    [​IMG]

    [​IMG]

    Backup this UGC file so it does not need to be created every time the plugin gets cooked and can just be copied in.

    3. Packaging
    The final step is to package the mod, this involves using a tool called UnrealPak. To create a pak
    file UnrealPak requires a response file that describes where the cooked files the pak should
    contain are located. This can just be a text file and should look something like this:

    "FOLDER_WITH_COOKED_CONTENT\*.*" "..\..\..\*.*"

    Where FOLDER_WITH_COOKED_CONTENT is the location of the cooked assets. For example:

    "C:\Program Files\Epic Games\TrainSimWorld5MOD\TS2Prototype\Plugins\DLC\TestScenario\Saved\Cooked\WindowsNoEditor\*.*" "..\..\..\*.*"

    Once a response file is created the following command can be used to generate a pak file:

    Engine\Binaries\Win64\UnrealPak.exe "LOCATION_OF_PAK\TestScenario.pak" -
    create="LOCATION_OF_RESPONSE_FILE\responsefile.txt

    Where LOCATION_OF_PAK is the folder where the pak should be generated and
    LOCATION_OF_RESPONSE_FILE is where the response file is located. For example:

    "C:\Program Files\Epic Games\TrainSimWorld5MOD\Engine\Binaries\Win64\UnrealPak.exe"
    "G:\Mod Construction\TestScenario.pak" -create="G:\Mod Construction\responsefile.txt"

    Once the pak has been created it can be moved into a folder where the game will load it. This
    can either be the UserContent folder where save game content is stored or in the DLC folder
    where the game is installed.

    For the UserContent folder the path would be:
    Documents\My Games\TrainSimWorld5\Saved\UserContent\
    [​IMG]

    The UserContent folder may need creating.

    For the DLC folder the path would be based on where the game is installed for example:

    C:\Program Files (x86)\Steam\steamapps\common\Train Sim World 5\WindowsNoEditor\TS2Prototype\Content\DLC
     

    Attached Files:

    Last edited: Sep 23, 2024
    • Helpful Helpful x 5
    • Like Like x 4
  2. bezdelnikx#2683

    bezdelnikx#2683 New Member

    Joined:
    Jul 13, 2022
    Messages:
    9
    Likes Received:
    5
    Could you please provide a link to UnrealPak?
     
  3. gulp78

    gulp78 New Member

    Joined:
    May 14, 2019
    Messages:
    7
    Likes Received:
    13
    It is within the TSW5 editor itself at: TrainSimWorld5Mod\Engine\Binaries\Win64

    upload_2024-9-18_10-37-14.png
     
  4. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    It would be easier if there was a Cook button and Distribute button like what TrainSimCZ used in his patch for cooking and packaging content.
     
    • Like Like x 7
  5. jackthom

    jackthom Active Member

    Joined:
    Aug 22, 2020
    Messages:
    377
    Likes Received:
    186
    How much more complicated does it become if you are cooking an entire new route which contains assets “borrowed” from multiple DLCs?
     
  6. yeecharlie#6454

    yeecharlie#6454 Well-Known Member

    Joined:
    May 29, 2021
    Messages:
    186
    Likes Received:
    588
    How do you cook DataAssets? I have the .uassets ready but it crashes every time I try to cook them.
     
  7. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    For me the process of cooking is everytime crashing
     
  8. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    upload_2024-9-18_20-15-29.png
    It is not working, cooking seems still bugged
     
  9. josh_the_tech

    josh_the_tech Active Member

    Joined:
    Dec 9, 2016
    Messages:
    256
    Likes Received:
    158
    Please share the full log. The screenshot provided doesn't show any issues related to the cooking.
     
  10. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
     

    Attached Files:

  11. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    Is cooking working for you?
     
  12. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    upload_2024-9-18_20-44-12.png
    Thats the icluded stuff
     
  13. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    342
    Likes Received:
    461
    Followed the instructions but still cooking not saving anything.
     
  14. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    For me too just some settings
     
  15. josh_the_tech

    josh_the_tech Active Member

    Joined:
    Dec 9, 2016
    Messages:
    256
    Likes Received:
    158
    • Like Like x 1
  16. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    342
    Likes Received:
    461
    Regarding "DLCDependencies": [ "EastCoastway" ],
    Would it be done like this for multple dlcs "DLCDependencies": [ "DLC" ],[ "DLC" ] or "DLCDependencies": [ "DLC", "DLC" ],?
     
    • Like Like x 1
  17. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    And where I get the right names of the plugins (from the .pak or from ue4)?
     
  18. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    502
    Likes Received:
    507
    But it should be the second option because it's an array
     
  19. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    To anyone in this thread... Since TSW5's editor is still experiencing issues, do you or do you know someone who uses Unreal Engine editor to create content for TSW that can shed some light on how I can do the same? I'm able to manipulate the file/folder structure of TSW5's Editor just fine. My ultimate goal in the end and if possible is to, use the Unreal Engine editor's version of cooking + packing content aswell.

    For context, here is and if possible my planned workflow...
    A: Create a simple train formation using TSW5's editor.
    B: Cook my simple train formation using Unreal Engines editor.
    C: Add the User Generated Content file to the cooked content.
    D: Package it using Unreal Engines editor so that the content can be loaded in-game.

    If you know how this can be achieved then, please let me know by, responding to this MSG or PM me if that is possible.
    If you believe that this isn't possible then, please still let me know by, responding to this MSG or PM me if that is possible.
     
  20. moofers#8902

    moofers#8902 Well-Known Member

    Joined:
    Dec 6, 2021
    Messages:
    342
    Likes Received:
    461
    Unfortunately I don't think cooking in Unreal Editor outside of TSW5 Editor is possible due to how the blueprints work.
     
  21. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    In that case, how do people over on TrainSimCommunity create... let's say, there's a mod for the class 350 - 3car that was created in the early access of TSW5 and still question myself how did they achieve this when the TSW5 editor was release on the 17th September 2024. Either they used the TSW4 editor to create the 3car class 350 somehow or they used Unreal Engines editor and somehow injected the TS2Prototype.uplugin along with other files in the TS2Prototype folder and loaded it into Unreal Engines editor.
     
    Last edited: Sep 19, 2024
  22. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    I was questioning how did someone create a 3car train mod for tsw5 game while the editor itself was only release 2days ago and that the mod was created during early access. Are you suggesting that the 3car train mod for tsw5 was created by using trainsim.cz mod when that mod is meant for TSW4?
     
  23. Spikee1975

    Spikee1975 Guest

    Why don't you ask that modder directly on the TSC Discord? He might be able to help you.
     
  24. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    Thanks. Joined the discord server and sent message. Hoping for a response soon.
     
  25. bescot

    bescot Well-Known Member

    Joined:
    Dec 14, 2016
    Messages:
    729
    Likes Received:
    1,468
    I've spoken to you on Discord, but for anyone else - TSW4 editor will still work for TSW5 content. It's missing certain classes (mainly for core ) but shouldn't affect you too much.

    I'm still using it for modding some things for WCMLs, cooking works with the patch from Trainsim.cz
     
  26. jackthom

    jackthom Active Member

    Joined:
    Aug 22, 2020
    Messages:
    377
    Likes Received:
    186
    If I remove my TSW4 content will the TSW4 editor simply locate the TSW5 content instead?
     
  27. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    If you are asking will TSW4 editor load TSW5 game data then yes. You may get a box window with some warning's but that's ok as It wont hinder you from creating content. All the warning's that show, are just missing classes that TSW5 editor uses, otherwise all is good.
     
    Last edited: Sep 19, 2024
    • Helpful Helpful x 1
  28. tcarter16

    tcarter16 New Member

    Joined:
    Mar 16, 2018
    Messages:
    24
    Likes Received:
    10
    play in editor crashes for me when using editor 4 with tsw 5

    it crashes when opening hud in editor 5 with tsw 5
     
  29. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    I didn’t get that far into it as I come across TSW Editors Docs website on downloading the unofficial editor which works.
     
  30. josh_the_tech

    josh_the_tech Active Member

    Joined:
    Dec 9, 2016
    Messages:
    256
    Likes Received:
    158
    I thought that was only for TSW3, given TSW4 had the public editor.
     
  31. 2martens

    2martens Well-Known Member

    Joined:
    Oct 6, 2020
    Messages:
    378
    Likes Received:
    476
    I've tried to open my timetable from TSW 4 in the TSW 5 editor and it won't open. Is the file structure somehow different?

    Update: Nope, it just can't be under Plugins/DLC and must be directly under Plugins.
     
    Last edited: Sep 20, 2024
  32. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    It also works for TSW5 as i using it and creating custom formations is a breeze.
     
  33. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    It's seems that, what ever is wrong with TSW5 editor when cooking, is bigger than we thought? or is it that its complexity is the reasoning why we haven't yet got an update regarding this. Please do feel free to respond
     
  34. ffabio89

    ffabio89 Well-Known Member

    Joined:
    Aug 15, 2020
    Messages:
    269
    Likes Received:
    250
    I think it's better wait for some official response from DTG ok this... Obviously it's a very complex argument this one or we haven't encountered this problems with this version
     
  35. ben#6357

    ben#6357 Active Member

    Joined:
    Feb 14, 2024
    Messages:
    131
    Likes Received:
    79
    Sorry, your images cannot be viewed for some reason.
     
  36. ffabio89

    ffabio89 Well-Known Member

    Joined:
    Aug 15, 2020
    Messages:
    269
    Likes Received:
    250
    Waiting the cooking patch and thought: if I had built some objects for editor use only, I need to cook it for other users to share with? Or there's some other way to use it in other users route?
    Maybe it's a stupid question but if someone use my object and, when it's route will be ready, my stuffs will be cooked in to the route so, why cook twice?
    And this is the best solution to publish reusable objects for a route?
     
  37. Isaak

    Isaak Well-Known Member

    Joined:
    Aug 5, 2019
    Messages:
    374
    Likes Received:
    442
    I cannot simulate a timetable anymore with the TSW 4 editor while TSW5 is installed, and I can 't use the TSW 5 editor as it is severely bugged (crash when opening the map in PIE..., let alone the promised cooking functionality that is totally absent). DTG went dead silent after launch day. I'd hoped for at least some communication on what we can expect now. DTG Alex or DTG Matt , can you enlighten us on what is happening now? Will there be more communication in the near future? Is someone looking into these issues?
     
    • Like Like x 1
  38. 2martens

    2martens Well-Known Member

    Joined:
    Oct 6, 2020
    Messages:
    378
    Likes Received:
    476
    What I do right now:
    • edit in TSW 4 editor
    • run simulation with TSW 5 editor
    • cook with TSW 4 editor using trainsimcz mod
    • create pak file
    • play in TSW 5
     
  39. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    This works for you?
     
  40. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    Agreed. If only DTG were to, give us the same tools they give to the likes of Rivet Games, Skyhook Games etc. then problems wouldn't arise, not to mention that PC editor wouldn't have to exist. Its one tool for professionals and one tool for kids. Lol. I just don't seem to understand the reason behind not allowing us non commercial modders like you & i to use the same toolset as the developers in this case DTG. If they say that ,its near to identical to what they use then, why is the pc editor this problematic? I shall tell you why its this problematic, DTG has taken elements of Unreal Editor and created a program in this case PC editor to be tailored around the use of Train Sim World. That is what they have done in a nutshell. Sometime taking elements of a program and trying to create something out of it may not always work out.
     
    Last edited: Sep 24, 2024
  41. jackthom

    jackthom Active Member

    Joined:
    Aug 22, 2020
    Messages:
    377
    Likes Received:
    186
    I suspect we need to have the public version of the editor as it gives us limited access to a selection of assets which would otherwise be unavailable as cooked items.
    I’m assuming the grown up in house editor uses assets which are fully provided in their original form.
    It’s a fair bet that the professional version doesn’t fall over as often as the public one, at least I would hope not.

    I could of course be totally wrong about this and would be interested to hear from better informed forum members.
     
    Last edited: Sep 23, 2024
  42. 2martens

    2martens Well-Known Member

    Joined:
    Oct 6, 2020
    Messages:
    378
    Likes Received:
    476
    The 3rd party devs have access to the source versions of all assets. DTG obviously can't do that without a contractual agreement. The public editor is the Unreal editor with the ability to work with cooked assets, something the Unreal editor on its own can't do.

    Cooking for DLCs is based on the idea that only the difference to a released version is cooked. For that, an asset manifest is required against which to compare. DTG tried to implement cooking for DLCs without this manifest. That didn't work.
     
    • Helpful Helpful x 1
  43. ItayLevy2001

    ItayLevy2001 Active Member

    Joined:
    Jul 6, 2018
    Messages:
    205
    Likes Received:
    144
    What about Cooking & Packing Custom Sound Mods for Existing Trains??
     
  44. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    The ability to cook own content using TSW5 editor is not working. DTG Matt and the team are aware of the issue and I believe that they are looking into why this is happening as we speak.
     
  45. ItayLevy2001

    ItayLevy2001 Active Member

    Joined:
    Jul 6, 2018
    Messages:
    205
    Likes Received:
    144
    I mean to the Cooking & Packaging Custom Sound Mods for Existing Trains
     
  46. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    Regardless whether its for own content or for existing content, if you cant cook, you cant have the changes in the game. That's how the cooking process works with Unreal Engine incase you were unaware.
     
  47. frownytob#1358

    frownytob#1358 Member

    Joined:
    Aug 9, 2022
    Messages:
    43
    Likes Received:
    6
    I run the first cooking command and nothing happens.
     
  48. josh_the_tech

    josh_the_tech Active Member

    Joined:
    Dec 9, 2016
    Messages:
    256
    Likes Received:
    158
    Yes Cooking does not work currently as confirmed in this thread. We are waiting for an update from DTG to fix it... eventually.
     
  49. kryst4lclr

    kryst4lclr Member

    Joined:
    Dec 5, 2023
    Messages:
    52
    Likes Received:
    4
    Congratulations DTG, you’ve managed to fix cooking ability but now have broken .pak files as they are now blank created. How much longer dose the community have to wait before the cat and mouse game actually end?
     
    • Like Like x 1
  50. Spikee1975

    Spikee1975 Guest

    Luckily, once your files are cooked you do not need the TSW editor. UnrealPak.exe will work without it.
     

Share This Page