Pak File Loader Plugin

Hi Thanks for the response. I can’t get it working. And I really don’t understand why this whole thing should be so complex . But I mean on the UE4 level - EPIC!
First, I totally don’t understand why Epic don’t allow loading the pak in editor. This is a nighmare to debug an applications during development that depends on external pak.
Second, I can’t load the content even when running the build.
Here is what I do:

Loaded pak file - ok.
Mounted - ok.
List the files in the pak- also ok.
List the files in the pak directory where the materials I want to load reside - ok
But when I try to access an asset,such as material, it is not loaded.

Here is what I do:

I have UE project which I package into pak.
Its content folder looks like this:

…/…/…/MaterialLibrary/Content/AutomotiveMaterials/Materials/Exterior/BrakeRotor/

I get the listing of the material files inside ‘BrakeRotor’ dir correctly.Which means the pak has been loaded and its files are visible to the PakLoader.
But when I am loading a material assets it fails.
Here is the screenshot of how I load the material:

And my mount point is configured as follows:

I tried to play around with the paths,I verified the PakLoader recognizes ‘BrakeRotor’ directory as you see in the script but the material fails to load.

2 Likes

From my understanding the Unreal Editor cannot handle cooked assets. All assets in your pak are normally cooked. Cooked means that your assets are no longer available in source format but optimized for the target platform. Therefore the editor can’t load them.

I think your RootPath is wrong, it should be “MaterialLibrary”.

So I did this:
Root: ‘/MaterialLibrary/’
Content Path: ‘…/…/…/MaterialLibrary/Content/’

Now when I am checking if the directory:

‘/MaterialLibrary/AutomotiveMaterials/Materials/Exterior/BrakeRotor’

exists ,it returns false.

Also,I am not sure if and when I have to user function “TryConverrFileNameToLongPackageName()”

Now I tried to check the dir for existence with the following path:

‘…/…/…/MaterialLibrary/Content/AutomotiveMaterials/Materials/Exterior/BrakeRotor/’

And now it finds it. But it still fails to load the material from there.

Also,do I have to load AssetRegistry?

Can you please post the output of UnrealPak -List of your pak file.

TryConvertFilenameToLongPackageName converts from a file path to a package path.
Example: …/…/TestProject/Content/Meshes/SM_MyMesh = /Game/Meshes/SM_MyMesh

From my experience you don’t have to load the asset registry. It always works for me except when loading levels (maps) then it sometimes is required from my experience.

Attached as a txt file. Thanks.
PakDump.txt (602.0 KB)

Regarding your answer:

TryConvertFilenameToLongPackageName converts from a file path to a package path.
Example: …/…/TestProject/Content/Meshes/SM_MyMesh = /Game/Meshes/SM_MyMesh

I understand that. You explain it in the documentation. My question is : when do I have to use it?

Thank you for the output. The pak is not a packaged content plugin (DLC)? It looks like a normally packaged game pak.

Please also show me the code (blueprint) that you use.
You can also send me the pak via Email if you like.

TryConvertFilenameToLongPackageName can be used for example for the output of GetFilesInPakDirectory. There’s an example in the demo project.

Hi. Right, this is a project .pak, not a DLC. In my case I must pack the project as I load levels from there in runtime. Please provide your email and I will send more details.Thanks,

Hi. You can find my email on my marketplace seller profile.

Hi,
Was able to solve temporarily the crashing problem caused by the Register mount point function in IOS [Engine version is 4.27.2]. This was done using set of CVars and disabling Pak Pre Cacher in the config files [Engine.ini]. But problems do occur like I can’t go back to my previous level after mounting, etc.
Super strange why this keeps happening in IOS. I also tried to mount levels using open level function. The DLC mounts properly. The mount point is registered and a blank level opens up. After checking several times, I noticed that the level opens up with the content within the plugin, but the referenced engine content does not load up. Errors like this pop-up:

*Couldn’t find file for package: /Engine/EngineSky/BP_Sky_Sphere *
requested by async loading code. NameToLoad: /Engine/EngineSky/BP_Sky_Sphere

I can’t go back to my previous level for this also. I also tried engine mounting using FCoreDelegates function-> This also works correctly in windows but fails rapidly in IOS.
Has anyone tried loading levels in IOS and other assets without a problem. Pls. help out. Trying to figure out a solution or workaround for this problem for several days but to no avail. Thanks in advance.

@BlueMountainsIO - Thanks for the great plugin. Have just posted on one of the questions in the marketplace as we’re experiencing issues where we’ve packaged as per the guide however for example when opening a level with “open [LevelName]” console command, the level loads however the referenced materials do not appear to load in.

Our primary use case is loading in levels into a packaged project via PAK files.

Have provided my example project and PAK Here

1 Like

@BlueMountainsIO - Just an update that in investigating this, it appears that when the level is being loaded, the UE4 log can’t locate the required textures as they haven’t been cooked. Having followed the instructions to package DLC in detail - it could be worth checking these to make sure they’re not missing something (unless of course it’s a UE4 regression!).

1 Like

@BlueMountainsIO - just an update on this - it appears that depending on how the PAK files are packaged and later loaded in, your plugin doesn’t load in the shaderCodeLibrary correctly when the PAK is mounted. This may be a product of the PAK packaging process (we’ve found that the PAK file that’s produced is missing the uplugin file in 4.27.1 which could be the issue?).

In any instance, it could be worth incorporating the following function into the mount PAK node to catch this (as a workaround, we’ve just implemented this ourselves in our own BPFunctionLibrary):

1 Like

Thanks for the information. What is your setting of the “Share Material Shader Code” variable in the project settings?

Thanks, in the project both “Share Material Shader Code” and “Shared Material Native LIbraries” are set to true.

1 Like

Hi @BlueMountainsIO , I want to use the Mount Pak File Easy node, can you tell me how I can include the AssetRegistry.bin file in the pak?

Hi @BlueMountainsIO I have one more question, can I cook and create pak file from chunk, instead of making plugin file like your example? I tried the traditional way and can’t get the asset in my pak.
Here is what I do: select File → Package Project → Windows
Here is the log:
[2022.03.13-17.18.53] Log: Is a package (shipping) build: true
[2022.03.13-17.18.53] Verbose: Found PakPlatformFile
[2022.03.13-17.18.53] Log: Mounted file is: …/…/…/PakDemoProject/Content/Paks/pakchunk2-WindowsNoEditor.pak
[2022.03.13-17.18.53] Log: Mounted file is: …/…/…/PakDemoProject/Content/Paks/pakchunk0-WindowsNoEditor.pak
[2022.03.13-17.18.53] Log: File in Pak: Maps/Level_1_BuiltData.uasset
[2022.03.13-17.18.53] Log: File in Pak: Materials/M_Cube.uasset
[2022.03.13-17.18.53] Log: File in Pak: Textures/dym_decal_nml.uasset
[2022.03.13-17.18.53] Log: Maps/Level_1.umap is exist? false
[2022.03.13-17.18.53] Log: …/…/…/PakDemoProject/Content/Maps/Level_1.umap exist? false
[2022.03.13-17.18.53] Log: /Game/Maps/Level_1.umap exist? false

I just bought this plugin and when i try to load the level. It doesnt work,
When i used print screen to check the log it seems the my map.uassest file is not loaded with pak. All the rest of the files are loaded. What could be the issue ??

Hi,I just bought this plugin and when i try to load the StaticMesh. It doesnt work,
But it can loaded Blueprint with pak… What could be the issue ??

Thanks

I have paks on s3 that when I use the pak loader system in a blueprint to retrieve them they only download just under 5M for each pak instead of the whole pak. Any ideas on why this would happen?