Hello,
I am working on an application that loads assets from external pak files.
It works well if I package my app and my pak files (separately) by disabling “use io store” in both cases.
This option is not well documented, so it’s not clear how it works and what it improves. There is a tooltip saying “if enabled, use .utoc/.ucas container files for staged/packaged package data instead of pak”. I read on this forum (here) that apparently it is better to keep it enabled for faster loading times.
If I enable the option on my side to package the application and the external pak (which also generates the 2 additional utoc and ucas files), then when I try to load it in the main application, the asset registry fails to correctly read the content of the pak.
I can correctly:
- mount the pak with “pakFileManager->Mount(*inputPath, 0, *mountPoint);” which returns true.
- extract the list of files contained in the pak:
TArray<FString> pakContent;
FPakPlatformFile::GetFilenamesFromIostoreContainer(FPaths::GetBaseFilename(pakFilePath), pakContent);
followed by some formatting to have paths like this “/Game/[directory_name]/[object_name].uasset” as it is done in this Epic tutorial.
Then I have:
FAssetRegistryModule& assetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>("AssetRegistry");
IAssetRegistry& assetRegistry = assetRegistryModule.Get();
assetRegistry.ScanFilesSynchronous(pakContent, true);
After that, my code which normally loads assets fails (static meshes with textures).
I built Unreal Engine from the sources in debug, to be able to build and package my app from this build, to finally debug Unreal Engine when running my packaged app, and see what happens in ScanFilesSynchronous (the reason being that we can’t debug the loading of pak files in editor mode, neither by attaching Visual Studio to a packaged app by loading the UE debug symbols provided with its installer, which don’t allow to debug packaged builds in depth).
Then I tried to understand where it blocks and what Unreal Engine needs, but I am quite lost. I compared by enabling/disabling “use iostore”. UE finds the files, but at some point, with “use io store”, there seems to be a problem with the “uasset” extension which can’t be identified in FPackageName::DoesPackageExistEx (even if the files in the originally passed list have the uasset extension). I am not sure if this extension problem prevents the completion of the loading process but it might be.
So my question is:
Does anyone know if “use io store” can be enabled in an application that has to load external pak files?