x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Map from .pak file loads but no meshes/materials

Hi everyone!

I've been working on this for a few days and I finally have it to a place where I think I'm close to it working. I'm trying to build a system which allows a user to download a .pak file from a server (this part is working) and launch a level from it in the game. Each .pak file is essentially a packaged level. Everything is working and I finally made it so that i can open console and type open minimal_default and it will load the level. (I have created a pak file from a blank project with starter content following these instructions)

The level loads, but none of the meshes or materials load, it's just an empty map. When I check the logs, I get this message repeated for each asset.

 LogStreaming: Error: Couldn't find file for package /Game/StarterContent/Props/SM_TableRound requested by async loading code. NameToLoad: /Game/StarterContent/Props/SM_TableRound
 LogStreaming: Error: Found 1 dependent packages...
 LogStreaming: Error:   /Engine/LevelTest/Content/StarterContent/Maps/Minimal_Default

My Code: This is the code I'm using the mount the pak file.

 UE_LOG(LogTemp, Log, TEXT("MountPak(%s)"), *FullFilePath);

 // get mod UID
 FString PathPart, FilePart, ExtPart;
 FPaths::Split(FullFilePath, PathPart, FilePart, ExtPart);
 FString PathPart2, ModUID, ExtPart2;
 FPaths::Split(PathPart, PathPart2, ModUID, ExtPart2);
 UE_LOG(LogTemp, Log, TEXT("ModUID=%s"), *ModUID);

 IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
 FPakPlatformFile* PakPlatform = new FPakPlatformFile();
 PakPlatform->Initialize(&PlatformFile, TEXT(""));
 FPlatformFileManager::Get().SetPlatformFile(*PakPlatform);

 if (PakPlatform->Mount(*FullFilePath, 0, *(FPaths::EngineContentDir()))) {
     UE_LOG(LogTemp, Log, TEXT("Successfully mounted %s at %s"), *FullFilePath, *FPaths::EngineContentDir());
 }
 else
 {
     UE_LOG(LogTemp, Warning, TEXT("Failed to mount %s"), *FullFilePath);
 }
Product Version: UE 4.17
Tags:
more ▼

asked May 01 '18 at 04:34 PM in Packaging & Deployment

avatar image

TestyRabbit
346 7 6 13

avatar image StrangerGwenn Nov 12 '18 at 12:37 PM

Subscribing to this topic. Did you ever find a working solution ?

avatar image TestyRabbit Nov 12 '18 at 04:19 PM

Sort of. So I was unable to get it to mount and work while the game was running, so I opted to just force the user to restart the game to get the new content. That's easy and done by just storing the pak file in FPaths::GameContentDir()/Paks/ (can be in any subdirectory of the Paks folder). Then when the game starts it automatically pulls in all the content from every pak file in there.

avatar image StrangerGwenn Nov 12 '18 at 07:00 PM

We haven't even been able to get that to work. The PAK is mounted automatically like you mention, but the asset registry fails to discover the additional content. We're pretty much at loss here.

avatar image TestyRabbit Nov 12 '18 at 07:34 PM

How are you generating your pakfiles? The only way I was really able to get it to works was to have any extra content as a plugin for my game. Then I would build the entire project so that it would add the .uplugin file to the game's .pak, and then I'd take all the content from that plugin and put it in it's own pak.

When a pak is generated, it creates a paklist.txt file that has a list of all of the content in the game. It became a pretty manual process but I would basically build the entire game including the plugins, then go into that paklist.txt, and separate the list into different paklists that I made myself. The first paklist would be for the main game's content, including everything not in the plugins except for their .plugin files.

So say I have a game with a plugin called DLC that I want to be my DLC content. I would build the entire project, which would generate a file called something like Paklist_Project-WindowsNoEditor.txt. That file would contain the following (it's more complex than this but this will get the point across):

  • MainLevel.umap

  • Character.uasset

  • DLC.uplugin

  • DLC/dlcmap.umap

I would separate this file into two different paklists. Game-Paklist.txt would contain:

  • MainLevel.umap

  • Character.uasset

  • DLC.uplugin

And DLC-Paklist.txt would contain:

  • DLC/dlcmap.umap

Then, using the command line tool for pakfile creation (UnrealPak.exe), I would create two .pak files using each of these new lists with the following commands:

  • UnrealPak.exe Project-WindowsNoEditor.pak -Create=Game-Paklist.txt

  • UnrealPak.exe DLC.pak -Create=DLC-Paklist.txt

(I recommend automating this process with a script as it can be annoying to do manually) I could then load DLC.pak and its contents inside of my game.

I believe the PakList file is stored in {EngineDir}\Programs\AutomationTool\Saved\Logs, and it should be called something like Paklist_Project-WindowsNoEditor.txt.

avatar image StrangerGwenn Nov 12 '18 at 08:02 PM

We've just tried to follow Tom Looman's tutorial and build a PAK file as DLC. I'm very sure the PAK actually has the assets (I've dumped the contents), and no error is provided by the engine after mounting.

avatar image TestyRabbit Nov 12 '18 at 08:14 PM

I tried following that as well and this was the only way I actually got it to work. He wrote that for 4.9 and it's possible something has changed since then.

avatar image StrangerGwenn Nov 12 '18 at 08:40 PM

Well, thanks !

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question