Soldak Home   Drox Operative   Din's Curse   Depths of Peril   Zombasite  

Go Back   Soldak Entertainment Forums > Din's Curse > Din's Curse modding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 05-21-2012, 04:24 PM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default Model File formats

Hey Shadow

I'd like to possibly mod the models, and to convert them to Blender format.

I've figured out some of the model file format:
1. Header
2. An unknown section (possibly bones but haven't encountered a full section yet)
3. Polygon section
4. Info about points: u,v coords and normal
5. Points
6. Unknown optional section. 32 bits per point.

Could you fill in the missing gaps? Once I figure this section out I'll also check out the animation file format, so if you could provide the specs there it'd make things easier

Last edited by Bluddy : 05-21-2012 at 04:51 PM.
Reply With Quote
  #2  
Old 05-22-2012, 02:13 PM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default

OK I figured out all the formats except for the unknown 2nd section in the model file and the optional last section in the same file.
Reply With Quote
  #3  
Old 05-22-2012, 05:05 PM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 10,161
Default

Which file type are you looking at (skl, mda, mds, mdm)?
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, Drox Operative 2, & Din's Champion
Wishlist Din's Champion
Reply With Quote
  #4  
Old 05-22-2012, 05:28 PM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default

I got how the mda and mds files work, so my questions are about the mdm file.

1. Looking at the mdm files, the first section after the header does nothing in files for objects (even ones with skeletons) but does have a little bit of content in files for more complex things like monsters. This is the section before the polygons are laid out, and I can't figure out what it does. It seems to have some offsets and some other numbers.

2. Then, the mdm file has another optional section that's only available for complex objects. This section appears in the end, and there's a uint32 number for every vertex in the object. Not sure what this does either.

Those are the main things I couldn't get, but there are 2 more minor things:

3. The section that I believe has U,V and normal values per vertex has the format (I think) {float u; float v; float norm_x; float norm_y; float norm_z; uint32 number; uint32 count} where number is usually 1, 2 or 3, and count is a count of vertices that skips number from the last count. Not sure what the number and the count are for.

4. The vertex section has the format {uint32 surface; float x; float y; float z; float unknown;} and I'm not sure what unknown does. I think it's the vertex magnitude with respect to the surface but I'm not sure.
Reply With Quote
  #5  
Old 05-23-2012, 08:42 AM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 10,161
Default

The mdm format is below but it is probably easier to write out to our skl format and then use our skelConvert tool in the SDK. Skelout is a relatively simple text format.

Mdm format:

int32 identifier
int32 version;
int32 numSurfaces
int32 numTris
int32 numVerts
int32 surfacesOffset
int32 trisOffset
int32 vertsOffset
int32 weightsOffset
int32 collapseMappingsOffset

For all of the surfaces:

int32 surfaceNumber
int32 numVerts
int32 numTris
int32 vertsOffset
int32 trisOffset
int32 collapseMappingsOffset

For all of the tris:

int32 vertIndexes[ 3 ]

For all of the verts:

float32 u
float32 v
Vector3 normal
int32 numBones
int32 firstBone

For all of the vert/bone info

int32 boneIndex
Vector3 vertOffset
float32 boneWeight

Collapse mappings for each surface (these are the order to lose verts in the poly reduction stuff)

int32 vertIndex
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, Drox Operative 2, & Din's Champion
Wishlist Din's Champion
Reply With Quote
  #6  
Old 05-23-2012, 08:10 PM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default

Awesome -- thanks, it filled in the gaps I had.
Reply With Quote
  #7  
Old 05-24-2012, 10:01 AM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default

BTW for poly reduction -- is that based on the 'low model' setting?
Reply With Quote
  #8  
Old 05-24-2012, 10:26 AM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 10,161
Default

Quote:
Originally Posted by Bluddy View Post
BTW for poly reduction -- is that based on the 'low model' setting?
Yes. You can probably give a 0 as the offset and ignore the entire section though.
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, Drox Operative 2, & Din's Champion
Wishlist Din's Champion
Reply With Quote
  #9  
Old 05-02-2019, 01:55 PM
Bluddy Bluddy is offline
Legend
 
Join Date: Jan 2011
Posts: 2,062
Default

Looks like the vert section specified above has a new vector and a new float?

(For DL, btw)
__________________
Mods: DC Balance UI | DoP UI | Drox Guild Time Silence | DL Texture | Join our Discord!

Last edited by Bluddy : 05-02-2019 at 03:26 PM.
Reply With Quote
  #10  
Old 05-02-2019, 04:00 PM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 10,161
Default

Yeah, for Zombasite and Din's Legacy the vert info looks like this:

float32 u
float32 v
Vector3 normal
Vector4 tangent
int32 numBones
int32 firstBone
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, Drox Operative 2, & Din's Champion
Wishlist Din's Champion
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:08 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 - 2025 Soldak Entertainment, Inc.