Recover RPF9 models with packed vertices and mixed blocks #1
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/breadbbbb--rpf9-explorer!1
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Mulkku on GitHub · 2026-11-21 15:48 UTC · original
Mulkku:model-layout-recovery→main· +321 −56 · 8 files · 1 commits · merged 2026-11-21 23:20 UTCWhy
The previous local model scan accepted 190,623 of 190,792 candidates. The remaining 169 came from
levels.rpf(167) andstory000.rpf(2). They exposed cases in resource assembly, mesh metadata, and packed vertex bounds.Changes
0x00for the observed0xC000header flags (16-bit references with a bone palette). Allow palettes that reference an external skeleton and data after the index tables. Keep all cluster count, table length, triangle reference, and local bone range checks where those ranges are available.Verification
AI-assisted implementation. Verification ran on Windows 11 x64 and exercised CPU-side archive and geometry decoding.
ArchiveReader.ReadResourceData. This included 33 entries with raw segments.rpf9dumpagainst the patched Core (.NET 8 targets).Run the redistributable smoke fixture with
dotnet run --project Tests/ModelRecoverySmoke -c Release. To rebuild a model index from a local archive, use Scan entire archive or rundotnet run --project Tools/IndexBuilder -c Release -- models <archive.rpf> <report-directory>.The counts cover recognized drawable and fragment candidates in the tested archives. The viewer continues to preview the primary LOD, and the original RPF9 directory and skeleton animation are outside this patch.
@Kam471 on GitHub · 2026-11-21 18:23 UTC · original
Independent validation at
c3708fbon the Xbox Series GTA VI package1.0.2.1(.NET 8.0.428), using the PR Core through a copy of Leonida'stools/rpf9dumpand a directFindCandidateOffsets/RecoverAtOffsetsharness.data.rpffull (481,544,304 bytes): 2,313 / 2,313 candidates recovered, 0 rejects; 2,313 / 2,313 read back and decoded. This includes all 963 candidates the48557eadecoder rejected. All 1,350 pre-PR OBJ files are byte-identical, and the export has 2,313 unique stems with no collisions.common.rpffull: 0 / 0 candidates, 0 models.levels.rpf0-8 GiB: 28,748 / 28,748 (pre-PR 26,184).levels.rpf4-4.5 GiB: 4,010 / 4,010 (pre-PR 3,821).levels.rpf12-16 GiB: 10,429 / 10,429 (not previously measured).levels.rpfentries read back and decoded, including the 2 entries with raw segments (both 48-byte graphics tails).The PR's own
Tests/ModelRecoverySmokepasses.Scope caveat: I did not scan full
levels.rpfor the other seven archives, so I did not independently reproduce the ten-archive 190,792 / 190,792 total or the 169 / 169 subset. No counterexample appeared in the tested scopes. The 16-byte raw system tail was exercised only by the smoke fixture; the real samples above contained 48-byte raw graphics tails only. No game data is included in this comment.@Spaghetih on GitHub · 2026-11-21 22:42 UTC · original
Full-archive validation at
c3708fbon the Xbox Series package1.0.2.1. It completes @Kam471's scoped run above: fulllevels.rpfplus the other archives Leonida exports models from.Method. A small harness against Core follows the same path as Leonida's
tools/rpf9dump models:FindCandidateOffsets, thenRecoverAtOffsetsin chunks of 32,RecoveryIndexCache.Save,ArchiveReader.Open,ReadResourceData(readback) andRageModelDecoder.Decode. No OBJ is written. Each archive was run at both48557eaandc3708fb. As a control, the48557eatotals reproduce Leonida's documented figures exactly (155,598 models, with the same per-archive counts).48557eac3708fblevels.rpf(full, 70.9 GiB)pack/story000/story000.rpfdata.rpfpack/shared_minigame000/shared_minigame000.rpfpacks.rpfpack/core_restofworld/core_restofworld.rpfcommon,textures,story000_restofworld,core_restofworld001At
c3708fb, every candidate is recovered, read back and decoded: 0 decode failures, 0 readback failures, and no duplicate model names (190,792 unique). That is 2.22 billion triangles, against 1.95 billion before. This independently reproduces the PR's 190,792 / 190,792 ten-archive total.Not covered. The OBJ text itself (export and file comparison) was not checked in this run; @Kam471's byte-identical check on
data.rpfstill stands for that. The 169-candidate subset is a different scope and was not isolated. No game data is included here: only counts.AI-assisted (Claude Code).
@Kam471 on GitHub · 2026-11-21 23:11 UTC · original
Recorded the full-archive validation (190,792 / 190,792 at
c3708fb, 2.22 billion triangles) in Leonida's docs via ItsNotRexed/Leonida#347.