Announcement

Collapse
No announcement yet.

Pak File Loader Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by BlueMountainsIO View Post

    Please show the output of the UnrealPak -List command. Also take a look at the documentaiton, the function LoadPakAssetRegistryFile is explained there. I would also suggest to try out the demo project.

    By the way, from my testing, it's not necessary to load the AssetRegistry.bin file manually. Just use the loading functions from this plugin and it will work.
    It is working to spawn my assets. They are downloading and mounting fine. The static meshes are only showing up in the asset registery only after being spawned once howerver, and BP's I can't register with assetRegistry yet.

    Here's an output of my UnrealPak.exe -List for an example asset:

    LogPakFile: Display: Using command line for crypto configuration
    LogPakFile: Display: Added 0 entries to add to pak file.
    LogPakFile: Display: Mount point ../../../Pod/Plugins/ModPlugin/Content/DLC/13034129-7933-4fb8-86a0-8fb876d20c72/
    LogPakFile: Display: "Cube.uasset" offset: 0, size: 1228 bytes, sha1: AEE2E38AACAA4C47A5E9E0F04EE6C20235235A1F, compression: Zlib.
    LogPakFile: Display: "Cube.uexp" offset: 1298, size: 2326 bytes, sha1: D5D6A206484825737425B2A2E88018959C2167AF, compression: Zlib.
    LogPakFile: Display: "M_Cube.uasset" offset: 3694, size: 504 bytes, sha1: 19929E4F09BCF08ECBF8FDA1927BE1E1A4B29AB3, compression: Zlib.
    LogPakFile: Display: "M_Cube.uexp" offset: 4268, size: 43501 bytes, sha1: F68F832E786E47CBB837FCEDC41066881636B344, compression: Zlib.
    LogPakFile: Display: 4 files (47559 bytes), (0 filtered bytes).
    LogPakFile: Display: Unreal pak executed in 0.005045 seconds
    Last edited by MagicBots; 09-11-2019, 09:42 PM.

    Leave a comment:


  • replied
    Originally posted by BlueMountainsIO View Post


    Unfortunately, the images you uploaded do not display.

    BlueMountainsIO Thats weird, Attached the images instead
    Is the ../../../ before the mount point important?
    Attached Files
    Last edited by Rareden; 09-11-2019, 07:19 AM.

    Leave a comment:


  • replied
    Originally posted by MagicBots View Post
    I have also been trying to simply move in the packaged content plugin to the packaged game plugin location, with the cooked AssetRegistry.bin placed where BlueMountainsIO plugin is expecting it according to the example. No success with having the registry successfully appended via the LoadPakAssetRegistry function thus far ... Hoping BlueMountainsIO can advise as to how that was working with his example which seems to also have the AssetRegistry.bin file being expected at a plugin location. Everything else is working, just not the registry..
    Please show the output of the UnrealPak -List command. Also take a look at the documentaiton, the function LoadPakAssetRegistryFile is explained there. I would also suggest to try out the demo project.

    By the way, from my testing, it's not necessary to load the AssetRegistry.bin file manually. Just use the loading functions from this plugin and it will work.

    Leave a comment:


  • replied
    Originally posted by MagicBots View Post

    Will test around today and see what I can find out.

    Unrelated questions:
    Wondering if there are any special considerations for mounting paks into my plugin, rather than main project content locations?

    For mounting paks to my plugin, i'm wondering if i should download the .paks into the WindowsNoEditor/<ProjectName>/Content/Paks/ folder, or if I should make the folder: WindowsNoEditor/<ProjectName>/<PluginName>/Content/Paks/ ..

    I guess I will need to change the mountPath in the actual .pak file while pakking if i change the download location.. but in general is it a better idea to just keep with <ProjectName>/Content/Paks location for downloading paks? So far I haven't had the automatic pak loading work for me at all, and I'm not sure why. If the automatic pak loading did actually work from <ProjectName>/Content/Paks/ then i'd leave my pak downloads location there, but otherwise, i'm thinking it'll be cleaner to move it under my plugins location and just create the appropriate folders. Does automatic pak mounting work for you? Is there any consideration for downloading paks to another locations such as my plugin location if i change the mountpaths during pak creation?

    Are there other considerations other than making sure the mountPath is set to proper content location where it was originally pak'd from with the "Mount Pak File", and that the rootpath and contentPath are also set to match to the plugin locations with the "Register Mount Point"?

    Edit:
    Answered my own question about pathing for plugin content by just trying it. Works fine, and in fact your example showed pathing for this. I still wonder about changing the location for the .paks to be in the plugin so it's more self contained, and about automatic loading..
    You would want to create a new folder because the FPaths::ProjectSavedDir()/Pak/ folder is mounted automatically by the engine.
    This is what this plugin was made for to manually mount paks.
    The location of the pak file on disk does not matter.

    Glad the example helped you.
    Originally posted by Rareden View Post
    BlueMountainsIO
    Im manually cooking and pak'ing the necessary files rather than using the content plugin cooking method, so i dont get a .bin specifically for the assets, might try merging the .bin made after cooking manually though, if theres a way to merge them.

    The path when i select the asset in the editor and copy reference is Blueprint'/Game/Avatars/New/BP_Bader.BP_Bader'
    When i pak the files i remove the complete path (D:/ProjectName/Saved/cooked/) and replace /Content/ With /Game so it becomes /Game/Avatars/New

    Image of the Pak List

     
    Spoiler


    Im not too sure what to set the register mount point to with this method, ive been leaving it as this
     
    Spoiler

    Ive tried /Game as well. If i just use / as the root the registry adds the paths included in the pak to its cached paths as
    Code:
    [2019.09.10-01.27.05:922][787]LogBlueprintUserMessages: /Game/Avatars/New
    [2019.09.10-01.27.05:923][787]LogBlueprintUserMessages: /Game/Avatars/New/Animations
    [2019.09.10-01.27.05:923][787]LogBlueprintUserMessages: /Game/Avatars/New/Materials
    [2019.09.10-01.27.05:924][787]LogBlueprintUserMessages: /Game/Avatars/New/Textures
    Unfortunately, the images you uploaded do not display.



    By the way, from my testing, it's not necessary to load the AssetRegistry.bin file manually. Just use the loading functions from this plugin and it will work.

    Leave a comment:


  • replied
    Originally posted by Cytokinetik View Post
    This may be of some help about learning the .pak system and asset registry:
    https://github.com/nakata0705/ModSkeleton
    Thanks I saw this today and was playing with a different fork of it. Is this the latest and greatest?

    I was playing with this one: https://github.com/calben/ModSkeleton
    ..and i saw they are just moving over their AssetRegistry.bin to the packaged location and associating with the plugin .pak file that way. Is that the standard practice?

    I have also been trying to simply move in the packaged content plugin to the packaged game plugin location, with the cooked AssetRegistry.bin placed where BlueMountainsIO plugin is expecting it according to the example. No success with having the registry successfully appended via the LoadPakAssetRegistry function thus far ... Hoping BlueMountainsIO can advise as to how that was working with his example which seems to also have the AssetRegistry.bin file being expected at a plugin location. Everything else is working, just not the registry..

    Packaging my Content Plugin via Tom Looman's Mod packaging example when trying the above..
    https://www.tomlooman.com/add-mod-su...engine-4-game/
    Last edited by MagicBots; 09-11-2019, 05:06 AM.

    Leave a comment:


  • replied
    This may be of some help about learning the .pak system and asset registry:
    https://github.com/nakata0705/ModSkeleton

    This was forked and updated from the original, it is a modding skeleton method. I think the assetregistry.bin for addon paks is also located and cooked inside of the .pak as well. I am not sure if that could cause a conflict. Using this .pak loader plugin along with the modskeleton method may help the process. The modskeleton allows adding .paks/mods without needing the original project at all...

    Regardless it is a good learning tool along with the .pakloader plugin,

    Leave a comment:


  • replied
    For me the AssetRegistry.bin isn't coming along to the packaged location. How does this normally get copied into the packaged location from the saved/cooked directory? I suppose it should be in the packaged location, otherwise how is it accessed at runtime? Maybe I'm missing a setting in my Project Launcher Custom Launch Profile? Sorry, first time learning about that AssetRegistry.bin so a little confused with why it's not where I'd expect it to be.

    Also my packaged location isn't in the project dir. Is that expected for this to work? Otherwise, not sure how a path like the example path for the LoadPakAssetRegistry function would work. Example path provided: (../../../TestProject/Plugins/TestDLC/AssetRegistry.bin).

    I suppose a way it could work to have a minimal AssetRegistry.bin file would be to build it with a unreal session with only the contents you want inside.. via a commandlet. That is if LoadPakAssetRegistry *merges* to the main asset registry?


    Edit:
    ​​​​​​​
    So I see that when I generate a patch for my content plugin i then have plugin specific AssetRegistry.bin in the cooked location for for the content plugin, but still not clear no standard process for getting that to come along for the ride at the packaged location.
    Last edited by MagicBots; 09-11-2019, 02:33 AM.

    Leave a comment:


  • replied
    Originally posted by MagicBots View Post
    Well I'm having the same problem as Rareden as I am also manually pak'ing the files. What creates the AssetRegistry.bin file, and is there a way to do it manually?
    The AssetRegistry.bin is generated when you cook, not sure how you could cut out all but the required assets from it due to it containing more than just paths

    Leave a comment:


  • replied
    Well I'm having the same problem as Rareden as I am also manually pak'ing the files. What creates the AssetRegistry.bin file, and is there a way to do it manually?

    Leave a comment:


  • replied
    Originally posted by BlueMountainsIO View Post
    Rareden
    Have you tried loading the AssetRegistry.bin file with the function "LoadPakAssetRegistryFile"? Take a look at the documentation. https://drive.google.com/file/d/1DeS...AHs89rDUM/view
    This one should populate all files.

    Also, are you 100% sure about the path to the blueprint? Most of the time it's just the path thing and Unreal can't find it.
    Can you show me the output of "UnrealPak.exe C:\YourPak.pak -List". I can then tell you the correct RootPath and ContentPath for the RegisterMountPoint.

    MagicBots
    Same here, please show me the output of the command from above. It can be really tricky to get this right.
    BlueMountainsIO
    Im manually cooking and pak'ing the necessary files rather than using the content plugin cooking method, so i dont get a .bin specifically for the assets, might try merging the .bin made after cooking manually though, if theres a way to merge them.

    The path when i select the asset in the editor and copy reference is Blueprint'/Game/Avatars/New/BP_Bader.BP_Bader'
    When i pak the files i remove the complete path (D:/ProjectName/Saved/cooked/) and replace /Content/ With /Game so it becomes /Game/Avatars/New

    Image of the Pak List

     
    Spoiler


    Im not too sure what to set the register mount point to with this method, ive been leaving it as this
     
    Spoiler

    Ive tried /Game as well. If i just use / as the root the registry adds the paths included in the pak to its cached paths as
    Code:
    [2019.09.10-01.27.05:922][787]LogBlueprintUserMessages: /Game/Avatars/New
    [2019.09.10-01.27.05:923][787]LogBlueprintUserMessages: /Game/Avatars/New/Animations
    [2019.09.10-01.27.05:923][787]LogBlueprintUserMessages: /Game/Avatars/New/Materials
    [2019.09.10-01.27.05:924][787]LogBlueprintUserMessages: /Game/Avatars/New/Textures
    Last edited by Rareden; 09-11-2019, 04:58 AM.

    Leave a comment:


  • replied
    Originally posted by BlueMountainsIO View Post
    Rareden

    MagicBots
    Same here, please show me the output of the command from above. It can be really tricky to get this right.
    Will test around today and see what I can find out.

    Unrelated questions:
    Wondering if there are any special considerations for mounting paks into my plugin, rather than main project content locations?

    For mounting paks to my plugin, i'm wondering if i should download the .paks into the WindowsNoEditor/<ProjectName>/Content/Paks/ folder, or if I should make the folder: WindowsNoEditor/<ProjectName>/<PluginName>/Content/Paks/ ..

    I guess I will need to change the mountPath in the actual .pak file while pakking if i change the download location.. but in general is it a better idea to just keep with <ProjectName>/Content/Paks location for downloading paks? So far I haven't had the automatic pak loading work for me at all, and I'm not sure why. If the automatic pak loading did actually work from <ProjectName>/Content/Paks/ then i'd leave my pak downloads location there, but otherwise, i'm thinking it'll be cleaner to move it under my plugins location and just create the appropriate folders. Does automatic pak mounting work for you? Is there any consideration for downloading paks to another locations such as my plugin location if i change the mountpaths during pak creation?

    Are there other considerations other than making sure the mountPath is set to proper content location where it was originally pak'd from with the "Mount Pak File", and that the rootpath and contentPath are also set to match to the plugin locations with the "Register Mount Point"?

    Edit:
    Answered my own question about pathing for plugin content by just trying it. Works fine, and in fact your example showed pathing for this. I still wonder about changing the location for the .paks to be in the plugin so it's more self contained, and about automatic loading..
    Last edited by MagicBots; 09-10-2019, 02:34 AM.

    Leave a comment:


  • replied
    Rareden
    Have you tried loading the AssetRegistry.bin file with the function "LoadPakAssetRegistryFile"? Take a look at the documentation. https://drive.google.com/file/d/1DeS...AHs89rDUM/view
    This one should populate all files.

    Also, are you 100% sure about the path to the blueprint? Most of the time it's just the path thing and Unreal can't find it.
    Can you show me the output of "UnrealPak.exe C:\YourPak.pak -List". I can then tell you the correct RootPath and ContentPath for the RegisterMountPoint.

    MagicBots
    Same here, please show me the output of the command from above. It can be really tricky to get this right.

    Leave a comment:


  • replied
    FWIW I was having the same issue before this plugin too with registering mounted BPs.. Thought it might be working here with that BP_Test that was loaded, but I haven't had the chance to test pak'ing and mounting my own BPs with this yet. Will be great if that is working.

    Leave a comment:


  • replied
    Originally posted by BlueMountainsIO View Post
    MagicBots
    I don't see a way how multiplayer would interfere with loading paks.

    Do you mean asset loading hitches? Keep files small to keep loading times low.

    Rareden
    I think there is way to scan asset paths with the asset registry node in Blueprints/C++.

    Are you sure you are running this in a packaged build? Because it doesn't work in "editor only".
    Yes its in a packaged game, tried shipping and development.
    The plugin i was working on before you released yours is pretty much the same and i had the same issue. When i scan the pak content it registers all the non BP related assets into the registry just fine but it wont populate it with the BP's even with the corrected file name e.g Path/Assetname.Assetname_C
    Last edited by Rareden; 09-08-2019, 09:40 PM.

    Leave a comment:


  • replied
    MagicBots
    I don't see a way how multiplayer would interfere with loading paks.

    Do you mean asset loading hitches? Keep files small to keep loading times low.

    Rareden
    I think there is way to scan asset paths with the asset registry node in Blueprints/C++.

    Are you sure you are running this in a packaged build? Because it doesn't work in "editor only".

    Leave a comment:

Working...
X