Skip to content

Commit 15445fa

Browse files
committed
Convert assets to ozzx/ozz during loading phase POC works
1 parent 0df694b commit 15445fa

File tree

8 files changed

+447
-12
lines changed

8 files changed

+447
-12
lines changed

src/xrAnimation/AGENT_DOCS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
- IK limbs and step manager paths now bail out cleanly when an Ozz visual is active, so missing `IKinematicsAnimated` no longer hard-asserts during experiments.
1818
- `OzzBundleRuntime` regression test hydrates `OzzKinematics` and mesh payloads from a `.ozzx` bundle to guard bundle/runtime parity.
1919
- Parity/unit tests require the generated `src/xrAnimation/tests/testdata/stalker_hero_1.ozz` and `.ozzx` fixtures; rerun `convert_assets.sh` if they are missing before executing the suites.
20+
- Startup boot now rebuilds `.ozzx` bundles and `.ozz` animations under `$game_meshes$` / `$game_anims$` when the inventory digest drifts or assets are missing, persisting the fresh digest back to `user.ltx` once conversions succeed.
2021

2122
## Active Objective
22-
- Stand up a startup conversion stage that hooks into the level loading flow (after `IGame_Persistent::Prefetch()`), converts any `.ogf/.omf` discovered during prefetch into `.ozz/.ozzx`, and drops the bundles into `gamedata` with progress surfaced via `g_loading_stages`.
23+
- Surface the new startup conversion stage through the loading UI once localisation strings are ready so players see a "converting Ozz assets" progress step.
2324
- Harden the MVP: keep converter/runtime parity tests green, expand automation around bundle hydration, and chase down any gameplay regressions surfaced by smoke tests.
2425
- Gather frame-cost telemetry comparing legacy vs. Ozz paths and publish the results alongside configuration guidance.
2526
- Capture follow-up requirements (threading, GPU skinning, richer metadata) and turn them into a prioritised roadmap for the next phase.

src/xrAnimation/AGENT_NEXT_STEPS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
## Post-MVP Focus
1010
1. **Startup Conversion Stage**
11-
- Introduce a loading-stage hook that runs after the existing object/model prefetch to walk legacy `.ogf/.omf` assets, invoke the converter, and persist `.ozz/.ozzx` bundles into `gamedata`.
12-
- Surface the stage through `g_loading_stages` so players/devs can track progress, and ensure the UI copy reflects the new work.
13-
- Coordinate with asset caches to avoid duplicate loads, respect `-noprefetch`, and fall back gracefully when conversion fails or assets are already cached.
11+
- Polish the new conversion pass (already invoked from `OnGameStart`) by surfacing progress through `g_loading_stages`, enriching diagnostics, and ensuring failures fall back cleanly to legacy assets.
12+
- Coordinate with asset caches to avoid duplicate loads, respect `-noprefetch`, and keep rebuilds idempotent when outputs already exist.
1413
2. **Stability & Regression Automation**
1514
- Keep the converter/runtime suites green, add smoke coverage for newly converted startup bundles, and automate checks that guard palette/visibility behaviour.
1615
3. **Telemetry & Documentation**

src/xrAnimation/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ set(SOURCES
3636
OzzKinematics.h
3737
StartupConversionInventory.cpp
3838
StartupConversionInventory.h
39+
../../Externals/ozz-animation/samples/framework/mesh.cc
3940
)
4041

4142
# Create static library
4243
add_library(xrAnimation STATIC ${SOURCES})
4344

45+
set_source_files_properties(
46+
../../Externals/ozz-animation/samples/framework/mesh.cc
47+
PROPERTIES
48+
SKIP_PRECOMPILE_HEADERS ON
49+
)
50+
4451
# Link libraries
4552
target_link_libraries(xrAnimation
4653
PRIVATE

src/xrAnimation/STARTUP_CONVERSION_STAGE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Stand up a level-loading stage that converts legacy `.ogf/.omf` assets into `.oz
88
- Motions are discovered directly from the `.ogf` references; the inventory crawls the same visual roots for `.omf` payloads, capturing metadata (root alias, relative path, size, timestamp, VFS flag).
99
- `ComputeLegacyAssetInventoryDigest` folds the full inventory (visual sources + motion metadata) into a deterministic CRC32 digest. `Load/StoreInventoryDigestInUserConfig` persist that digest inside `user.ltx` so we can tell whether the startup scan matches the last cached run.
1010
- `LegacyOgfConverter` exposes `ConvertLegacyVisualToOzzBundle` so runtime callers and the CLI share identical conversion code paths.
11-
- `CGamePersistent::OnGameStart()` now loads the cached digest from `user.ltx` whenever `g_use_ozz_visuals` is enabled (and prefetching is active), recomputes the inventory, and logs whether the digest matches. This wiring is the precursor to the conversion pass.
11+
- `CGamePersistent::OnGameStart()` now loads the cached digest from `user.ltx`, verifies that previously generated `.ozzx`/`.ozz` artefacts exist, and triggers a rebuild (writing outputs under `$game_meshes$`/`$game_anims$`) whenever the digest changes or assets are missing. Successful runs persist the freshly computed digest for subsequent boots.
1212
- `test_startup_conversion.cpp` exercises inventory construction, digest stability, digest invalidation on asset edits, and digest persistence round-tripping through an `.ltx` file.
1313

1414
## Inventory Builder
@@ -24,9 +24,8 @@ Stand up a level-loading stage that converts legacy `.ogf/.omf` assets into `.oz
2424
- After successfully processing the queue, write the new digest back to `user.ltx` so the next boot can skip the heavy scan.
2525

2626
## Outstanding Integration Work
27-
- Trigger the conversion stage from `CGamePersistent::OnGameStart()` once the digest reports a mismatch, enqueueing `.ogf/.omf` work and surfacing progress via the loading screen.
27+
- Surface progress through the loading screen (`LoadTitle`/`LoadStage`) once localisation strings are in place so the UI communicates the new conversion work clearly.
2828
- After wiring the conversion jobs, verify bundle timestamps before writing new digests so we only persist once outputs are safely on disk. Continue to fallback gracefully to legacy visuals when conversion fails and emit clear telemetry for mismatched assets.
29-
- Define the output locations for generated skeletons/bundles (most likely under `$gamedata$`) and ensure the stage mirrors the legacy directory structure when writing `.ozz/.ozzx` artefacts.
3029
- Record per-asset timings so we can report aggregate conversion costs and feed the legacy vs. Ozz frame-cost telemetry workstream.
3130
- Extend console/debug tooling to dump the current digest, force regeneration, or purge cached bundles when investigating asset issues.
3231

0 commit comments

Comments
 (0)