How-To: Keep Your Assets in a Cooked Build
Goal: make sure the equipment definitions your game loads at runtime actually ship in the packaged build.
1. Know which references the cooker can see
The cooker walks hard references from things it already decided to cook. A definition reached by a hard TSubclassOf pin - named in a data table you cook, or referenced by an item Blueprint that ships - comes along for free. A definition reached only by name at runtime does not.
| How the definition is reached | Cooked? |
|---|---|
A hard TSubclassOf reference on an asset that ships (an item definition, a data table row, a curated list) | Yes. |
Only from a save file, through the saved Equipment Definition class reference | No. A save file is not scanned by the cooker. |
Only through Source Object Path, the soft path in a save entry | No. Soft paths are not hard references. |
| Only by a class name assembled at runtime | No. |
Restore From Save Data warns about a null definition and skips the entry, and the player's gear is simply gone with no error dialog.LogCrimsonEquipment warns about skipping an entry with no definition.2. Give every definition a hard reference that ships
The fix is to make something the cooker already cooks point at your definitions. Any one of these is enough:
- A data table or curated data asset listing every equipment definition, referenced by something that ships. This is the usual answer and the easiest to audit.
- Your item assets. If each item definition already holds a
TSubclassOfof its equipment definition, and the items ship, the equipment definitions ship with them. - Additional Asset Directories to Cook in Project Settings -> Project -> Packaging. Add the folder holding your definitions. This is the blunt route - it cooks the whole folder whether or not anything references it.
The Blueprint route is the curated list. Create a Data Table (or a simple data asset with a TSubclassOf<Crimson Equipment Definition> array), add a row per definition, and reference that table from something that already ships - your GameMode, a game instance, or an item catalog. The cooker then follows the table to every definition in it.
Check your work: right-click a definition -> Reference Viewer, and confirm the table appears as a referencer.
3. Verify before you ship
- Package a build, load a save written before the fix, and confirm every piece of gear returns.
- Right-click a definition in the Content Browser -> Reference Viewer and confirm at least one referencer is an asset that ships.
- Search the packaged log for
LogCrimsonEquipmentwarnings about skipped entries.
LogCrimsonEquipment warnings.See also
- How-To: Save and Restore Equipment
- API Reference