Yes, the PrimaryAssetLabel that you are using to label assets in its directory is supposed to show up in the same loop, and yes, all of the assets in its directory should be reported in the “Directory” bundle of the BundleMap found for it in CachedAssetBundles.
No, setting the PrimaryAssetLabel to always cook does not make a difference here. PrimaryAssets have three jobs, and can be configured to do some or none of those jobs: (1) Add assets to be cooked (2) Prevent assets from being cooked (3) Set the chunk of assets that were cooked. Setting the PrimaryAssetLabel to AlwaysCook affects (1), it does not impact (3).
Next thread to follow: The map’s LongPackageName is present in AssetPackagesReferenced; which ManagerMap does it get put into? One of the maps in PriorityManagementMap? Allow the function to continue down to the call to AssetRegistry.SetManageReferences for that map down below. Before SetManageReferences is called for it, set a breakpoint in your ShouldSetManager function. Turn off optimizations via UE_DISABLE_OPTIMIZATION at the top of your file to avoid possible inlining from the compiler that could cause your breakpoint to be missed.
You should turn off optimizations in Engine\Source\Runtime\Engine\Private\AssetManager.cpp and Engine\Source\Runtime\AssetRegistry\Private\AssetRegistry.cpp as well as your own AssetManager file, to make it easy to inspect data in the debugger.
Add instrumentation to your ShouldSetManager function:
static FName LocalMapTypeName(TEXT("Map"));
if (Manager.PrimaryAssetType.GetName() == LocalMapTypeName)
{
static volatile int HitBreakPoint = 0; ++HitBreakPoint;
}
Put a breakpoint on the HitBreakPoint line.
Does ShouldSetManager get called with your map as Manager during that call to SetManageReferences? (Manager.PrimaryAssetType.Name == “Map”, Manager.ObjectName == “<YourMapName>”). Does it get called with Target.PackageName == <YourMapName> (called with it’s own name)? That should be the first call to ShouldSetManager that occurs with Manager.ObjectName == “<YourMapName>”. What value does the ShouldSetManager function return for that combination of Manager and Target? Up the callstack should be a lambda function from FAssetRegistryImpl::SetManageReferences, this will be the lambda named auto IterateFunction, but I don’t think the debugger shows that name. After it gets the EAssetSetManagerResult::Type Result from ShouldSetManager, does it call NodesToManage.Add(TargetNode, ManageProperties)?
Assuming it reaches that far, we can probably assume without need for verification that it calls ManagerNode->AddDependency with that manager and packagename, down below on line 8766. We should then add instrumentation at the end of UpdateManagementDatabase to verify that that dependency is present:
FAssetIdentifier MapPackageAssetId(FName(TEXT("<YourMapLongPackageName>")), NAME_None);
TArray<FAssetIdentifier> LocalReferencers;
AssetRegistry.GetReferencers(MapPackageAssetId, LocalReferencers, UE::AssetRegistry::EDependencyCategory::Manage);
UE_LOG(LogAssetManager, Display, TEXT("%s has %d referencers:"), *MapPackageAssetId.PackageName.ToString(), LocalReferencers.Num());
for (FAssetIdentifier& ManageId : LocalReferencers)
{
UE_LOG(LogAssetManager, Display, TEXT("Referencer of %s: %s"), *MapPackageAssetId.PackageName.ToString(), *ManageId.ToString());
}
static volatile int HitBreakPoint = 0; ++HitBreakPoint;
I tested that on Lyra at head with <YourMapLongPackageName> == /TopDownArena/Maps/L_TopDown_LocalMultiplayer, and got this output:
[2026.08.05-12.51.10:711][ 0]LogAssetManager: Display: /TopDownArena/Maps/L_TopDown_LocalMultiplayer has 2 referencers:
[2026.08.05-12.51.10:713][ 0]LogAssetManager: Display: Referencer of /TopDownArena/Maps/L_TopDown_LocalMultiplayer: Map:/TopDownArena/Maps/L_TopDown_LocalMultiplayer
[2026.08.05-12.51.10:713][ 0]LogAssetManager: Display: Referencer of /TopDownArena/Maps/L_TopDown_LocalMultiplayer: PrimaryAssetLabel:TopDownArena_Label
That is the data that is supposed to be read during GetPackageManagers.
Does it show any entries for your map at the end of UpdateManagementDatabase?
If so, add it as well to GetPackageManagers, which is called at end of cook. Does it still show the same entries at that point?
[Attachment Removed]