ousnius / nifly

C++ NIF library for the Gamebryo/NetImmerse File Format
GNU General Public License v3.0
55 stars 21 forks source link

FO4/76 official file problems #46

Closed Capostrophic closed 1 month ago

Capostrophic commented 1 month ago

A bunch of minor things I noticed while batch-testing OpenMW's NIF parser on official files a while earlier. OpenMW's parser is not directly based on nifly, but I used nifly and NifTools XML as references.

I don't remember offhand if there are any other problems with nifly's parsing of files from these games, though on NifTools side 76 support has been mostly broken for a while due to an oversight or two in Starfield-relevant changes.

ousnius commented 1 month ago

@Capostrophic Thanks for the issue. The specific Mirelurk file with version 132 should work in nifly as there is a test for it: https://github.com/ousnius/nifly/blob/main/tests/input/TestNifFile_Static_FO4_132.nif

That doesn't mean the condition is correct, though. I'll check the rest in detail in the coming days when I'm home.

ousnius commented 1 month ago

@Capostrophic I fixed the conditions for the stream 132 and 139 files. with 9aa5dd3. The files were fully read and written, but float values ended up in the wrong members in nifly. The conditions now match the nif.xml.

As for the FO76 files, I haven't modded the game personally and only carried over the decoding from other tools/people. I'm installing the game to check out of curiosity, but other people are probably more fit to help with decoding here.

ousnius commented 1 month ago

@Capostrophic I made some fixes with commits ad75c4a and c9b2e7f, the latter of which fixes the issue with for example cm003f16ba.nif.

ousnius commented 1 month ago

The following are the still unknown block types to nifly with one example file for each after scanning ALL .nif and .bto files of FO76 as of September 15, 2024:

All NIF files in FO76 use stream version 155.

ousnius commented 1 month ago

See #47

Capostrophic commented 1 month ago

Very nice. I should note that in files up to 4.2.2.0 non-abstract NiExtraData respects its own record size field and can seemingly store binary extra data on the record, but I guess nifly doesn't target NIFs that old.