Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Age of Wulin models

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

Age of Wulin models

Post by finale00 »

The contents of this post was deleted because of possible forum rules violation.
Last edited by finale00 on Thu Jan 05, 2012 10:41 am, edited 4 times in total.
User avatar
CriticalError
double-veteran
double-veteran
Posts: 678
Joined: Sun Jul 05, 2009 2:03 am
Has thanked: 104 times
Been thanked: 41 times

Re: Age of Wushu XMOD models

Post by CriticalError »

nice one finale, thanks a lot to you and aluigi for unpacker :D
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: Age of Wushu models

Post by finale00 »

There are different mesh types and different vertex types.

The first four bytes are the idstring XVAM.
Then the 5th byte might be a 1 or a 2. The mesh follows a different struct depending on the value.
So far I think 1 means unskinned while 2 is skinned.

After each mesh name, there's an integer, and then another 4 bytes. This seems to determine the size of the vertex (32 bytes, 36 bytes, or 56 bytes).

I don't have all of the files with me so I'm not sure if there's more values to look at it, but so far I've managed to parse geometry from files that only have one mesh.

Bones are there in the XMOD, but I can't seem to find any bone transforms.
And I don't have the entire game with me so maybe I might have left that those somewhere else...

Image
Last edited by finale00 on Thu Jan 05, 2012 10:41 am, edited 1 time in total.
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: Age of Wulin XMOD models

Post by finale00 »

So I've found 7 vertex types so far: 24, 32, 36, 40, 44, 56, 64 bytes.
There is some flag that determines whether the model has bones/weights or not.
There is some flag that determines what kinds of textures the model uses (diffuse, specular, and/or normal)

Depending on some flags, the material section will have varying amount of floats (I guess these are related to the material, depending on what is actually used)

The real problem is what each value means, and which combination results in what.
Looking at a single value is not enough to determine things like vertSize.

The format is something like

Code: Select all

Header
Model information including 4 special bytes

numMesh {
   Mesh information { (with 4 special bytes)
       vertices
       indices
       weights (maybe)
       bones (maybe)
       Material
   }
}
This is a portion of the table that I put together while searching for patterns amongst those "special bytes"
vb1 to vb4 are the bytes in the model header. mb1 to mb4 are the bytes in each mesh. Note that vb and mb values are in hex, while vertSize is in decimal (cause I typed that one)

Image

The flag I called "mb2" takes on values 0x4, 0x14, 0x54, 0x74, and 0x94. And 0x15 for some reason.
0x4 means there are no textures.
0x14 means there is a diffuse texturemap.
0x54 means there is a diffuse and also specular texturemaps
0x74 means there is diffuse, specular, and normal texturemaps.
0x94 has diffuse and specular, but then followed by two integer 0's.



Certain combinations of bytes guarantee certain pieces of information, so the parser code is basically full of conditional statements checking a bunch of these combinations that I've come across. And I've only looked at the outfits! Haven't even touched the items and weapons and decorations.

But ok, at the very least the models aren't faceless anymore...

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: Age of Wulin XMOD models

Post by finale00 »

Well, this is quite fortunate.
I was looking through the gm2 files and found some text files that the devs probably left behind. Although there are only 5 and in the same folder (among the hundreds of folders).

It is a pretty simple file, but it makes some things quite clear (although even if I know what the data represents, I still don't know what it actually does lol)

Example:

objects' numbers: 4
{
object0's name: Huotan0903
object1's name: Huotan0900
object2's name: Huotan0901
object3's name: Huotan0902
}
textures' numbers: 4
{
texture0's name: gybaitan001gh.dds
texture1's name: sst001_dqg.dds
texture2's name: jyhuotanhww005.dds
texture3's name: jyhuotanhww004.dds
}
materials' numbers: 4
triangles' numbers: 2630, vertices' numbers: 2563
2-sided triangles' numbers: 325
bbox_size: 4.820763,3.562109,3.108685, radius: 3.285993
traverses/vertex: 101.595947, max depth: 69

Code: Select all

#Age of Wulin GM2 model outline

#A single model may contain multiple meshes.

#Each mesh defines the number of vertices and faces that make up the mesh.

#The index and vertex buffers follow afterwards, for all of the meshes
#(so you need to store the individual numbers somewhere when you parse it)

#You need to know the total number of faces and vertices.

#The size of the vertex is determined by vertSectionSize / totalVertex, where the section size is given to you
#before you start parsing the vertices

Basic idea of the format

Header
Material/Mesh names

Material 1
Material 2
...

Mesh 1
Mesh 2
...

All indices
All vertices

==========================================================

struct Header {
	char[4] idstring "60.1"
	dword
	dword matSectionSize
	dword numNames
	dword numMat
	dword numMesh
	dword
	dword
	dword
	dword total Faces
	dword
}

struct unkStruct {
	dword[2]
	float[3]
	dword[6]
	dword[3]
}

struct Vertex {
	// standard vertex info.
	// Varies depending on the size of the vertex
}

struct Mesh {
	
	dword[3]
	float[4]
	dword
	dword numFaces
	dword
	dword numVerts
	byte[64] just_skip_it
}

struct File {
	Header
	float_3 bboxMin
	float_3 bboxMax // or maybe the other way around
	float radius
	
	numName {
		string_0 name // null-terminated strings
		// usually matName, texName, ?, meshName but sometimes different...
	}
	
        dword 
	############
	dword[??] integers // see below
	############
	
	numMesh unkStruct // I don't know
	numMesh Mesh 
	
	word[TotalFaces * 3] indices
	dword ???
	dword vertSectionSize
	totalVerts Vertex
}
For the ############# section, I just wrote this

Code: Select all

if numMesh == numMat
   dword[4*numMesh]
else
   dword[3*numMat]
Still not perfect with some files, but at least it renders most of them properly.
Now to figure out how the names (mats, tex, meshes) work...

Here's a temple

Image

The entire map can be built just by loading up all of the models into one scene (although it will take some time...)
You do not have the required permissions to view the files attached to this post.
lkw019
veteran
Posts: 96
Joined: Mon Jul 18, 2011 2:22 pm
Has thanked: 14 times
Been thanked: 1 time

Re: Age of Wulin models

Post by lkw019 »

flip model ?

Image

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: Age of Wulin models

Post by finale00 »

Ya, for some reason all of the models I view are flipped.
For EVERY game I've tried lol

I don't know why.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Age of Wulin models

Post by howfie »

Probably lhs rhs thing.
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: Age of Wulin models

Post by finale00 »

Hmm well I do remember seeing something about some left-hand right-hand coordinate system but don't know how I should be changing how I draw the model lol
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Age of Wulin models

Post by howfie »

when parsing, negate one of the x, y, or z coordinates. typically z. noesis is opengl and RHCS. directx is LHCS. depends on the rendering api.
lkw019
veteran
Posts: 96
Joined: Mon Jul 18, 2011 2:22 pm
Has thanked: 14 times
Been thanked: 1 time

Re: Age of Wulin models

Post by lkw019 »

i open gm2 is err, please hlep , thanks
You do not have the required permissions to view the files attached to this post.
lkw019
veteran
Posts: 96
Joined: Mon Jul 18, 2011 2:22 pm
Has thanked: 14 times
Been thanked: 1 time

Re: Age of Wulin models

Post by lkw019 »

huotan09.gm2 is ok ...
You do not have the required permissions to view the files attached to this post.
lkw019
veteran
Posts: 96
Joined: Mon Jul 18, 2011 2:22 pm
Has thanked: 14 times
Been thanked: 1 time

Re: Age of Wulin models

Post by lkw019 »

:?:
You do not have the required permissions to view the files attached to this post.
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: Age of Wulin models

Post by finale00 »

Fatduck has support for this game in his max importer.

viewtopic.php?f=33&t=7901
lkw019
veteran
Posts: 96
Joined: Mon Jul 18, 2011 2:22 pm
Has thanked: 14 times
Been thanked: 1 time

Re: Age of Wulin models

Post by lkw019 »

finale00 wrote:Fatduck has support for this game in his max importer.

viewtopic.php?f=33&t=7901

where ... :?:
You do not have the required permissions to view the files attached to this post.
Post Reply