Page 3 of 6

Re: Dark Sider 2 Model?

Posted: Mon Aug 27, 2012 9:49 am
by amzerof6
finale00, you're awsome!!that's great job,thank u so much.
here, I uploaded some files,hope them can help you.

https://rapidshare.com/files/560451903/ ... bsolom.zip
https://rapidshare.com/files/475632349/ ... one_00.zip
https://rapidshare.com/files/3329364758/items.rar

Re: Dark Sider 2 Model?

Posted: Mon Aug 27, 2012 3:00 pm
by S0UZ
finale00 wrote:Can someone upload some more? Thanks.
The dcm file is straightforward for the most part. Just need to identify what the structs are (might not be as straightforward)

Image
Here's a quick layout of the file. I didn't look into the structures.
Noesis plugin in my dropbox. If you want to continue with that just go ahead.

Code: Select all

struct dcm_file {
   int[5]
   int[2]
   int
   float
   short
   int[5]
   float[6] bbox?
   byte
   short len
   byte[len] meshName?

   int
   int
   int numVerts
   int
   int numIdx
   int
   int index_buffer_size # numIdx * 2
   int index_size # 2

   short[numIdx] indices
   numVerts Vertex
   numVerts Unk1
   numVerts Unk2

   #EOF
}

struct Vertex {
   float[3] x, y, z
}

struct unk1 {
   20 bytes
}

struct unk2 {
   16 bytes
}
amzerof6 wrote: I upload some files, include dcm&dds .....thank a lot for those great tools

https://rapidshare.com/files/2330191840 ... axea01.zip
Thanks, now the data makes a lot more sense...
Incredible man,hope the progress won't make more trouble for you and will be completed soon!

Re: Dark Sider 2 Model?

Posted: Wed Aug 29, 2012 2:23 am
by logansan25
Nice guys. :]

Re: Dark Sider 2 Model?

Posted: Fri Aug 31, 2012 9:47 pm
by TaylorMouse
See you've been busy Finale00!

Good job!

I've been on the ranch for the last 10 days, no internet there :/

Anyways, had a good time with the ponys :)

I noticed that only the weapons work, and the tris are inverted.

But not complaining :)

EDIT: Added death himself :)


T.

Re: Dark Sider 2 Model?

Posted: Fri Aug 31, 2012 10:28 pm
by finale00
Ya I didn't actually do much. Just looked at it wrote down some structures and then threw up a pic.
Some people sent me some models which is good, though I haven't actually looked at them.

Re: Dark Sider 2 Model?

Posted: Sat Sep 01, 2012 9:07 pm
by TaylorMouse
I did the import in MAX,

and when I read the faces ( tris)

Code: Select all

for (int i = 0; i < nFaces / 3; i++)
                    {
                        faces.Add(new Triangle()
                        {
                            a = br.ReadInt16() ,
                            b = br.ReadInt16() ,
                            c = br.ReadInt16() 
                        });
                    }
I had to flip the faces in max so I switched it to

Code: Select all

for (int i = 0; i < nFaces / 3; i++)
                    {
                        faces.Add(new Triangle()
                        {
                            a = br.ReadInt16() ,
                            c = br.ReadInt16() ,
                            b = br.ReadInt16() 
                        });
                    }
so that b & c are switched and the model came out ok

T.

Continuing the research :)

Re: Dark Sider 2 Model?

Posted: Sat Sep 08, 2012 8:28 pm
by TaylorMouse
Any progress to this??

T.

Re: Dark Sider 2 Model?

Posted: Mon Sep 10, 2012 9:15 pm
by TaylorMouse
I found out that the models ( animated once ) start with a chunk, unkown to me yet, but then follows al set of bones

Code: Select all

struct Bone
{
	int16 lenName			// length of bone name
	string boneName x 		// bone name
	69 bytes				// bone data 
		// always ends with FF
}

struct vfx
{
   int16 len;
   string name;
   25 bytes
}
and after this set of bone definitions, the same structure appears as in the weapons (ref absolom_axea01.dcm)
for the faces... but not for the vertices.;
:/

really want to beat this one...

T.

Re: Dark Sider 2 Model?

Posted: Tue Sep 18, 2012 7:28 pm
by TaylorMouse
Stuck here ...

Any help is welcome...

T.

Re: Dark Sider 2 Model?

Posted: Tue Sep 18, 2012 11:47 pm
by TaylorMouse
Been figuring out some of the dcm files ...
I'm not saying this will work with all of them, but I based it on death.dcm, emberhulkA01.dcm and exhumeA1.dcm..

although the last file does not seem to have any bone data....

Code: Select all

struct Header
{
	Uint32 start 				// start position of the mesh data
	UInt32 nbrSubmeshes
	
	UInt32 submeshSets 			
	IndexSet[submeshSets] nIndices 	
	
	UInt32 vertexSets
	VertexSet[vertexSets] vertices
	
	byte[4] ffff
	Uint32 zero1
	Uint32 zero2
	byte[2] one
	
	UInt32 nVertices
	
	UInt32 unk
	UInt32 unk
	UInt32 unk
	
	UInt16 nBones
	Uint32 zero3
	
	
	
	...
	
	byte ff
}

struct IndexSet
{
	UInt16 nIndices
	UInt16 zero
}
struct VertexSet
{
	UInt16 nVertices
	UInt16 unk // FF
	
}


struct Bone
{
	int16 lenName			// length of bone name
	string boneName x 		// bone name
	// 69 bytes				// bone data
	float[3] 	unk1
	UInt32 		unk2 		// zero
	float[3] 	unk3
	UInt32 		unk4 		// zero
	float[3] 	unk5
	UInt32 		unk6 		// zero
	float[3] 	unk7
	UInt16 		unk8 		// zero
	Int16 		unk9
	Int16		unk10 
	UInt16 		unk11 		// zero
	byte		ff  		// FF or -1
	
}

struct Vfx
{
	int16 lenName			// length of visual fx name
	string fxName			// fx name
	//25 bytes				// fx data
	UInt32 	unk
	Uint32 	zero2
	Int16  	unk1
	Int16 	zero3
	Uint32 	zero4
	Int16 	unk2
	Int16 	zero5
	Uint32 	zero6
	byte	ff 				// always ends with FF
	
}

struct ModelData
{
	UInt32 chunkSize
	Uint32 chunkId
	Int16[nIndices] faceData
	
	float[nVertices] vertexData
	
}

Just hypothetically, nothing coded yet...

T.

Re: Dark Sider 2 Model?

Posted: Wed Sep 19, 2012 12:58 am
by finale00
Fortunately for you there are two types of models and their headers themselves are different slightly.
Of course, the vertex struct is completely different.

If you look at the absolom axe, you'll see it has the number of indices per mesh, followed by a single integer representing that many indices. Then you read the number of vertices per mesh...and then you read a signed int16 whose absolute value is the number of vertices. But then you read a short, an int -1, and then you read another integer which is the number of verts (except it's not negative).

Then you look at a model that you wrote with bones and it's different from what I said.

Presumably it's a difference between skinned/static meshes. Static meshes have a plain position buffer 3-floats each, while skinned meshes have this odd struct

Code: Select all

struct SkinnedVertex {
   int ?
   float[3]
   float[3]
   float[3]
   float[3]
}
The int might be a bone ID, don't know.

The format for each mesh is

Code: Select all

struct SkinnedMesh {
   int32 datasize (numIdx * 2)
   int32 structSize (2)

   int16[numIdx] idxBuff
   numVerts * 12 bytes
   numVerts Vertex
   numVerts * 16 bytes (a bunch of floats and zeroes)
   numVerts * 4 bytes (a byte of bytes)
}
Image

I've uploaded a copy of the plugin I wrote, except it ONLY loads skinned meshes since I didn't parse the header lol

Re: Dark Sider 2 Model?

Posted: Wed Sep 19, 2012 3:45 am
by finale00
Ok the header is actually not what I thought it was.

After the index counts for the meshes, you then have number of vertex counts, followed by vertex counts.
However, this part is kind of weird. It looks like this

Code: Select all

signed numVertCount
numVertCount {
   signed int32 numVerts
}

signed numVertCount2
numVertCount2 {
   signed int32 numVerts
   float ??
}
I don't understand why it's a signed value really, but if it's negative you just have to take the absolute value to get what you want. So I would probably just read everything as absolute signed integers.

Afterwards, you have the following struct that loops mesh times (the second integer). I guess these are the actual mesh structs, each holding references to the material it uses, the bones that are attached, and other things. The mesh data itself is stored afterwards.

Code: Select all

struct {
  byte modelType # 0 or 1, static or skinned
  byte ?
  int numVerts
  int ?
  int ?
  int numSubMesh
  int numBones
  float[6] bbox
  numBones {
     byte ??
     int len
     byte[len] name
     float[16] matrix
     int ??
  }

  numSubMesh {
     byte ??
     int len
     byte[len] submesh name?
     int matNum
     int ?
     int numVerts
     int vertStart
     int numIdx
     int idxStart
  }
}
The idxStart and vertStart should be clear what they are for.

And then now you are at the start of the mesh data (offset stored in the first integer of the file)
I have updated my script to load pretty much all of the models without crashing.

Re: Dark Sider 2 Model?

Posted: Wed Sep 19, 2012 4:52 pm
by amzerof6
wow,amazing,finale00 !! I try your noesis plugin,most of model are fine,chars\item\world they all fine, just a few of them had error.
I must say that, thank u,thank u,thank u!!!!

I think .bmat include date of materials; .o3d include skin or bones ; .psystem is anim
Honest, just model & materials with UV that can satisfy me.

thanks again, if you need anything, just say it, I'll try my best.

Re: Dark Sider 2 Model?

Posted: Wed Sep 19, 2012 6:53 pm
by TaylorMouse
Damn!! I wanted to beat this one :D

But.. Finale00, nice one

T.

Re: Dark Sider 2 Model?

Posted: Wed Sep 19, 2012 7:17 pm
by amzerof6
TaylorMouse wrote:Damn!! I wanted to beat this one :D

But.. Finale00, nice one

T.
never give up ,man. darksider1 still no one done it. :wink: