ultimate-research / ssbh_lib

Reading and writing SSBH file formats in Rust
MIT License
8 stars 3 forks source link

Newest ssbh_data and ssbh_lib are unable to parse a previously exported .NUMATB file #126

Closed ssbucarlos closed 2 years ago

ssbucarlos commented 2 years ago

c00.zip Newest ssbh_lib_json.exe and ssbh_data_json.exe cant parse this and its also not parsable with ssbh_data_py as a result. Previous versions of ssbh_lib_json can parse it. Works in game. The error is

BinRead Error: EnumErrors { pos: 0x10, variant_errors: [("Hlpb", BadMagic { pos: 0x10 }), ("Matl", EnumErrors { pos: 0x18, variant_errors: [("EntriesV15", AssertFail at 0x18: "major_version == 1 && minor_version == 5"), ("EntriesV16", EnumErrors { pos: 0x14CC, variant_errors: [("Float", AssertFail at 0x14CC: "data_type == 1u64"), ("Boolean", AssertFail at 0x14CC: "data_type == 2u64"), ("Vector4", AssertFail at 0x14CC: "data_type == 5u64"), ("Unk7", AssertFail at 0x14CC: "data_type == 7u64"), ("MatlString", AssertFail at 0x14CC: "data_type == 11u64"), ("Sampler", NoVariantMatch { pos: 0x1500 }), ("UvTransform", AssertFail at 0x14CC: "data_type == 16u64"), ("BlendState", AssertFail at 0x14CC: "data_type == 17u64"), ("RasterizerState", AssertFail at 0x14CC: "data_type == 18u64")] })] }), ("Modl", BadMagic { pos: 0x10 }), ("Mesh", BadMagic { pos: 0x10 }), ("Skel", BadMagic { pos: 0x10 }), ("Anim", BadMagic { pos: 0x10 }), ("Nrpd", BadMagic { pos: 0x10 }), ("Nufx", BadMagic { pos: 0x10 }), ("Shdr", BadMagic { pos: 0x10 })] }
ScanMountGoat commented 2 years ago

Setting the max_anisotropy to 0 is no longer supported. The issue is that this used to just be an integer field. Valid values for max_anisotropy are the enum variants One, Two, Four, Eight, Sixteen. At the graphics API level, anisotropic filtering can be 1x (regular filtering) up to some device defined limit (usually at least 16x).

From my testing, 0 just gets set to 1x. Values below 2 don't appear in any in game numatb files. For ssbh_data_py, just set max_anisotropy to None to disable anisotropic filtering.

ssbucarlos commented 2 years ago

How should i go about modifying this .numatb to support the new max_anisotropy value? I tried loading up this outputted fighter with the bad .numatb in crossmod and re-exporting a new .numatb from it and that didnt do the trick, same error after export. Even after changing the max_anisotropy values in all the samplers, so im not too sure how to go about fixing this numatb.

ScanMountGoat commented 2 years ago

Open it in an older ssbh_lib_json and change the 0's to 1 or 2. MatLab may also work.

ssbucarlos commented 2 years ago

That did the trick, thank you!