1.8 KiB
1.8 KiB
ADR 0005: Prefab Instance and Asset Registry
Status
Accepted for asset identity; structural ownership superseded by ADR 0027
Context
Editor prefab placement and content pipeline work (H1/H2) require stable asset identity across sessions. The asset browser previously regenerated UUIDs on every sync, breaking references.
Decision
- Persist stable
AssetId(UUID) perassets/path inassets/.index/registry.ron. - Scene-instance
ModelRefstores the registry UUID plus a cached source path. Hydration resolves the UUID-keyed generated manifest first, allowing uniquely identified model moves to retain scene and animation references. - Catalog refresh reconciles a missing model record to one new path only when its generated content hash has exactly one match. Copies and ambiguous matches receive new IDs.
- Introduce
PrefabInstance { asset_id, source_path, overrides_ron }on placed prefab roots alongside hydration viaPrefabRef. - Scene save includes
PrefabInstanceand gameplay marker components fromshared. - The initial structural boundary treated instance contents as read-only and required Unpack before authored structural edits. ADR 0027 replaces that boundary with explicit generated-member ownership while retaining this ADR's asset and instance identity.
Consequences
- Prefab paths can be resolved through the registry for dependency tracking.
- Override apply/revert (H2) builds on
overrides_ronwithout changing the instance component shape. - Stable child identity, authored local children, nested instances, variants, and recursive graph validation are defined by ADR 0027.
- Registry must be version-controlled with the project.
- Legacy path-only
ModelRefvalues remain readable but require reassignment before they gain stable move resolution.