Accept zero-radius drawables and compute bounds when declared bounds are empty #12
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!12
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/12/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?
@LocranKing on GitHub · 2026-11-22 06:49 UTC · original
LocranKing:fix/zero-radius-drawables→main· +2 −2 · 1 files · 1 commits · merged 2026-11-22 09:44 UTCWhy
LooksLikeDrawableHeader(Core/RageModelDecoder.cs:124) requiresradius > 0, which rejects valid drawables whose bounding-sphere radius is0.0f:pack/core_restofworld/core_restofworld.rpf: single-entry skinned drawable dictionaries (bones = true, 1 material, 3–4 vertices / 1–2 triangles each) with sub-millimeter non-empty declared bounds (~0.0001–0.0002m) whose radius is0. With #9 (LooksLikeDrawableDictionarycallingLooksLikeDrawableHeader), these would also stop being scan candidates and disappear silently.levels.rpf: 38 skinned and 15 static single-mesh drawables (100,022vertices,37,826triangles —37,826/37,826non-degenerate,0non-finite positions, spanning up to7.65m) whose drawable header has bothradius == 0and empty declared boundsmin == max == (0, 0, 0).Additionally, for the 15 static (
!dictionary && !hasBoneBindings) standalone drawables whose declared bounds are empty (min == max),ModelReader.Decode(:560) returnedBoundsMin = BoundsMax = (0, 0, 0)instead of computing preview bounds from the decoded vertices.Measurements across the 1.0.2.1 package
917e9b9→ this PR917e9b9→ this PR917e9b9→ this PRpack/core_restofworld/core_restofworld.rpflevels.rpfpack/story000/story000.rpfpacks.rpfdata.rpfpack/shared_minigame000/shared_minigame000.rpfpack/story000_restofworld/story000_restofworld.rpflevels.rpf(53/53) recovered and decoded cleanly (0 false positives, 0 decode failures).levels.rpfdrawables now report non-emptyBoundsMin/BoundsMaxcomputed from their decoded geometry while keepingDeclaredBoundsMin/DeclaredBoundsMaxas(0, 0, 0).Change
Core/RageModelDecoder.cs:124: acceptradius is >= 0 and < 1_000_000(negative,NaN, infinite, and>= 1_000_000radii stay rejected).Core/RageModelDecoder.cs:560: fall back to computingpreviewMin/previewMaxfrom mesh vertices whenmin == max(alongsidedictionary || hasBoneBindings).This PR does not touch any lines modified by #8, #9, #10 or #11.
Tests
mainignoresTests/, so the self-contained synthetic smoke test is below (zero game data):radius == 0and non-empty sub-millimeter bounds passesProbeRequiredExtents,DecodeModels, and full synthetic.rpfscan + recovery.radius == 0and empty declared boundsmin == max == (0, 0, 0)passesLooksLikeDrawable,ProbeRequiredExtents,Decode, and synthetic.rpfscan + recovery, withBoundsMin/BoundsMaxfalling back to the decoded triangle[0, 1]^3whileDeclaredBoundsMin/DeclaredBoundsMaxstay(0, 0, 0).-0.001,-1),NaN,±Infinity, and1_000_000radii remain rejected for both standalone and dictionary drawables.Negative controls verified before the full fix:
917e9b9: fails atprobe accepts dictionary child with radius 0.:124applied: fails atBoundsMin/BoundsMax fall back to decoded mesh vertices when declared bounds are empty.:124and:560:ZeroRadiusSmoke: all checks passed.Copy both files to
Tests/ZeroRadiusSmoke/and rundotnet run --project Tests/ZeroRadiusSmoke -c Release.Tests/ZeroRadiusSmoke/ZeroRadiusSmoke.csprojTests/ZeroRadiusSmoke/Program.csTesting environment
Tested on Windows 11 Build 26200 x64 with .NET SDK 8.0.428 (CPU only).
Corebuilds with/p:TreatWarningsAsErrors=true(0 warnings, 0 errors), andLeonida'srpf9dumpbuilds cleanly against it.AI-assisted. No game data is included here (counts and synthetic test fixture only). Related tracking item: ItsNotRexed/Leonida#1006 (
ASSET-69).