Chunk in package are not the same as in Editor

Hello,

My goal is to create a chunk 1 with all BP code inside it. So code will be inside the chunk 1, and all the rest in other chunks.
I failed to make it. Almost 90% of BP code is in chunk 0 no matter what I do at the end of the packaging process.

Same issue without solution :

Same issue with solution but not working for me :

In my project, inside “Audit Asset” window I have this issue :

  • Editor version : Everything is ordered like I told them to
  • Packaged version : A lot of assets assigned to 1+ chunks are set in the chunk0.

You can see the configuration of my project below :



I’m facing a wall on this subject. I spent more than 50 hours searching a reason why it’s not working or trying to succeed with different configurations. But still, my assets are not all chunked inside the one I configured.

Explanations :

I have a code folder in which all my Blueprints code are. C++ code is in different modules. All BP Code is independant of all other content of the game. (It does not use any other asset out of his code folder)

Inside our solution we deliver 100+ different Packages. Each of them have different 3D assets and maps but the same code base.

With this setup : with C++ dlls and this chunk 1, I could replace any chunk1 of any package without require to repackage all from scratch. (with all 3D assets and maps)

Since I failed, I though, I could instead create a chunk 2 with all game 3D Assets and maps inside it.
So code will be in 0, and 3D assets & maps in another chunk. If I package a code version in chunk0 an repalce it inside a full packaged game, It should work. But this cause 2 issues :

  • Unreal put some engine content from the packaging referencences inside Chunk 0. So When I package a map, chunk 0 will contains some assets this map use. If I replace this Chunk0 by a “Code Chunk0”, then it will lose some engine references for this map.
  • And I also failed to make all 3D assets and maps inside Chunk 2. 1% of them are still in chunk 0. So chunk2 is not complete. If Chunk 0 is ereased by a code version, 1% of the 3D assets and maps will not be present anymore.

As you can see in the screen above, the code has a lot of inter dependencies. But they are all kept inside code folder itself. All of them should be in chunk1.

I tried all of this :

  • Make a new project with multiple depencencies inside each BP code folders, try to package with chunk => All working good
  • Try to chunk with direct AssetBaseClass (Blueprint, for example), with Specific Assets listed, with or without Recursively, with multiple PrimaryAssetLabel, etc. Nothing changed in the end.
  • I tried to find C++ source code where the chunk number is assigned. I found some, but they are never triggered during packaging process :

So I have no other solution left. Iterating through the C++ code with break points could allow me to understand why it’s a 0 and not one, but it’s never triggered, and I don’t know why. Maybe you do ?

Thank’s you

I finally discovered why almost all of my Blueprints (BPs) were packaged inside chunk 0, even though I had set them up to be in chunk 1.

In Unreal Editor’s Debug mode (accessible only from the source code), when we package, a comprehensive log is generated in the engine folder: UnrealEngine-5.2\Engine\Programs\AutomationTool\Saved\Logs\. The log file’s name, for example, might be Cook-2023.08.02-12.47.55.txt.

By activating the “log LogCook Verbose” command, we gain access to logs like this:

LogCook: Verbose: Cooker startup package /UI/Settings/UI_16-9_DPI_Curve

This information comes from the class UCookOnTheFlyServer::Initialize. Notably, all “Startup packages” are assigned to chunk 0 by default, as observed in the engine’s source code.

Packages are designated as Startup packages when they are part of the constructor of a C++ class. Although there might be other reasons, in my case, it was due to this specific factor.

Several Blueprints were located within the constructors of multiple C++ classes. And since my BPs have multiple inter dependencies, all were being linked as “Startup packages.”

The issue was resolved by removing them from the C++ constructors. In hindsight, delving deeper into the engine’s source code would have led me to this solution more quickly!

Also, It seems we are not able to use VS break points in function : FAssetRegistryGenerator::GenerateAssetChunkInformationCSV
(even with Debug Editor in code source) since it seems to be ran by another process during cooking.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.