How to package the project to multiple pak files with chunks?

Hi,

currently we package our project manually with UnrealPak.exe to be able to split the package files. We want to change that to use the internal packaging functionality. Therefore I tried Primary Asset Labels in a new project. The Audit Assets tool correctly marked the assets with the chunk ID but when I package the project it is not splittet at all.

What I’m doing wrong?

Steps to Reproduce

  • Start the project
  • Package it for Windows
  • look at the pak files -> only packchunk0 is there

Hi [mention removed]​,

In your case, you’re missing the step of setting bIsRuntimeLabel to true. If enabled, the label assets will be included in the cooked/packaged build and will be accessible at runtime. If it’s set to false, the label will still be used during cooking to drive chunking or cooking decisions, but it won’t be packaged for runtime use.

To fragment chunks into different packages, you can achieve this either with Primary Asset Labels (as you’re doing) or by configuring the required information in

Project Settings → Game → Asset Manager. Unreal Engine provides multiple ways to manage chunking information.

I did a build with your project and in my case it was generating correctly the two .pak files inside Test_Chunks/Content/Paks, and it generated the pakchunk0.pak and the pakchunk123.pak. Let me know if it worked for you.

Best,

Joan

Extra: Summary of what you need to integrate chunking into your build:

  • Enable “Use Pak File” and “Generate Chunks.”

  • The engine will search for Primary Asset Types. The Asset Manager scans and tracks these types. You can then create Primary Asset Rules for each Primary Asset ID, specifying the Chunk ID, Cook Rule, and other convenient options.

  • You can also generate chunks using Primary Asset Labels, as you did.In these labels, you can list explicit assets, collections, or directories, along with their Chunk ID, Priority, and Cook Rule.Make sure to enable IsRuntimeLabel for runtime applications, it must be enabled for the label to affect packaging.

  • (Optional) For debugging purposes, Unreal provides tools like the Asset Audit and Reference Viewer. These tools let you inspect .pak files, check which assets are referenced by each chunk, and view the contents of individual chunks.

Hey,

Just to clarify the reason why the chunks were not generated in this case:

As you already noted and as Joan correctly stated, the chunk assignment itself is working correctly.

However, for an asset to be included in the cook it there also needs to be a dependency that pulls it into the cook from something that’s already included/cooked by default.

The default assets included in a cook are mostly determined by the startup maps and the project settings.

PrimaryAssetLabels do labeling by default, but do not count as a runtime dependency.

See the Project Settings > Game > AssetManager > Primary Asset Types to Scan settings, which configure the default behavior for maps and PrimaryAssetLabels.

Both have the Is Editor Only checkbox set, which makes them not create dependencies, ignoring the cook rule.

By setting bIsRuntimeLabel on the label you are adding them to the cook and thus they will also pull in any of their dependencies.

There’s other options that would not require you to modify individual labels and include them in the package:

  • Disable Is Editor Only for asset labels in the Asset Manager settings
  • If you want to include your chunked content regardless of whether there are dependencies on its assets you can add folders to the Project Setttings > Packaging > Additional Asset Directories to Cook.

Kind Regards,

Sebastian

Thank you, that helped a lot!

Happy to help Mathias! Feel free to open again the thread if needed :blush: