Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 11:06

  • Please register to post and access all features, it's quick, easy and FREE!

 

Some information about model files (DIFK or KFID, not BTRF or FRTB)

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
Some information about model files (DIFK or KFID, not BTRF or FRTB)

Some months ago, i discovered how to read files that begins with DIFK (rappelz seems to use instead "KFID"), i didn't make a model importer for a 3d modeling app like blender, so if one dev wants to do that, and then create models or change them or whatever, here is the layout:

Code:
Headers:
struct KFILEHEADER {
	char masterid[4] = "DIFK";
	char type[4] = "NIBK";
	int master_version = 1;
	int sub_version = 0;
	int nblocks;
	char reserved[108];
}

struct KFILEBLOCK {
	char blockid[4] = "KLBK";
	int blocksize;
	char reserved[24];
}

block:

enum MagicType {
	CLASSTYPEID_NONE = 0x00,
	CLASSTYPEID_WORD = 0x28,
	CLASSTYPEID_DWORD = 0x29,
	CLASSTYPEID_FLOAT = 0x2A,
	CLASSTYPEID_CHAR = 0x2C,
	CLASSTYPEID_UCHAR = 0x2D,
	CLASSTYPEID_STRING = 0x33,
	CLASSTYPEID_ARRAY = 0x34,
	CLASSTYPEID_TEMPLATE = 0x1F
}

struct GUID {
	char raw[16];
};	//see _GUID structure at msdn

struct Template_Element_t {
	MagicType magic = CLASSTYPEID_TEMPLATE;
	GUID guid;
	int array_elements_number;
	array_element_type elements[array_elements_number];
}

struct UChar_Element_t {
	MagicType magic = CLASSTYPEID_UCHAR;
	unsigned char value;
}

struct Char_Element_t {
	MagicType magic = CLASSTYPEID_CHAR;
	char value;
}

struct Float_Element_t {
	MagicType magic = CLASSTYPEID_FLOAT;
	float value;
}

struct Int_Element_t {
	MagicType magic = CLASSTYPEID_DWORD;
	int value;
}

struct Word_Element_t {
	MagicType magic = CLASSTYPEID_WORD;
	short value;
}

struct String_Element_t {
	MagicType magic = CLASSTYPEID_STRING;
	int string_size;
	char string_data[string_size];
}

struct Array_Element_t {
	MagicType magic = CLASSTYPEID_ARRAY;
	MagicType array_type_magic;
	int array_elements_number;
	String_Element_t size_field_name;	//no magic for this string
	array_element_type elements[array_elements_number];
}

struct TemplateArray_Element_t {
	MagicType magic = CLASSTYPEID_ARRAY;
	MagicType array_type_magic = CLASSTYPEID_TEMPLATE;
	GUID template_guid;
	int array_elements_number;
	String_Element_t size_field_name;	//no magic for this string
	array_element_type elements[array_elements_number];
}
where a file is:
Code:
KFILEHEADER {
	array of KFILEBLOCK {
		elements (one of the structure ending with Element_t, there maybe several elements here, but usually, there is only one template which is a header (like cob_header_v11 for .cob files), see *.tml for template contents)
	}
}



glandu2 is offline  
Thanks
12 Users
Old   #2
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
Here is a zip with anatema model described with text and nx3.tml & nobj.tml to know templates names

naf files seems to contain templates described in nx3.tml (tml files are text files)

all data should be exportable/importable in a known format, as these files contain all data needed to know animation/bones/vertex/normals/texture/...
Attached Files
File Type: zip anatema.zip (459.0 KB, 245 views)


glandu2 is offline  
Thanks
6 Users
Old   #3
 
elite*gold: 0
Join Date: Aug 2012
Posts: 312
Received Thanks: 252
Thanks you a lot for your help glandu
I'm hopefull for make a converter into FBX or OBJ. Make an exporter will be a litlle bit harder but not impossible

Just a litlle sample in OpenGL
You must register and activate your account in order to view images.
gr4ph0s is offline  
Thanks
7 Users
Old   #4
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
and the full model fully textured

With the help of Gr4ph0s

In fact, rappelz use indexes for the faces, that's why we had weird faces before.

You must register and activate your account in order to view images.


glandu2 is offline  
Thanks
10 Users
Old   #5
Moderator
 
elite*gold: 1
Join Date: Dec 2012
Posts: 3,004
Received Thanks: 958
This is such a huge step guys.

Great work on the modeling, now I am going to have to brush up on my blender skills.

(Read it as convert my Solidworks and Cad skills to Blender and Meshes)
ThunderNikk is offline  
Old   #6
 
elite*gold: 0
Join Date: Aug 2012
Posts: 312
Received Thanks: 252
We are currently working on a .3ds file. Simply because is supported by many tool and it's support animation.

OBJ is great but can't have animation data :/

just a litlle sneak peek
Attached Files
File Type: zip anatema.zip (128.3 KB, 121 views)
gr4ph0s is offline  
Thanks
3 Users
Old   #7
 
elite*gold: 0
Join Date: Jun 2013
Posts: 45
Received Thanks: 31
Really amazing work, keep going. Maybe this scene won't die with some interesting developments as such.
TealSky is offline  
Thanks
2 Users
Old   #8
 
elite*gold: 0
Join Date: Apr 2010
Posts: 389
Received Thanks: 289
I wish I could help .

galndu , this is one great step in rappelz development as thndr said .
Strange2010 is offline  
Old   #9
 
elite*gold: 0
Join Date: Nov 2011
Posts: 104
Received Thanks: 11
Nice work!
sadkingbilly is offline  
Old   #10
 
elite*gold: 0
Join Date: Mar 2008
Posts: 939
Received Thanks: 515
rappelz dev really never dies it just takes breaks
wisp66 is offline  
Thanks
4 Users
Old   #11
 
elite*gold: 0
Join Date: Aug 2012
Posts: 312
Received Thanks: 252
Working on BTRF file (90% of rappelz 3d model)

Same things than the KFIle I need to find face information

You must register and activate your account in order to view images.
gr4ph0s is offline  
Thanks
1 User
Old   #12
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
I have now discovered how BTRF files are layered, here is an explanation using structures:

Code:
struct Header
{
	int frtb_signature = "BTRF";
	int header_size = 4;
	short major_version = 1;
	short minor_version = 1;
        TemplateTable usedTemplates;
        StringTable usedStrings;
        DataBlocks data;
}

struct TemplateTable
{
	int id_table_size;
	implicit int template_number = id_table_size/18;	//truncated
	_GUID templates_guids[template_number]
	short templates_field_number[template_number];	//used field in template are from 0 to this value

	char padding[] = "12...";
}

struct StringTable
{
	int string_table_size;
	int string_num;
	char strings[];	//strings are separated by \0 and there is string_num strings

	int wstring_num;
	wchar_t wstrings[];	//same as strings, seems never used 

	char padding[] = "12..";   //use string_table_size to know where the next data begin
}

struct DataBlocks {
        int struct_size;
        int number_of_root_blocks;
        RootBlock  rootBlocks[number_of_root_blocks];
}

struct RootBlock {
	char dummy[3];
	block_type field_type;	//should be always 0x9: template
	int block_size;
	short template_id;
	Block data;
}

union Block {
	TemplateBlock tb;
	TemplateArrayBlock tab;
	FieldBlock fb;
	FieldArrayBlock fab;
}

struct TemplateBlock {
	Block sub_blocks[templates_field_number[template_id]];
}

struct TemplateArrayBlock {
	int block_size;
	short template_id;
	int count;
	struct TemplateArrayElement {
		int element_size;
		TemplateBlock template_data;
	}[count];
}

struct FieldBlock {
	void *data;	//normal representation, float = 4 byte, char  = 1 byte,  ...
}

struct FieldArrayBlock {
	int block_size;
	char type;
	<type> data[(block_size-1)/sizeof(<type>)];
}

//Fixed size arrays are represented as FieldBlock[fixedSize]
In BTRF files, there is a limited amount of types information, so the tml file is needed to be able to read a BTRF file (to know data size or data arrays, ...)

There is also a version 1.0 incompatible with this version (1.1), but I never saw a file using that version. So now all model files format are known

Here is keberoslv3_body.nx3
You must register and activate your account in order to view images.

The BTRF format is also used by intro videos as .jtv and DIFK for some .spr files but I didn't tried to read them.

And there your axe Gr4ph0s It's a new one from the 8.2 epic ? Didn't found it before updating my client to 8.2
You must register and activate your account in order to view images.

(For these file, I had to mirror the texture's Y coord, that was not the case for the DIFK files. The texture in the zip file is already mirrored)
(Also, blender seems to have difficulties to use some dds textures for the realtime rendering, it was not mapping correctly the texture (but the non realtime renderer was performing correctly the texture mapping). To help blender, I converted the dds texture to a tga one and changed the dae file (it's a xml file in fact))
glandu2 is offline  
Thanks
14 Users
Old   #13
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
AS I see, I forgot to add the attachment (forgot to clik on "upload" button ...) so there it is.

I also added butkadah files (naf, cob, nx3 and some dds) and associated text file describing their content.

mechanic_butkadah.nx3.dae should be working (but arms are missing)
Using the text file, it's possible to have a fully working butkadah model with bones and skeletal animations.

The collada file format (.dae) is in fact not so bad as it seems to be a good way to share models with animation with several 3D modeler (including blender as I only have it)
Attached Files
File Type: zip model_data.zip (2.43 MB, 257 views)
glandu2 is offline  
Thanks
2 Users
Old   #14
 
elite*gold: 0
Join Date: Nov 2010
Posts: 16
Received Thanks: 0
bump!!

any script release for blender?
csharpLove is offline  
Old   #15
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
No script for blender or any other 3d model software, it's too specific for each software. I use collada format which seems to be the best format to share 3d model with all decent software (3dsmax, Maya, Blender, ...)

But this format is very verbose, and maybe cause some bug when importing in other software than Blender (which is what I use)

Also, I found that newest versions of Blender don't import correctly the collada file (.dae) And texture are missing. The version 2.64 works fine (available here: )

So here is the model file exporter, it's a console application.

In cmd, type "BTRFReader" without parameter to show the help screen.
Parameters in "[" and "]" are optional.
You must have nx3.tml and nobj.tml in the current directory to be able to read .cob, .nx3 and .naf files. (they are provided with the BTRFReader)

Virus Total:
Attached Files
File Type: zip BTRFReader.zip (237.9 KB, 203 views)


glandu2 is offline  
Thanks
11 Users
Reply



« Previous Thread | Next Thread »

Similar Threads
about the 2012 new pets model files and the weapon model files!
who can tell me how to add the new pets in silkroad?and who can tell me how te add the new weapons silkroad? who can share 2012 new pets model...
2 Replies - SRO PServer Ask the Experts
BTRF programm
Do you have a programm to depcryp the btrf file encrypt thx :handsdown:
0 Replies - Rappelz Private Server
Model files
How to open 3do file 3ds max7 or 12? Pls link plugin or tutorial! Sorry form my bad english! I am hungarian.
2 Replies - Shaiya Private Server
Character Model files and textures
Where are they. More specifically wheres the texture for Seekers Grandark. if there is a guide or tut for finding and extracting specific model...
4 Replies - Grand Chase
Opening the Shaiya model files
I have ZS's Shaiya Data Extractor. Looks like Shaiya models are in .3DC format. Is there a plugin for 3Ds Max 2009 (32 bit) that will open those? ...
14 Replies - Shaiya



All times are GMT +2. The time now is 11:06.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.