niftools / nifskope

A git repository for nifskope.
http://www.niftools.org
Other
559 stars 240 forks source link

Nifskope 2.0 Dev7 Can't Open Original Game Meshes for Oblivion #224

Closed AndalayBay closed 1 year ago

AndalayBay commented 1 year ago

Nifskope 2.0 Dev 7 can't open some of the original game meshes for Oblivion. There are a bunch of meshes with an apparently odd version.

Error: failed to load file header (version a000102, 10.0.1.2)

I can open the files in an old version of Nifskope, but I can't edit the version to fix it. Is there a tool I can use to fix the header?

One example is groundcoverpineappleweed01.nif.

Also some of the grass meshes don't show up in Nifskope due to the alpha settings on the vertex colours. If I change the alpha, I can get the grass to show up, but that effects the sway in the game. It uses the alpha to simulate the grass swaying in the wind. Is there anything I can do to be able to view the grass in Nifskope without changing the alpha? I'm not a modeller. We've been retexturing some of the grasses and it would be nice to get an idea of what it will look like. It doesn't show up in the CS either. The CSE has a preview option.

corwinn commented 1 year ago

Yours: dedb22c3bdb0869a5f38753fe3f158f0 groundcoverpineappleweed01.nif

Theirs: f53e4f212d8562ef8c6cb827b97d8f62 /mnt/nifs/t4/t4_nif_c_game/game/game/meshes/plants/groundcoverpineappleweed01.nif

I highly recommend to do not post game asset(s) unless you're licensed to. Just posting its file-name should be ok. My advice is to delete the above zip file.

The file you posted loads just fine everywhere, except "Nifskope 2.0 Dev 7". Here's a patch (more of a hint) for that:

0x0a000102.homework.patch:

diff --git a/nif - Copy.xml b/nif.xml
index 686a3a9..7207c74 100644
--- a/nif - Copy.xml
+++ b/nif.xml
@@ -1489,6 +1489,8 @@
         <add name="Num Blocks" type="ulittle32" ver1="3.1.0.1">Number of file objects.</add>
         <!-- BSStreamHeader -->
         <add name="User Version 2" type="ulittle32" default="0" cond="((Version == 20.2.0.7) || (Version == 20.0.0.5) || ((Version &gt;= 10.0.1.2) &amp;&amp; (Version &lt;= 20.0.0.4) &amp;&amp; (User Version &lt;= 11))) &amp;&amp; (User Version &gt;= 3)" />
+        <add name="Unknown Int 3" type="uint" default="0" ver1="10.0.1.2" ver2="10.0.1.2">Unknown. Possibly User Version 2?</add>
+        <add name="Export Info" type="ExportInfo" ver1="10.0.1.2" ver2="10.0.1.2" />
         <add name="Export Info" type="ExportInfo" cond="((Version == 20.2.0.7) || (Version == 20.0.0.5) || ((Version &gt;= 10.0.1.2) &amp;&amp; (Version &lt;= 20.0.0.4) &amp;&amp; (User Version &lt;= 11))) &amp;&amp; (User Version &gt;= 3)" />
         <add name="Max Filepath" type="ShortString" cond="(User Version 2 == 130)" />
         <!-- / BSStreamHeader -->
AndalayBay commented 1 year ago

Which version of Nifskope should I be using? If Dev 7, then do I replace the code in nif.xml with that? I found that section in nif.xml.

Thanks for the assist. Zip file removed, I think.

AndalayBay commented 1 year ago

Adding the two extra lines has fixed it for Nifskope Dev 7. Hope that doesn't break anything.

Thanks again for the help @corwinn

corwinn commented 1 year ago

You're welcome.

"nif.xml" took the road of becoming infinitely complex a long time ago (circa 2012) - that led, as you can see, to a project that can never be completed.

I suppose one could use many versions of "Nifskope" at once, because the "recent" ones have ton of regressions (File->XML Checker, for starters; I have a sample set of ~300000 nif files (~24 distinct versions) - no "Nifskope" can "survive" that "XML check", yet).

"Nifskope" can be improved with a test-suite for starters - to minimize regressions, to increase its robustness; - to begin managing its complexity. One could temporary use a free 3D render engine - in order to simplify its code by ~2/3rds. ... That is - if its developers decide to.

There are others who know "nif.xml" better than me. I don't know where to reach them however. Perhaps at the modding communities.

Unfortunately for the moment I don't see a log that lets one see what part of the .nif was successfully parsed, and where it stopped - that would speed up the healing process of "nif.xml" (more people would be able to help clearing up regressions).

AndalayBay commented 1 year ago

I suppose one could use many versions of "Nifskope" at once, because the "recent" ones have ton of regressions (File->XML Checker, for starters; I have a sample set of ~300000 nif files (~24 distinct versions) - no "Nifskope" can "survive" that "XML check", yet).

That's what I've been doing. I have an old version that could open the files and would use that when needed. I really like the features of the newer version so I prefer to use that when possible.

There are others who know "nif.xml" better than me. I don't know where to reach them however. Perhaps at the modding communities.

I don't think any of them were ever part of my forums. If they were, I'd be able to attempt to contact them. I usually check Nexus. It's too bad they disabled the search in the community forums. You can search the mod downloads area for authors.

You can also try just a regular internet search for their user name. If they posted frequently, you might get a hit.

hexabits commented 1 year ago

@AndalayBay Oblivion suffers from distribution differences. Some distributions have wildly different NIF versions than others. I don't remember having parsing issues on any Oblivion files in dev8, but I only had access to the files of two distributions of Oblivion. I can't speak to dev7 since it's so old.

As for all the weird comments from corwinn, you're welcome to promise one of your complete rewrites and then disappear again for ~10 years. You've done that what, twice now?

AndalayBay commented 1 year ago

My Oblivion is the boxed DVD version that didn't even come with SI. I had to buy that separately. The different versions might explain why my teammates haven't had this issue.

@hexabits is dev8 a release? The only thing listed on the main page is Dev 7. If you could give me a link to dev 8, I could check it out.

Was that directed at me? Given that I know piss all about meshes and modelling, I wouldn't be much help with Nifskope.

hexabits commented 1 year ago

@AndalayBay dev8 is a release on my fork, which is linked in the Release here. I had someone look at that specific groundcoverpineappleweed01 file and it's version 20.0.0.5 for Steam distros, at least the German one. I remember dealing with the outdated NIFs from the original Oblivion disks, and thought I'd resolved issues in dev8, but unfortunately I can't find the old Oblivion distros with the outdated file versions atm to double check.

Was that directed at me? Given that I know piss all about meshes and modelling, I wouldn't be much help with Nifskope.

No, it was at corwinn, sorry for the confusion.

AndalayBay commented 1 year ago

@AndalayBay dev8 is a release on my fork, which is linked in the Release here. I had someone look at that specific groundcoverpineappleweed01 file and it's version 20.0.0.5 for Steam distros, at least the German one. I remember dealing with the outdated NIFs from the original Oblivion disks, and thought I'd resolved issues in dev8, but unfortunately I can't find the old Oblivion distros with the outdated file versions atm to double check.

Heh, well this is even more crazy. My husband has the Steam version and the file is version 10.0.1.2. His meshes.bsa is dated 2005. My version of the file is 10.2.0.0 which is from the original Oblivion DVD. My meshes.bsa is dated 2006. We both have the English version of the game.

I'll see if I can install your version and use it to check some of these files.

AndalayBay commented 1 year ago

CORRECTION: I think the file versions between my game and my husband's are the same. There are two GroundCoverPineappleWeed meshes. One is version 10.0.1.2 as I reported originally. The other is 10.2.0.0. Neither would open in Dev 7. I can confirm both open in Dev 8.

AndalayBay commented 1 year ago

Dev 8 and onwards seem to open the Oblivion meshes just fine, so this issue can be closed.