Skip to content

fix(studio): accept the last-frame lookahead of stock sequence group files - #2

Merged
hzqst merged 1 commit into
mainfrom
fix/sequence-group-lookahead
Oct 27, 2026
Merged

hzqst merged 1 commit into
mainfrom
fix/sequence-group-lookahead

Conversation

@hzqst

@hzqst hzqst commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

GoldSrc's animators read the first sample after a run's last span at its last frame, with no weight (the frame is clamped to numframes - 1, where s is 0). Every stock Half-Life sequence group file (scientist01.mdl, barney01.mdl, ...) ends before that sample, up to two mstudioanimvalue_t short, so CheckStudioSequenceGroup() rejected all of them.

  • New public macro UTIL_ASSETS_INTEGRITY_SEQUENCE_GROUP_TAIL_BYTES (4). CheckStudioSequenceGroup() lets only the interpolation lookahead end up to that many bytes past the group; the samples themselves must still be inside the file.
  • Main models keep no tail and are still checked strictly against their kept structure.
  • The UtilAssetsIntegrityAPI_001 vtable and result layouts are unchanged.
  • Caller contract: callers that animate a group must keep that many zeroed bytes after it. Callers that only validate (e.g. SCModelDownloader) are unaffected.
  • The smoke runner's directory scan now also checks each sequence group file it finds beside a main model against that model.
  • Docs updated: docs/studio-validation.md, README.md, README.zh-CN.md, memory/project_overview.md.

Ported from HLND2T-DiligentGraphics 4b3f52c7. After this PR the shared sources, header and tests match that copy byte for byte (ignoring line endings), so HLND can consume this repository as a submodule.

Verification (local, Windows, VS 2022, x86)

  • scripts/build-UtilAssetsIntegrity-x86-Release.bat: exit 0, CTest 1/1, installed-DLL smoke test passed.
  • scripts/build-UtilAssetsIntegrity-x86-Debug.bat: exit 0, CTest 1/1, installed-DLL smoke test passed.
  • Regression check: the new tests run against a DLL built without the src/ change fail with last frame lookahead in the caller's tail (expected 0, got 7).
  • Scan of stock valve/models: Scanned 310 MDL files and 20 sequence groups against their main models; rejected 1. The only rejection is the old doctor.mdl (not version 10).
  • format-check: 6 files, 0 with differences.

GitHub Actions results are not part of this local verification.

🤖 Generated with Claude Code

…files

GoldSrc's animators read the sample after a run's last span at its last
frame, with no weight. Every stock Half-Life sequence group file ends
before that sample, so CheckStudioSequenceGroup rejected them. Sequence
groups may now end that read up to
UTIL_ASSETS_INTEGRITY_SEQUENCE_GROUP_TAIL_BYTES (4) past their bytes;
callers that animate a group keep that many zeroed bytes after it. Main
models stay checked strictly. The model directory scan now checks each
sequence group against its main model.

Ported from HLND2T-DiligentGraphics 4b3f52c7.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hzqst
hzqst merged commit bd54325 into main Oct 27, 2026
3 checks passed
@hzqst
hzqst deleted the fix/sequence-group-lookahead branch October 27, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant