When Game Feature Data assets are loaded as part of the Registering step in the game feature state machine used by Lyra and other games, they register themselves by calling AddGameFeatureToAssetManager. This adds that asset to the list of specific primary assets for the GameFeatureData asset type. However, it does not add this information to the list of assets to scan for in the future. If you follow the repro steps, FAssetManagerEditorModule::OnMarkPackageDirty will call InvalidatePrimaryAssetDirectory which tells the asset manager that it needs to rescan assets. Then, if you start PIE it will call RefreshPrimaryAssetDirectory which will rescan assets but incorrectly loses track of the game feature data assets that were added during feature registration. This will cause gameplay problems if the game feature assets need to be looked up later. It also breaks the list in the editor as shown in the Asset Audit window in the repro steps.

This issue is related to [Link Removed], but it is triggered by editing an asset instead of modifying the asset manager settings and does not clear as many settings. Modifying the asset manager settings as described in that bug will also incorrectly clear the list of registered Game Feature Data assets as described in this bug.

Steps to Reproduce
  1. Compile and load Lyra in the editor with the default map
  2. Open the Tools->Audit->Asset Audit window
  3. Click "Add Primary Asset Type" and select Game Feature Data. It should add multiple assets to the list below
  4. Press Clear Assets to clear that list
  5. Open the /Game/System/FrontEnd/B_LyraFrontEnd_Experience blueprint for editing
  6. Press + next to ActionSets to make a change that dirties the blueprint, adding * to the toolbar
  7. Press Play in the level editor toolbar to start a PIE session, it shouldn't matter what options are selected
  8. Go back to the Asset Audit window, click "Add Primary Asset Type" and select Game Feature Data again

Expected Behavior:
The asset audit window should show the same list of game feature datas that you saw in step 3

Actual Behavior:
The asset audit window will incorrectly be empty because it lost track of the game feature data assets

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-197391 in the post.

Login to Vote

ComponentUE - Gameplay
Target Fix5.4
Fix Commit28880889
Main Commit28880984
CreatedOct 6, 2023
ResolvedOct 18, 2023
UpdatedNov 4, 2023
View Jira Issue