# Chunk in package are not the same as in Editor

**URL:** <https://forums.unrealengine.com/t/chunk-in-package-are-not-the-same-as-in-editor/1183429>\
**Category:** Platform & Builds\
**Tags:** unreal-engine, editor, question\
**Created:** [May 30, 2023, 1:45pm UTC](https://forums.unrealengine.com/t/chunk-in-package-are-not-the-same-as-in-editor/1183429 "2023-05-30T13:45:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A.RADIX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@A.RADIX](https://forums.unrealengine.com/u/A.RADIX)\
**Post date:** [May 30, 2023, 1:45pm UTC](https://forums.unrealengine.com/t/chunk-in-package-are-not-the-same-as-in-editor/1183429/1 "2023-05-30T13:45:23Z")

</div>

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.

 ![2023_05_30_13h19m33](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/3/1d356520b26d57a7ab63b3d8f3f13457577293e6.png)

Same issue without solution :

- [Segregating paks](https://forums.unrealengine.com/t/segregating-paks/516915)
- [UE5 primary assets set for separate pak files do not get made](https://forums.unrealengine.com/t/ue5-primary-assets-set-for-separate-pak-files-do-not-get-made/522375)
- [Getting assets pulled into chunk0](https://forums.unrealengine.com/t/getting-assets-pulled-into-chunk0/438196)

Same issue with solution but not working for me :

- [Chunks are not working on WindowsNoEditor - #4 by KuzbassCOT](https://forums.unrealengine.com/t/chunks-are-not-working-on-windowsnoeditor/243733/4)
- [Only 1 PAK Chunk is generated when packaged](https://forums.unrealengine.com/t/only-1-pak-chunk-is-generated-when-packaged/451164) (was using wrong PAL)

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 :

 ![2023_05_29_17h24m02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/6/296121ba29d768be86ab8b2ac61dda3c8e6bd0d5.png)  
 ![2023_05_30_14h00m03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/3/d939e9b0810c5bf84527e2fafe3ef296f89bad8b.png)  
 ![2023_05_30_13h59m50](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/b/a7b0fa571b69d745878b8309b6341cc4c798c8fc.png)

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 :

 ![2023_05_30_10h45m00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/c/dbcf231b99d9aaab1742cfb77a89e040eb3f504b.png)

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

---

<div class="post-metadata">

**Author:** ![A.RADIX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@A.RADIX](https://forums.unrealengine.com/u/A.RADIX)\
**Post date:** [August 7, 2023, 11:36am UTC](https://forums.unrealengine.com/t/chunk-in-package-are-not-the-same-as-in-editor/1183429/2 "2023-08-07T11:36:36Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 6, 2023, 11:36am UTC](https://forums.unrealengine.com/t/chunk-in-package-are-not-the-same-as-in-editor/1183429/3 "2023-09-06T11:36:48Z")

</div>

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