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!
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 »

My hack of your code before you hacked it :)
http://pastebin.com/daiBP38B
The 3.xx header isn't much different, used byte compares to circumvent the korean letters.
The NiDataStream.1.18 loader is real ugly, need to get the correct names from the NiMesh to do it correctly.
Not come across the counter you use, it's always 01 in the models I've come across, but looking at the NiNode structure your probably correct.
There's an 01 in the 3 longs after the size data, might be another counter, if the NiNode structure is anything to go by.
You sure the 4 bytes 'data' following the counter are long and not 2 shorts?
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 »

Anything that's unknown (not assigned) is just stuff I randomly skipped over.
User avatar
Mirrorman95
ultra-veteran
ultra-veteran
Posts: 355
Joined: Tue Jul 20, 2010 2:08 am
Has thanked: 16 times
Been thanked: 24 times

Re: noesis Gamebryo nif importer

Post by Mirrorman95 »

When I tried to load a Gamebryo 20.6.5.0 file in Noesis with Tsukihime's latest plugin, it gave me this error:
Detected file type: Gamebryo
0x14060500
Traceback (most recent call last):
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 34, in noepyLoadModel
parser.parse_file()
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 356, in parse_file
self.parse_chunks(numChunks, numNodes)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 344, in parse_chunks
self.sectionNames.append(self.read_name())
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 97, in read_name
string = self.inFile.readBytes(length)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\inc_noesis.py", line 111, in readBytes
return noesis.bsReadBytes(self.h, numBytes)
MemoryError
Cleaned 8.00MB (in 2 pools).
BBSFM and KH2FM+ saves are compatible with KH2.5. viewtopic.php?t=13424
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 »

Getting bad triangles with multiple objects, but getting there slowly.
Image
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 »

Nice, I wonder if it applies to the previous formats lol
Mirrorman95 wrote:When I tried to load a Gamebryo 20.6.5.0 file in Noesis with Tsukihime's latest plugin, it gave me this error:
Detected file type: Gamebryo
0x14060500
Traceback (most recent call last):
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 34, in noepyLoadModel
parser.parse_file()
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 356, in parse_file
self.parse_chunks(numChunks, numNodes)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 344, in parse_chunks
self.sectionNames.append(self.read_name())
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 97, in read_name
string = self.inFile.readBytes(length)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\inc_noesis.py", line 111, in readBytes
return noesis.bsReadBytes(self.h, numBytes)
MemoryError
Cleaned 8.00MB (in 2 pools).
Post some of those. I don't think I have any 20.6.5.0.
User avatar
Mirrorman95
ultra-veteran
ultra-veteran
Posts: 355
Joined: Tue Jul 20, 2010 2:08 am
Has thanked: 16 times
Been thanked: 24 times

Re: noesis Gamebryo nif importer

Post by Mirrorman95 »

finale00 wrote:Nice, I wonder if it applies to the previous formats lol
Mirrorman95 wrote:When I tried to load a Gamebryo 20.6.5.0 file in Noesis with Tsukihime's latest plugin, it gave me this error:
Detected file type: Gamebryo
0x14060500
Traceback (most recent call last):
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 34, in noepyLoadModel
parser.parse_file()
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 356, in parse_file
self.parse_chunks(numChunks, numNodes)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 344, in parse_chunks
self.sectionNames.append(self.read_name())
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\fmt_Gamebryo_nif.py", line 97, in read_name
string = self.inFile.readBytes(length)
File "C:\Users\BenDesktop\Downloads\noesis\plugins\python\inc_noesis.py", line 111, in readBytes
return noesis.bsReadBytes(self.h, numBytes)
MemoryError
Cleaned 8.00MB (in 2 pools).
Post some of those. I don't think I have any 20.6.5.0.
Here are three separate NIFs for ElecTRONica Pete (one is a texture NIF):
http://www.mediafire.com/?kxlud8mt6plqh ... 4kl8r82b9a
BBSFM and KH2FM+ saves are compatible with KH2.5. viewtopic.php?t=13424
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 »

Cool, 20.6.5.0 decided to add a short right before the chunk name and use a single byte to give the length of the chunk name.
It also added a random byte right after the number of chunks.

I wonder if there are more 20.6.5.0's from a different game to compare with.

Now I'm pretty amazed at how nifskope handles all these crazy formats.
User avatar
Mirrorman95
ultra-veteran
ultra-veteran
Posts: 355
Joined: Tue Jul 20, 2010 2:08 am
Has thanked: 16 times
Been thanked: 24 times

Re: noesis Gamebryo nif importer

Post by Mirrorman95 »

finale00 wrote:Cool, 20.6.5.0 decided to add a short right before the chunk name and use a single byte to give the length of the chunk name.
It also added a random byte right after the number of chunks.

I wonder if there are more 20.6.5.0's from a different game to compare with.

Now I'm pretty amazed at how nifskope handles all these crazy formats.
Actually, NifSkope can't load this properly either. Can anything?
BBSFM and KH2FM+ saves are compatible with KH2.5. viewtopic.php?t=13424
demolos
advanced
Posts: 65
Joined: Mon Mar 12, 2007 3:38 pm
Has thanked: 5 times
Been thanked: 4 times

Re: noesis Gamebryo nif importer

Post by demolos »

I post here some nif files from Brawl busters if somebody can take a look on this files. Thanks
http://www.sendspace.com/file/lukdpd
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 »

Mirrorman95 wrote:
finale00 wrote:Cool, 20.6.5.0 decided to add a short right before the chunk name and use a single byte to give the length of the chunk name.
It also added a random byte right after the number of chunks.

I wonder if there are more 20.6.5.0's from a different game to compare with.

Now I'm pretty amazed at how nifskope handles all these crazy formats.
Actually, NifSkope can't load this properly either. Can anything?
Probably not, unless someone has been working on their own nif importer.

Nif tools team probably has been too busy with skyrim and life. I mean, I guess we ideally we should be updating their xml file with our new findings cause they can definitely handle the data better than whatever crap we throw together in a couple days...
pixellegolas
ultra-veteran
ultra-veteran
Posts: 423
Joined: Mon Aug 11, 2008 11:30 pm
Has thanked: 27 times
Been thanked: 15 times

Re: noesis Gamebryo nif importer

Post by pixellegolas »

I can try to find some nifs later when I get home, I have alot of different nif games
pixellegolas
ultra-veteran
ultra-veteran
Posts: 423
Joined: Mon Aug 11, 2008 11:30 pm
Has thanked: 27 times
Been thanked: 15 times

Re: noesis Gamebryo nif importer

Post by pixellegolas »

http://www.2shared.com/file/DESnUfAB/Nifs.html

Some mixed nifs 2.0.6 and also one 3.xx to look at from different games
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 »

Thanks for the files, much appreciated.

As far as I can tell there only seems to be 2 real differences in the model formats, the ones where the vertex, uv, normal.. data are in separate chunks, and the ones where they are mixed up together.
Apart from the oddities of adding tiny bits of data wherever they want to, the vast majority of data can be skipped easily in order to extract the models, which will probably be a game specific format.
So assuming you can use the version code to determine the game, it might be best to have one script determine which game it's from and a loader class for each 'new' game?
Not sure how to do that though.
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 »

The nif docs indicates two version numbers: the engine version, and a "user" version. These are the 8 bytes after the idstring.

If you've found two formats with identical versions but different structs for the same node...well that is a huge problem then lol.

Otherwise you can do your type-checking on all of these values, or create a more abstract parser that will determine which plugin to call, based on the versions.

Code: Select all

engine_version = readUInt()
user_version = readUInt()

if engine_version == 23...
   if user_version == "2"...
      parser = Nif_Parser_23_2()
   else
      parser = Nif_Parser_23()
elif engine_version == 26...
   ...
   parser = Nif_Parser_26()

#parse it
parser.parse_file()

Code: Select all

class Nif_Parser_23(GenericNifParser):
   
   def parse_file(self):
       #parse my file

class Nif_Parser_26(GenericNifParser):

   def parse_file(self):
       #parse my file

class Nif_Parser_23_2(GenericNifParser):

   def parse_file(self):
       #parse my file

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 »

That would be a huge problem yes, but I meant the two general major differences between different formats is the way the main data is structured, seems to be either separate chunks or all mixed up. Formatted by the NiMesh structure.

The best approach IMO is to treat each GAME as a unique format but remember they aren't that dissimilar, once you have parsers that can get data from both chunks and mixed data it's going to be relatively simple to adapt the scripts for other versions.

Plugins - is that a parser class in a separate files, that needs an include? that would be great.
Post Reply