ue-data-assets-tables

Use when working with DataAsset, DataTable, soft reference, hard reference, TSoftObjectPtr, async loading, Asset Manager, StreamableManager, or game data structures in Unreal Engine. See references/asset-loading-patterns.md for async loading and StreamableManager patterns. See references/data-driven

By quodsoler · 845 installs

npx skills add quodsoler/unreal-engine-skills --skill ue-data-assets-tables

Source repository · Upstream listing

UE Data Assets and Tables You are an expert in Unreal Engine's data management and asset loading systems. Context Read .agents/ue project context.md for project specific data patterns, module layout, plugin dependencies, and any custom AssetManager subclass or DataAsset conventions the project has established. Information Gathering Before generating code or advice, ask: 1. What kind of data is being stored? (item stats, level config, ability definitions, NPC data, etc.) 2. Is this data authored by designers in spreadsheets, or configured directly in the editor? 3. What are the loading requirements — always in memory, loaded per level, streamed on demand? 4. Is memory budget a concern? How many instances are expected? 5. Does the project already use a custom UAssetManager subclass? Core Framework DataAssets vs DataTables — Choosing the Right Tool Concern DataAsset DataTable Structure C++ class with typed UPROPERTY fields Row struct, all rows same shape Designer workflow Editor authored instances, picker UI Spreadsheet import (CSV/JSON) Hierarchy / inheritance Yes, via Blueprint subclasses No Asset Manager integration Yes ( UPrimaryDataAsset ) Not directly Bulk lookup by row name No Yes ( FindRow ) Best for Per item config objects Large flat tables (loot, dialogue, XP curves) DataAssets UDataAsset — Simple Configuration Objects UDataAsset (declared in Engine/DataAsset.h ) is the base class. Assets are only loaded when directly referenced or explicitly loaded. Subclass it with typed UPROPERTY fields: In the editor: right click in Content Browser Miscellaneous Data Asset, select UMyItemData . UPrimaryDataAsset — Asset Manager Integration UPrimaryDataAsset overrides GetPrimaryAssetId() so the Asset Manager can track, scan, and load it. The Primary Asset Type is derived from the first native class in the hierarchy. DataTables Defining a Row Struct FTableRowBase is declared in Engine/DataTable.h . Every row struct must inherit it and use USTRUCT(BlueprintType) . In the editor: right click Miscellaneous Data Table, assign FItemTableRow as the row struct. Querying DataTables at Runtime Runtime Modification and Row Handles Asset References Hard References Use hard references only for assets that are always needed while this object exists (e.g., a character's skeleton). Soft References Soft references store a path string. The asset is NOT loaded until explicitly resolved. Synchronous Resolution (avoid on game thread for large assets) Checking State Without Loading Async Loading FStreamableManager FStreamableManager is declared in Engine/StreamableManager.h . Access it via UAssetManager::GetStreamableManager() . RequestAsyncLoad — Single Asset RequestAsyncLoad — Multiple Assets FStreamableHandle State and Control Priority: pass higher values to RequestAsyncLoad for urgent loads (default is 0). Use AsyncLoadHighPriority (100) from StreamableManager.h for gameplay critical assets. FStreamableManager also provides RequestSyncLoad() for synchronous loading when the asset is needed immediately (e.g., during initialization). Prefer async for gameplay to avoid stalling the game thread. Asset Manager Setup — DefaultGame.ini Custom AssetManager Subclass Subclass UAssetManager , override StartInitialLoading() for startup logic, register in DefaultEngine.ini : Loading Primary Assets Asset Bundles Bundles group soft references for selective loading. Decorate UPROPERTY fields with meta = (AssetBundles = "BundleName") . The Asset Manager will load only the requested bundle's assets. Asset Registry IAssetRegistry allows querying asset metadata without loading assets. Access it via IAssetRegistry::GetChecked() or FAssetRegistryModule::GetRegistry() . Making Properties Searchable Common Mistakes and Anti Patterns Hard Referencing Everything Loading on the Game Thread Forgetting to Keep the Handle Alive Not Registering Primary Asset Types If a UPrimaryDataAsset subclass is not listed under PrimaryAssetTypesToScan in DefaultGame.ini , GetPrimaryAssetIdList returns nothing and LoadPrimaryAsset silently fails. Circular Soft Reference Resolution Resolving a soft reference that itself holds soft references that point back creates load cycles. Use Asset Bundles to break cycles — load only the bundle that is needed for the current state. DataTable Column Changes with Existing Data Adding a column to an existing DataTable struct invalidates serialized row data unless bPreserveExistingValues is set on the table or you re import. Removing a column causes all existing rows to lose that data. Always back up DataTable assets before struct changes in production. Edge Cases Cooked vs uncooked paths : In uncooked builds, paths use /Game/ . Cooked paths differ — do not hard code paths; use FSoftObjectPath from UPROPERTY references. Asset Manager and cook : Assets not reachable through Primary Asset scanning rules or hard references will be excluded from the cook. Use PrimaryAssetRules or explicit asset labels to ensure inclusion. Hot reload : UDataAsset changes during PIE (Play In Editor) may not reflect until the asset is fully reloaded. Use PostLoad or PostEditChangeProperty for editor time updates. Memory budgets : Track loaded assets by type via UAssetManager::GetPrimaryAssetObjectList . Use ChangeBundleStateForPrimaryAssets to swap between UI and Game bundles as scenes change. bStripFromClientBuilds : Set this on UDataTable instances that contain server only data (e.g., loot tables with drop rates) to prevent distribution to clients. Related Skills ue cpp foundations — UPROPERTY specifiers, USTRUCT, UObject lifecycle ue serialization savegames — saving and loading soft object references across sessions ue module build system — adding AssetRegistry , Engine module dependencies to Build.cs