claude-code-arcane 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +54 -6
  3. package/agents/game/ue-blueprint-specialist.md +125 -0
  4. package/agents/game/ue-gas-specialist.md +133 -0
  5. package/agents/game/ue-umg-specialist.md +131 -0
  6. package/dist/cli.js +5 -0
  7. package/docs/SKILLS-CATALOG.md +42 -3
  8. package/docs/USER-GUIDE.md +2 -2
  9. package/hooks/detect-unreal.sh +90 -0
  10. package/package.json +1 -1
  11. package/profiles/unreal-dev.yaml +97 -0
  12. package/rules/gamedev/unreal-code.md +125 -0
  13. package/skills/install-mcp/SKILL.md +135 -46
  14. package/skills/install-mcp/references/unreal-operations.md +55 -0
  15. package/skills/ue-actor-component-architecture/SKILL.md +509 -0
  16. package/skills/ue-actor-component-architecture/references/actor-lifecycle.md +301 -0
  17. package/skills/ue-actor-component-architecture/references/component-types.md +592 -0
  18. package/skills/ue-ai-navigation/SKILL.md +526 -0
  19. package/skills/ue-ai-navigation/references/behavior-tree-patterns.md +392 -0
  20. package/skills/ue-ai-navigation/references/behavior-tree-workflow.md +107 -0
  21. package/skills/ue-ai-navigation/references/custom-bttask.md +104 -0
  22. package/skills/ue-ai-navigation/references/eqs-reference.md +423 -0
  23. package/skills/ue-animation-system/SKILL.md +521 -0
  24. package/skills/ue-animation-system/references/anim-notify-reference.md +486 -0
  25. package/skills/ue-animation-system/references/locomotion-setup.md +550 -0
  26. package/skills/ue-async-threading/SKILL.md +433 -0
  27. package/skills/ue-async-threading/references/thread-safety-guide.md +213 -0
  28. package/skills/ue-async-threading/references/threading-patterns.md +345 -0
  29. package/skills/ue-audio-system/SKILL.md +527 -0
  30. package/skills/ue-audio-system/references/audio-setup-patterns.md +700 -0
  31. package/skills/ue-blueprints/SKILL.md +134 -0
  32. package/skills/ue-blueprints/references/communication.md +82 -0
  33. package/skills/ue-character-movement/SKILL.md +475 -0
  34. package/skills/ue-character-movement/references/cmc-extension-patterns.md +335 -0
  35. package/skills/ue-character-movement/references/movement-pipeline.md +189 -0
  36. package/skills/ue-cpp-foundations/SKILL.md +533 -0
  37. package/skills/ue-cpp-foundations/references/components-and-gc.md +107 -0
  38. package/skills/ue-cpp-foundations/references/container-patterns.md +544 -0
  39. package/skills/ue-cpp-foundations/references/delegate-patterns.md +497 -0
  40. package/skills/ue-cpp-foundations/references/gameplay-classes-cpp.md +136 -0
  41. package/skills/ue-cpp-foundations/references/property-specifiers.md +306 -0
  42. package/skills/ue-data-assets-tables/SKILL.md +527 -0
  43. package/skills/ue-data-assets-tables/references/asset-loading-patterns.md +306 -0
  44. package/skills/ue-data-assets-tables/references/data-driven-design.md +378 -0
  45. package/skills/ue-editor-tools/SKILL.md +523 -0
  46. package/skills/ue-editor-tools/references/detail-customization-patterns.md +395 -0
  47. package/skills/ue-editor-tools/references/editor-module-setup.md +480 -0
  48. package/skills/ue-game-features/SKILL.md +477 -0
  49. package/skills/ue-game-features/references/experience-system.md +222 -0
  50. package/skills/ue-game-features/references/game-feature-patterns.md +308 -0
  51. package/skills/ue-gameplay-abilities/SKILL.md +518 -0
  52. package/skills/ue-gameplay-abilities/references/ability-task-reference.md +391 -0
  53. package/skills/ue-gameplay-abilities/references/gameplay-effect-reference.md +397 -0
  54. package/skills/ue-gameplay-abilities/references/gas-setup-patterns.md +369 -0
  55. package/skills/ue-gameplay-framework/SKILL.md +466 -0
  56. package/skills/ue-gameplay-framework/references/framework-class-map.md +243 -0
  57. package/skills/ue-input-system/SKILL.md +394 -0
  58. package/skills/ue-input-system/references/cpp-setup.md +131 -0
  59. package/skills/ue-input-system/references/enhanced-input-workflow.md +117 -0
  60. package/skills/ue-input-system/references/input-action-reference.md +731 -0
  61. package/skills/ue-mass-entity/SKILL.md +476 -0
  62. package/skills/ue-mass-entity/references/mass-entity-patterns.md +319 -0
  63. package/skills/ue-mass-entity/references/mass-fragment-reference.md +119 -0
  64. package/skills/ue-materials-rendering/SKILL.md +526 -0
  65. package/skills/ue-materials-rendering/references/material-parameter-reference.md +216 -0
  66. package/skills/ue-materials-rendering/references/post-process-settings.md +383 -0
  67. package/skills/ue-module-build-system/SKILL.md +487 -0
  68. package/skills/ue-module-build-system/references/build-cs-reference.md +418 -0
  69. package/skills/ue-module-build-system/references/common-build-errors.md +381 -0
  70. package/skills/ue-naming-conventions/SKILL.md +142 -0
  71. package/skills/ue-naming-conventions/references/asset-name-modifiers.md +233 -0
  72. package/skills/ue-naming-conventions/references/content-structure.md +83 -0
  73. package/skills/ue-networking-replication/SKILL.md +452 -0
  74. package/skills/ue-networking-replication/references/replication-patterns.md +526 -0
  75. package/skills/ue-networking-replication/references/rpc-decision-guide.md +393 -0
  76. package/skills/ue-niagara-effects/SKILL.md +531 -0
  77. package/skills/ue-niagara-effects/references/niagara-data-interfaces.md +491 -0
  78. package/skills/ue-niagara-effects/references/niagara-parameter-types.md +153 -0
  79. package/skills/ue-niagara-effects/references/niagara-workflow.md +115 -0
  80. package/skills/ue-packaging/SKILL.md +116 -0
  81. package/skills/ue-physics-collision/SKILL.md +423 -0
  82. package/skills/ue-physics-collision/references/collision-channel-setup.md +218 -0
  83. package/skills/ue-physics-collision/references/trace-patterns.md +499 -0
  84. package/skills/ue-procedural-generation/SKILL.md +505 -0
  85. package/skills/ue-procedural-generation/references/pcg-node-reference.md +381 -0
  86. package/skills/ue-procedural-generation/references/procedural-mesh-patterns.md +940 -0
  87. package/skills/ue-project-context/SKILL.md +305 -0
  88. package/skills/ue-sequencer-cinematics/SKILL.md +506 -0
  89. package/skills/ue-sequencer-cinematics/references/sequencer-patterns.md +629 -0
  90. package/skills/ue-serialization-savegames/SKILL.md +524 -0
  91. package/skills/ue-serialization-savegames/references/save-system-architecture.md +705 -0
  92. package/skills/ue-state-trees/SKILL.md +489 -0
  93. package/skills/ue-state-trees/references/state-tree-mass-integration.md +184 -0
  94. package/skills/ue-state-trees/references/state-tree-patterns.md +321 -0
  95. package/skills/ue-testing-debugging/SKILL.md +520 -0
  96. package/skills/ue-testing-debugging/references/automation-test-patterns.md +387 -0
  97. package/skills/ue-testing-debugging/references/profiling-commands.md +357 -0
  98. package/skills/ue-ui-umg-slate/SKILL.md +431 -0
  99. package/skills/ue-ui-umg-slate/references/common-ui-setup.md +484 -0
  100. package/skills/ue-ui-umg-slate/references/widget-types.md +487 -0
  101. package/skills/ue-world-level-streaming/SKILL.md +518 -0
  102. package/skills/ue-world-level-streaming/references/streaming-patterns.md +414 -0
  103. package/templates/gamedev/unreal-project-context.md +107 -0
@@ -0,0 +1,527 @@
1
+ ---
2
+ name: ue-data-assets-tables
3
+ description: "DataAsset, DataTable, soft references, TSoftObjectPtr, async loading, Asset Manager"
4
+ category: "gamedev"
5
+ argument-hint: "[data type o asset]"
6
+ user-invocable: true
7
+ allowed-tools: Read, Glob, Grep, Bash, Write, Edit
8
+ ---
9
+
10
+ # UE Data Assets and Tables
11
+
12
+ You are an expert in Unreal Engine's data management and asset loading systems.
13
+
14
+ Ask before writing: this skill edits DataAsset and DataTable definitions plus loading code. Propose the change and get approval before using Write or Edit.
15
+
16
+ ---
17
+
18
+ ## Context
19
+
20
+ Read `docs/unreal/project-context.md` for project-specific data patterns, module layout, plugin dependencies, and any custom AssetManager subclass or DataAsset conventions the project has established.
21
+
22
+ ---
23
+
24
+ ## Information Gathering
25
+
26
+ Before generating code or advice, ask:
27
+
28
+ 1. What kind of data is being stored? (item stats, level config, ability definitions, NPC data, etc.)
29
+ 2. Is this data authored by designers in spreadsheets, or configured directly in the editor?
30
+ 3. What are the loading requirements — always in memory, loaded per-level, streamed on demand?
31
+ 4. Is memory budget a concern? How many instances are expected?
32
+ 5. Does the project already use a custom `UAssetManager` subclass?
33
+
34
+ ---
35
+
36
+ ## Core Framework
37
+
38
+ ### DataAssets vs DataTables — Choosing the Right Tool
39
+
40
+ | Concern | DataAsset | DataTable |
41
+ |---|---|---|
42
+ | Structure | C++ class with typed UPROPERTY fields | Row struct, all rows same shape |
43
+ | Designer workflow | Editor-authored instances, picker UI | Spreadsheet import (CSV/JSON) |
44
+ | Hierarchy / inheritance | Yes, via Blueprint subclasses | No |
45
+ | Asset Manager integration | Yes (`UPrimaryDataAsset`) | Not directly |
46
+ | Bulk lookup by row name | No | Yes (`FindRow`) |
47
+ | Best for | Per-item config objects | Large flat tables (loot, dialogue, XP curves) |
48
+
49
+ ---
50
+
51
+ ## DataAssets
52
+
53
+ ### UDataAsset — Simple Configuration Objects
54
+
55
+ `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:
56
+
57
+ ```cpp
58
+ UCLASS(BlueprintType)
59
+ class MYGAME_API UMyItemData : public UDataAsset
60
+ {
61
+ GENERATED_BODY()
62
+ public:
63
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item") FText DisplayName;
64
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item") float BaseDamage = 10.f;
65
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item") TSoftObjectPtr<UStaticMesh> Mesh;
66
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Item") TSoftClassPtr<AActor> SpawnClass;
67
+ };
68
+ ```
69
+
70
+ In the editor: right-click in Content Browser > Miscellaneous > Data Asset, select `UMyItemData`.
71
+
72
+ ### UPrimaryDataAsset — Asset Manager Integration
73
+
74
+ `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.
75
+
76
+ ```cpp
77
+ // PrimaryAssetType == native class name; PrimaryAssetName == asset name.
78
+ UCLASS(BlueprintType)
79
+ class MYGAME_API UWeaponDefinition : public UPrimaryDataAsset
80
+ {
81
+ GENERATED_BODY()
82
+ public:
83
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon")
84
+ FText WeaponName;
85
+
86
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon")
87
+ float FireRate = 1.f;
88
+
89
+ // meta = (AssetBundles = "X") groups soft refs for selective AM loading.
90
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon",
91
+ meta = (AssetBundles = "UI"))
92
+ TSoftObjectPtr<UTexture2D> Icon;
93
+
94
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon",
95
+ meta = (AssetBundles = "Game"))
96
+ TSoftObjectPtr<USkeletalMesh> WorldMesh;
97
+ };
98
+ ```
99
+
100
+ ---
101
+
102
+ ## DataTables
103
+
104
+ ### Defining a Row Struct
105
+
106
+ `FTableRowBase` is declared in `Engine/DataTable.h`. Every row struct must inherit it and use `USTRUCT(BlueprintType)`.
107
+
108
+ ```cpp
109
+ // ItemTableRow.h
110
+ #pragma once
111
+ #include "Engine/DataTable.h"
112
+ #include "ItemTableRow.generated.h"
113
+
114
+ USTRUCT(BlueprintType)
115
+ struct FItemTableRow : public FTableRowBase
116
+ {
117
+ GENERATED_BODY()
118
+
119
+ UPROPERTY(EditAnywhere, BlueprintReadWrite)
120
+ FText DisplayName;
121
+
122
+ UPROPERTY(EditAnywhere, BlueprintReadWrite)
123
+ int32 MaxStack = 1;
124
+
125
+ UPROPERTY(EditAnywhere, BlueprintReadWrite)
126
+ float Weight = 0.5f;
127
+
128
+ UPROPERTY(EditAnywhere, BlueprintReadWrite)
129
+ TSoftObjectPtr<UStaticMesh> PreviewMesh;
130
+
131
+ // Called after CSV/JSON import. Override for custom fixups.
132
+ virtual void OnPostDataImport(const UDataTable* InDataTable,
133
+ const FName InRowName,
134
+ TArray<FString>& OutCollectedImportProblems) override;
135
+ };
136
+ ```
137
+
138
+ In the editor: right-click > Miscellaneous > Data Table, assign `FItemTableRow` as the row struct.
139
+
140
+ ### Querying DataTables at Runtime
141
+
142
+ ```cpp
143
+ UPROPERTY(EditDefaultsOnly, Category = "Data")
144
+ TObjectPtr<UDataTable> ItemTable;
145
+
146
+ // FindRow<T>: returns nullptr if row not found or type mismatch.
147
+ const FItemTableRow* Row = ItemTable->FindRow<FItemTableRow>(
148
+ RowName, TEXT("LookupItem"));
149
+
150
+ // GetAllRows<T>: fills array with pointers to all rows.
151
+ TArray<FItemTableRow*> AllRows;
152
+ ItemTable->GetAllRows<FItemTableRow>(TEXT("GetAllItems"), AllRows);
153
+
154
+ // ForeachRow: iterate with row name keys.
155
+ ItemTable->ForeachRow<FItemTableRow>(
156
+ TEXT("ForeachRow"),
157
+ [](const FName& Key, const FItemTableRow& Value)
158
+ {
159
+ UE_LOG(LogTemp, Log, TEXT("Row %s: weight=%.2f"), *Key.ToString(), Value.Weight);
160
+ });
161
+ ```
162
+
163
+ ### Runtime Modification and Row Handles
164
+
165
+ ```cpp
166
+ // AddRow/RemoveRow do not persist to disk.
167
+ FItemTableRow NewRow;
168
+ NewRow.DisplayName = FText::FromString(TEXT("Runtime Sword"));
169
+ ItemTable->AddRow(FName(TEXT("RuntimeSword")), NewRow);
170
+ ItemTable->RemoveRow(FName(TEXT("ObsoleteItem")));
171
+
172
+ // Import from CSV at runtime (RowStruct must be set beforehand).
173
+ TArray<FString> Problems = ItemTable->CreateTableFromCSVString(CsvContent);
174
+
175
+ // Import from JSON at runtime. JSON format uses "RowName" as key with struct fields as properties.
176
+ TArray<FString> JsonProblems = ItemTable->CreateTableFromJSONString(JsonContent);
177
+
178
+ // Export to CSV/JSON strings (WITH_EDITOR only — unavailable in cooked/shipping builds):
179
+ FString CsvOut = ItemTable->GetTableAsCSV();
180
+ FString JsonOut = ItemTable->GetTableAsJSON();
181
+
182
+ // FDataTableRowHandle: a UPROPERTY-friendly typed row reference.
183
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
184
+ FDataTableRowHandle StartingWeaponHandle;
185
+
186
+ const FItemTableRow* Row = StartingWeaponHandle.GetRow<FItemTableRow>(
187
+ TEXT("StartingWeapon lookup"));
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Asset References
193
+
194
+ ### Hard References
195
+
196
+ ```cpp
197
+ // Hard ref: loaded when the referencing asset loads. Causes the mesh/material
198
+ // to be in memory as long as this object is alive.
199
+ UPROPERTY(EditDefaultsOnly, Category = "Art")
200
+ TObjectPtr<UStaticMesh> Mesh; // UE5 TObjectPtr preferred over raw ptr
201
+ ```
202
+
203
+ Use hard references only for assets that are always needed while this object exists (e.g., a character's skeleton).
204
+
205
+ ### Soft References
206
+
207
+ Soft references store a path string. The asset is NOT loaded until explicitly resolved.
208
+
209
+ ```cpp
210
+ // TSoftObjectPtr<T>: soft ref to an asset instance.
211
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Art")
212
+ TSoftObjectPtr<UStaticMesh> MeshSoft;
213
+
214
+ // TSoftClassPtr<T>: soft ref to a class (blueprint subclasses especially).
215
+ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Spawning")
216
+ TSoftClassPtr<AActor> SpawnableSoft;
217
+
218
+ // FSoftObjectPath: untyped path, useful for generic systems.
219
+ FSoftObjectPath MeshPath = MeshSoft.ToSoftObjectPath();
220
+ ```
221
+
222
+ #### Synchronous Resolution (avoid on game thread for large assets)
223
+
224
+ ```cpp
225
+ UStaticMesh* Mesh = MeshSoft.LoadSynchronous(); // Blocks until loaded.
226
+
227
+ // FSoftObjectPath::TryLoad — returns nullptr if not on disk, does not assert.
228
+ UObject* Loaded = MeshPath.TryLoad();
229
+ ```
230
+
231
+ #### Checking State Without Loading
232
+
233
+ ```cpp
234
+ if (MeshSoft.IsNull()) { /* no path set */ }
235
+ if (MeshSoft.IsValid()) { /* path set AND asset is loaded in memory */ }
236
+ if (MeshSoft.IsPending()) { /* path set, async load started, not complete */ }
237
+
238
+ UStaticMesh* MeshPtr = MeshSoft.Get(); // Returns nullptr if not loaded.
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Async Loading
244
+
245
+ ### FStreamableManager
246
+
247
+ `FStreamableManager` is declared in `Engine/StreamableManager.h`. Access it via `UAssetManager::GetStreamableManager()`.
248
+
249
+ ```cpp
250
+ FStreamableManager& SM = UAssetManager::GetStreamableManager();
251
+ ```
252
+
253
+ #### RequestAsyncLoad — Single Asset
254
+
255
+ ```cpp
256
+ void AMyActor::LoadWeaponMeshAsync()
257
+ {
258
+ FStreamableManager& SM = UAssetManager::GetStreamableManager();
259
+
260
+ StreamableHandle = SM.RequestAsyncLoad(
261
+ WeaponMeshSoft.ToSoftObjectPath(),
262
+ FStreamableDelegate::CreateUObject(this, &AMyActor::OnWeaponMeshLoaded));
263
+ }
264
+
265
+ void AMyActor::OnWeaponMeshLoaded()
266
+ {
267
+ if (StreamableHandle.IsValid() && StreamableHandle->HasLoadCompleted())
268
+ {
269
+ UStaticMesh* Mesh = WeaponMeshSoft.Get();
270
+ if (Mesh)
271
+ {
272
+ MeshComponent->SetStaticMesh(Mesh);
273
+ }
274
+ }
275
+ }
276
+
277
+ // Member:
278
+ TSharedPtr<FStreamableHandle> StreamableHandle;
279
+ ```
280
+
281
+ #### RequestAsyncLoad — Multiple Assets
282
+
283
+ ```cpp
284
+ // All paths fire one callback when every asset is loaded.
285
+ TArray<FSoftObjectPath> PathsToLoad = {
286
+ IconSoft.ToSoftObjectPath(), MeshSoft.ToSoftObjectPath() };
287
+ StreamableHandle = SM.RequestAsyncLoad(
288
+ PathsToLoad,
289
+ FStreamableDelegate::CreateLambda([this]()
290
+ {
291
+ // Both guaranteed loaded; IconSoft.Get() and MeshSoft.Get() are valid.
292
+ }));
293
+ ```
294
+
295
+ #### FStreamableHandle State and Control
296
+
297
+ ```cpp
298
+ Handle->HasLoadCompleted(); // true when all assets finished.
299
+ Handle->IsLoadingInProgress();// true while still loading.
300
+ Handle->WasCanceled(); // true if CancelHandle() was called.
301
+ Handle->GetLoadProgress(); // 0.0 to 1.0.
302
+ Handle->WaitUntilComplete(); // blocks game thread — use only on loading screens.
303
+ Handle->ReleaseHandle(); // allow GC of loaded assets.
304
+ ```
305
+
306
+ Priority: pass higher values to `RequestAsyncLoad` for urgent loads (default is 0).
307
+ Use `AsyncLoadHighPriority` (100) from `StreamableManager.h` for gameplay-critical assets.
308
+
309
+ `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.
310
+
311
+ ---
312
+
313
+ ## Asset Manager
314
+
315
+ ### Setup — DefaultGame.ini
316
+
317
+ ```ini
318
+ [/Script/Engine.AssetManagerSettings]
319
+ +PrimaryAssetTypesToScan=(PrimaryAssetType="WeaponDefinition",
320
+ AssetBaseClass=/Script/MyGame.WeaponDefinition,
321
+ bHasBlueprintClasses=False,
322
+ bIsEditorOnly=False,
323
+ Directories=((Path="/Game/Data/Weapons")),
324
+ Rules=(Priority=1,bApplyRecursively=True))
325
+ ```
326
+
327
+ ### Custom AssetManager Subclass
328
+
329
+ Subclass `UAssetManager`, override `StartInitialLoading()` for startup logic, register in `DefaultEngine.ini`:
330
+
331
+ ```ini
332
+ [/Script/Engine.Engine]
333
+ AssetManagerClassName=/Script/MyGame.UMyAssetManager
334
+ ```
335
+
336
+ ### Loading Primary Assets
337
+
338
+ ```cpp
339
+ UAssetManager& AM = UAssetManager::Get();
340
+
341
+ // List all registered IDs of a type.
342
+ TArray<FPrimaryAssetId> WeaponIds;
343
+ AM.GetPrimaryAssetIdList(FPrimaryAssetType(TEXT("WeaponDefinition")), WeaponIds);
344
+
345
+ // Load a single primary asset asynchronously.
346
+ FPrimaryAssetId WeaponId(TEXT("WeaponDefinition"), TEXT("DA_Sword"));
347
+ TSharedPtr<FStreamableHandle> Handle = AM.LoadPrimaryAsset(
348
+ WeaponId,
349
+ TArray<FName>{ TEXT("Game") }, // load "Game" bundle (world mesh, etc.)
350
+ FStreamableDelegate::CreateLambda([WeaponId]()
351
+ {
352
+ UWeaponDefinition* Def = UAssetManager::Get()
353
+ .GetPrimaryAssetObject<UWeaponDefinition>(WeaponId);
354
+ // Use Def...
355
+ }));
356
+
357
+ // Load all assets of a type.
358
+ TSharedPtr<FStreamableHandle> AllHandle = AM.LoadPrimaryAssetsWithType(
359
+ FPrimaryAssetType(TEXT("WeaponDefinition")),
360
+ TArray<FName>{ TEXT("UI") }); // e.g., load only icons.
361
+
362
+ // Unload when no longer needed.
363
+ AM.UnloadPrimaryAsset(WeaponId);
364
+ ```
365
+
366
+ ### Asset Bundles
367
+
368
+ 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.
369
+
370
+ ```cpp
371
+ // "UI" bundle: loaded in menus for icon display.
372
+ UPROPERTY(EditDefaultsOnly, meta = (AssetBundles = "UI"))
373
+ TSoftObjectPtr<UTexture2D> Icon;
374
+
375
+ // "Game" bundle: loaded when entering gameplay.
376
+ UPROPERTY(EditDefaultsOnly, meta = (AssetBundles = "Game"))
377
+ TSoftObjectPtr<USkeletalMesh> WorldMesh;
378
+
379
+ // Transition from UI to Game bundle:
380
+ AM.ChangeBundleStateForPrimaryAssets(
381
+ { WeaponId },
382
+ { TEXT("Game") }, // AddBundles
383
+ { TEXT("UI") }); // RemoveBundles
384
+ ```
385
+
386
+ ---
387
+
388
+ ## Asset Registry
389
+
390
+ `IAssetRegistry` allows querying asset metadata without loading assets. Access it via `IAssetRegistry::GetChecked()` or `FAssetRegistryModule::GetRegistry()`.
391
+
392
+ ```cpp
393
+ #include "AssetRegistry/AssetRegistryModule.h"
394
+ #include "AssetRegistry/IAssetRegistry.h"
395
+
396
+ IAssetRegistry& AR = IAssetRegistry::GetChecked();
397
+
398
+ // Get all assets of a class in a path.
399
+ TArray<FAssetData> AssetDataList;
400
+ AR.GetAssetsByPath(FName(TEXT("/Game/Data/Weapons")), AssetDataList, /*bRecursive=*/true);
401
+
402
+ // Get all assets of a specific class.
403
+ AR.GetAssetsByClass(
404
+ FTopLevelAssetPath(TEXT("/Script/MyGame"), TEXT("WeaponDefinition")),
405
+ AssetDataList,
406
+ /*bSearchSubClasses=*/true);
407
+
408
+ // FAssetData is lightweight — no asset load occurs.
409
+ for (const FAssetData& Data : AssetDataList)
410
+ {
411
+ FString AssetName = Data.AssetName.ToString();
412
+ FSoftObjectPath Path = Data.GetSoftObjectPath();
413
+
414
+ // Read asset registry tags without loading.
415
+ FString TagValue;
416
+ Data.GetTagValue(FName(TEXT("WeaponType")), TagValue);
417
+ }
418
+
419
+ // Query by tag values.
420
+ TMultiMap<FName, FString> TagFilter;
421
+ TagFilter.Add(TEXT("WeaponType"), TEXT("Melee"));
422
+ AR.GetAssetsByTagValues(TagFilter, AssetDataList);
423
+ ```
424
+
425
+ ### Making Properties Searchable
426
+
427
+ ```cpp
428
+ UPROPERTY(EditDefaultsOnly, AssetRegistrySearchable)
429
+ FName WeaponType;
430
+ ```
431
+
432
+ ---
433
+
434
+ ## Common Mistakes and Anti-Patterns
435
+
436
+ ### Hard Referencing Everything
437
+
438
+ ```cpp
439
+ // BAD: This UPROPERTY loads ALL 50 particle effects when this data asset loads.
440
+ UPROPERTY(EditDefaultsOnly)
441
+ TObjectPtr<UParticleSystem> HitEffect;
442
+
443
+ // GOOD: Soft reference — only load when the gameplay effect actually triggers.
444
+ UPROPERTY(EditDefaultsOnly)
445
+ TSoftObjectPtr<UParticleSystem> HitEffect;
446
+ ```
447
+
448
+ ### Loading on the Game Thread
449
+
450
+ ```cpp
451
+ // BAD: LoadSynchronous on a large skeletal mesh stalls the render thread.
452
+ USkeletalMesh* Mesh = MeshSoft.LoadSynchronous();
453
+
454
+ // GOOD: Async load, apply result in callback.
455
+ UAssetManager::GetStreamableManager().RequestAsyncLoad(
456
+ MeshSoft.ToSoftObjectPath(),
457
+ FStreamableDelegate::CreateUObject(this, &AMyActor::OnMeshLoaded));
458
+ ```
459
+
460
+ ### Forgetting to Keep the Handle Alive
461
+
462
+ ```cpp
463
+ // BAD: Handle is a local — destroyed when function returns, assets may be unloaded.
464
+ void LoadStuff()
465
+ {
466
+ TSharedPtr<FStreamableHandle> Handle = SM.RequestAsyncLoad(...);
467
+ } // Handle destroyed here!
468
+
469
+ // GOOD: Store handle as a member until assets are no longer needed.
470
+ TSharedPtr<FStreamableHandle> LoadHandle; // member variable
471
+ ```
472
+
473
+ ### Not Registering Primary Asset Types
474
+
475
+ If a `UPrimaryDataAsset` subclass is not listed under `PrimaryAssetTypesToScan` in `DefaultGame.ini`, `GetPrimaryAssetIdList` returns nothing and `LoadPrimaryAsset` silently fails.
476
+
477
+ ### Circular Soft Reference Resolution
478
+
479
+ 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.
480
+
481
+ ### DataTable Column Changes with Existing Data
482
+
483
+ 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.
484
+
485
+ ---
486
+
487
+ ## Edge Cases
488
+
489
+ - **Cooked vs uncooked paths**: In uncooked builds, paths use `/Game/`. Cooked paths differ — do not hard-code paths; use `FSoftObjectPath` from UPROPERTY references.
490
+ - **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.
491
+ - **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.
492
+ - **Memory budgets**: Track loaded assets by type via `UAssetManager::GetPrimaryAssetObjectList`. Use `ChangeBundleStateForPrimaryAssets` to swap between UI and Game bundles as scenes change.
493
+ - **`bStripFromClientBuilds`**: Set this on `UDataTable` instances that contain server-only data (e.g., loot tables with drop rates) to prevent distribution to clients.
494
+
495
+ ---
496
+
497
+ ## Related Skills
498
+
499
+ - `/ue-cpp-foundations` — UPROPERTY specifiers, USTRUCT, UObject lifecycle
500
+ - `/ue-serialization-savegames` — saving and loading soft object references across sessions
501
+ - `/ue-module-build-system` — adding `AssetRegistry`, `Engine` module dependencies to Build.cs
502
+ - `/ue-naming-conventions` — asset prefixes and Content folder layout for these assets
503
+
504
+ ## Reference Files
505
+
506
+ - `references/asset-loading-patterns.md` — sync vs async load, StreamableManager and Asset Manager patterns
507
+ - `references/data-driven-design.md` — choosing DataAsset vs DataTable vs config, and how to structure game data
508
+
509
+ ---
510
+
511
+ ## Checklist
512
+
513
+ Validate before considering the work done:
514
+
515
+ - [ ] Heavy assets are referenced softly and loaded through the Asset Manager
516
+ - [ ] Primary Asset types are registered so scanning and cooking behave correctly
517
+ - [ ] No synchronous load of large assets on the game thread during gameplay
518
+ - [ ] Conventions in `docs/unreal/project-context.md` were read and followed
519
+ - [ ] The Common Mistakes section of this skill was reviewed against the change
520
+
521
+ **PASS** — every item holds. **CONCERNS** — the work stands but at least one item is unresolved and worth flagging to the user. **FAIL** — an item is violated in a way that breaks correctness, replication or the frame budget; fix it before handing the work over.
522
+
523
+ ## Next Steps
524
+
525
+ - `/asset-audit` — check naming, size and orphaned assets
526
+ - `/code-review` — architectural and quality review of the change
527
+ - `/commit` — conventional commit once the change is verified