Skip to content

Emit one export bundle per package for UE4.26/4.27 containers - #69

Open
Desaigy wants to merge 1 commit into
trumank:masterfrom
Desaigy:bundle-per-package
Open

Emit one export bundle per package for UE4.26/4.27 containers#69
Desaigy wants to merge 1 commit into
trumank:masterfrom
Desaigy:bundle-per-package

Conversation

@Desaigy

@Desaigy Desaigy commented Aug 6, 2026

Copy link
Copy Markdown

build_zen_dependency_bundles_legacy closes the current export bundle at every public export. For container header versions after Initial that matches the per-package Package Store Optimizer, but UE4.26/4.27 packages are not cooked that way: Epic's cooker computes a single global load order across every package in the cook and only closes a bundle when that walk moves on to a different package (IoStoreUtilities.cpp, BuildBundles). A package is therefore split only when another package's nodes interleave into the middle of its run, which in practice does not happen.

Splitting at public exports instead yields two or more bundles per package, a layout the engine never produces for this target. Surveying five shipped UE4.26 mod containers, every package in all of them has exactly one export bundle; to-zen produced two for 138 of 140 packages of the same content, and eight for the skeletal mesh.

The visible symptom is that mods built by to-zen load and render correctly, but the game then hangs forever inside FlushAsyncLoading once anything from the container has been loaded - exiting to the title screen, or loading a save - with no crash, no dump and nothing in the log. This was observed with plugin mods that introduce new packages; the bundle layout is built per package, so replacer containers should be affected the same way, but that was not tested.

Gated on container_header_version so only UE4.26/4.27 output changes.

Verified on FF7 Rebirth 1.004: nine plugin mods that reproducibly hung on exit to title are clean after this change, across eight test runs covering every affected character. Three further mods built with the fix already in place behave the same, for eleven working plugin mods in total.

`build_zen_dependency_bundles_legacy` closes the current export bundle at
every public export. For container header versions after Initial that
matches the per-package Package Store Optimizer, but UE4.26/4.27 packages
are not cooked that way: Epic's cooker computes a single global load order
across every package in the cook and only closes a bundle when that walk
moves on to a different package (IoStoreUtilities.cpp, BuildBundles). A
package is therefore split only when another package's nodes interleave
into the middle of its run, which in practice does not happen.

Splitting at public exports instead yields two or more bundles per package,
a layout the engine never produces for this target. Surveying five shipped
UE4.26 mod containers, every package in all of them has exactly one export
bundle; to-zen produced two for 138 of 140 packages of the same content,
and eight for the skeletal mesh.

The visible symptom is that mods built by to-zen load and render correctly,
but the game then hangs forever inside FlushAsyncLoading once anything from
the container has been loaded - exiting to the title screen, or loading a
save - with no crash, no dump and nothing in the log. This was observed
with plugin mods that introduce new packages; the bundle layout is built
per package, so replacer containers should be affected the same way, but
that was not tested.

Gated on container_header_version so only UE4.26/4.27 output changes.

Verified on FF7 Rebirth 1.004: nine plugin mods that reproducibly hung on
exit to title are clean after this change, across eight test runs covering
every affected character. Three further mods built with the fix already in
place behave the same, for eleven working plugin mods in total.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant