Skip to main content

Cooking Data for Packaged Builds

A key feature of the FactsDB system is its separation between the flexible development environment and the optimized, packaged game. To ensure performance, fast load times, and reliable data in your shipped build, FactsDB uses a cooking process.

Why Cooking Is Required

In the editor, the system favors flexibility:

  • Dynamic Data: UFactSchemaManager and UFactQueryManager load directly from UDataTable and UFactsDBQueryDefinition assets.
  • Live Updates: Changes to data assets are reflected instantly.
  • On-Demand Inheritance: Schema inheritance is resolved during runtime.

This dynamic approach is ideal for iteration but inefficient for shipping. The cooking process transforms multiple live assets into a single, optimized, preprocessed data source.

Benefits of Cooking:

  1. Performance: Eliminates the need to load and parse multiple assets at runtime.
  2. Efficiency: Combines schema and query data into a single compact UPrimaryDataAsset, reducing load times and memory usage.
  3. Reliability: Includes validation to catch issues like circular dependencies or duplicate tags at build time.

The Cooked Data Asset

The result of the cooking process is a single UFactsDBRuntimeData asset containing:

  • CookedSchemaData: Fully resolved schemas with inheritance flattened and defaults applied.
  • CookedQueryData: All query definitions with references resolved.

In a packaged build, this asset becomes the only data source used by FactsDB.

How to Cook

You must trigger the cooking process manually before building your game.

  1. Open Project Settings > Project > FactsDB Cooking Settings.
  2. In the Cooking Actions section, select Cook FactsDB Data.

FactsDB Menu

The process performs:

  1. Validation – Ensures all schema and query definitions are correct. Build fails if errors are found.
  2. Data Consolidation – Gathers all defined schemas and queries.
  3. Resolution – Resolves inheritance and references using the managers.
  4. Asset Generation – Creates or updates the UFactsDBRuntimeData asset at the configured path.
  5. Serialization & Save – Writes the finalized data into the asset for use at runtime.

Configuration

In FactsDB Cooking Settings, you can configure:

  • Cooked Data Asset Path
    Location where the cooked asset will be saved (e.g., /Game/FactsDB/Data/DA_FactsDBRuntimeData). Must be a valid package path.

  • Use Cooked Data

    • false (unchecked): (Default in development) Uses live, uncooked data.
    • true (checked): (Required for packaged builds) Loads only the cooked asset. If the asset is missing, the game will fail to initialize.

FactsDB Cooking Settings

This image shows a preview of the resulting UFactsDBRuntimeData asset after cooking. It contains the resolved schema and query data and is the single source of truth for FactsDB during runtime in packaged builds. FactsDB Cooked Data

Runtime Usage

In a cooked build (Use Cooked Data = true), UFactRuntimeSubsystem bypasses the editors and directly loads UFactsDBRuntimeData. It passes this to a lightweight FFactsDBRuntimeDataProvider that performs fast lookups using the cooked maps, ensuring optimal performance.


Next Up: FAQ & Troubleshooting