Keep Unreal log identifiers stable across editor and packaged builds
Section titled “Keep Unreal log identifiers stable across editor and packaged builds”- Status: current
- Engine: ue6-main
61e2877e10, Linux x86_64, Epic clang 23.1.5 - Context: standalone UE6 Development game with a C++ HUD and BPVerse objective actor
- Prerequisites: a fixture that matches case-sensitive diagnostic IDs
Symptom
Section titled “Symptom”A packaged fixture expected HUD ctx=build and failed with AssertionError: Missing or out of order: HUD ctx=build. The archive logged HUD ctx=Build icons=[A:Build,B:-,X:-,Y:-] and OBJECTIVE next=Bed.
Smallest example / reproduction
Section titled “Smallest example / reproduction”Keep a HUD context in FName, use the lowercase identifier build in the HUD code, and stream ToString() to a log compared case-sensitively. In the Coop Zero package, the case-insensitive name collided with an existing spelling of Build.
Solution
Section titled “Solution”Normalize the display string at the diagnostic boundary with ToString().ToLower() for lowercase HUD IDs. For a fixed enum, map values to explicit string literals for diagnostic IDs. Continue using the native name type where comparison and lookup use Unreal’s name semantics. Give new assets distinct names when their base name would collide with an existing gameplay identifier. The baby-bird icon now uses baby_bird to preserve the spelling of the Chick rule and the Chick_1 actor.
Why it works
Section titled “Why it works”FName comparison treats letter case as equivalent. The display spelling is unsuitable as a case-sensitive protocol field when other code registers the same name with different case. Explicit casing at the log boundary makes the fixture independent of that spelling.
Verified
Section titled “Verified”- Evidence level: runs in packaged build
- How:
bash Scripts/prove_ui.shon the corrected archive loggedHUD ctx=build icons=[A:build,B:-,X:-,Y:-],OBJECTIVE next=bedandHUD bubble bird=Hen1 icon=waterinSaved/step11-proof.ypOYAl/{sequence,captures}.logand printedStep 11 packaged assertions passed. The final archive’sSaved/step11-regression-main.logloggedCHICKEN_READY bird=Chick_1 rule=ChickandGROWN hen=Chick_1 t=1800.00. - Date / by: 2026-11-25, Coop Zero Step 11
Limits and assumptions
Section titled “Limits and assumptions”These IDs are ASCII and the fixture contract uses lowercase. The change applies to diagnostic IDs. Preserve display casing for names shown to a player.