The Forum is up for sale: XeNTaX Forum looking for new owner

noesis Gamebryo nif importer

Post questions about game models here, or help out others!
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: noesis Gamebryo nif importer

Post by finale00 »

Ya, it's just a typical inheritance structure. Naturally the generic parser (which would be an interface of abstract class in C++ or java) would contain a bunch of structs that are common and really don't change, while the child classes add or override things like NiMesh, NiDataStream, etc. as necessary.

Code: Select all

'''Parent module, _NifParser'''

class GenericNifParser(object):

   def parse_NiTextureData(self):
      '''stuff'''

   def parse_NiMaterial(self):
      '''stuff'''

   def parse_NiMesh(self):
      '''stuff'''

Code: Select all

'''Module A, some other file'''

from _NifParser import GenericNifParser

class NifParser20060500(GenericNifParser):
   '''20.6.5.00 nif parser'''

   def parse_NiDataStream118(self):
      '''Add some new methods for these new structs'''

   ...

Code: Select all

'''Module B, another file'''

from _NifParser import GenericNifParser

class NifParser30010000(GenericNifParser):
   '''30.1.0.00 nif parser'''

   ...

   def parse_NiMesh(self):
      '''Overrides parent method'''

      ...
My original design was to have all of the plugins in a sub-folder (package) called "NifParser", and then have one that does the type-checking in the main plugins folder.

The main problem I had with that design was this:

Some formats (say, 10.1.0.0 to 20.0.0.0) may use a particular struct for one of the nodes, and then starting in a later version (say, 20.6.0.0) they decided to change it. And then that change persists until some other later version.

I would like only one copy of the first struct to exist at any given time, and I would also like only one copy of the new struct to exist at any given time as well (to reduce redundancy).

But then how would you structure the inheritance tree? I guess instead of just inheriting from a generic nif parser, you could instead inherit from one of the later nif parsers as well...? Since each version pretty much seems to build on the previous.
Kung Fu Man
n00b
Posts: 14
Joined: Thu Jul 14, 2011 6:34 am

Re: noesis Gamebryo nif importer

Post by Kung Fu Man »

Tried loading a 20.5.0.0 file from Splatterhouse in here, got this error if it helps any:
Image
File I'm trying to work with: http://randomselect.piiym.net/sh_resour ... 3_mask.nif
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: noesis Gamebryo nif importer

Post by finale00 »

Great, they have multilingual versions as well and the idstring is even longer.
Looks like we can't just say "read 39 bytes". Instead, we should read 38 bytes, and then read another byte to see if it's a newline char 0xA. If it's not, then I guess we read some more...

Or just read it one byte at a time until you reach 0xA ...........

20.5.0.0 BR 0.0.0.2 has the same chunk table as 20.6.5.0 posted before.

Code: Select all

byte[2] null
byte length
char[length] node name
byte null
Kung Fu Man
n00b
Posts: 14
Joined: Thu Jul 14, 2011 6:34 am

Re: noesis Gamebryo nif importer

Post by Kung Fu Man »

After doing some work with trying to get the PS3 mask into the Xbox version of the game, I got an interesting result: the model loaded, but the textures did not. Took it a bit further and grabbed two files of the same kind. Turns out the PS3 version of the game is significantly smaller, though I'm uncertain as to why.

Here are the files in question:
http://randomselect.piiym.net/sh_resour ... r_dmg2.nif
http://randomselect.piiym.net/sh_resour ... r_dmg2.nif
Ninja
veteran
Posts: 84
Joined: Sat Feb 26, 2011 3:44 am
Has thanked: 1 time
Been thanked: 20 times

Re: noesis Gamebryo nif importer

Post by Ninja »

It's Big Endian name lengths.
The names are the same formatting as your original importer, they just using big endian instead of little endian.

Kung fu man, guess the xbox needs extra data for something special :)
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: noesis Gamebryo nif importer

Post by finale00 »

Oh, good catch. Never occurred to me that they export nif in big endian for console games lol
Kung Fu Man
n00b
Posts: 14
Joined: Thu Jul 14, 2011 6:34 am

Re: noesis Gamebryo nif importer

Post by Kung Fu Man »

So I've made a little headway fooling around with the header and seeing what will load with NifScope...currently the file format seems to be closer to 20.2.0.7 (Skyrim's) or 20.3.0.2 I can at least get SOME of the data to load, but not enough to produce a working model. Instead the results give the following:

http://randomselect.piiym.net/sh_resources/error.txt

Files used: http://randomselect.piiym.net/sh_resources/rick.rar

Dunno if that HELPS anything but I've got to try. With this much I can browse some of the data, including switches and what dds files are tied to what at least. :\
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: noesis Gamebryo nif importer

Post by MrAdults »

Who was screwing around with vertex morphs in a Noesis NIF script? Whoever it was crashed Noesis by providing vertex morphs without normals. Noesis now handles that and uses the base mesh normals (if there are any) when no morph normals are provided.

It would've been easier if whoever it was had simply posted the file and script and told me it crashed, instead of making me figure out what happened by looking up addresses and tracing backward through disassembly.
jumpjack
n00b
Posts: 14
Joined: Sat Apr 25, 2020 2:44 pm
Been thanked: 4 times

Re: noesis Gamebryo nif importer

Post by jumpjack »

I have this (and many other) very old NIF files (dated 2009), which I am not able to properly convert to other formats: I always loose textures, whatever converter I use: blender+plugin, nifskope, noesis,...
http://3dreamteamvizerra.s3.amazonaws.c ... 0.0%5D.zip

It would be also interesting to know how to properly position each file in the overall environment: this information is stored in the .xblock files in World folder, but how to implement these data in the exported file?
Post Reply