Jump to content
⚠ Known Issue: Media on User Profiles ×

[Backup] MOD format specifications from RE6


UberGrainy

Recommended Posts

Copy pasting the info here, since one of the sites with the data got wiped off the internet. Glad I save everything important.

The MOD format is largely similar to MHW's MOD3, so this info is useful for figuring out some of the data when hex editing.

 

 

mariokart64n - April 28, 2013 06:24 AM (GMT)
CAPCOM maintains an inhouse engine known as the MT Framework, used on pc, consoles and on mobile platforms. the file extension "MOD" is commonly used to describe there model content, and is what i'm interested in 'crackn' :D

you can download the PC demo here;
http://www.geforce.com/games-applications/...resident-evil-6

...there files under go changes from game to game of course, but some baseline stuff can be taken from one to the next. however I found that nobody was really sharing sources, which makes future work on CAPCOM's files difficult. Each time we want to mod a new game you need to redo the leg work of solving the file structure

SOoo I've spent the past month documenting the file format, I originally did my own work creating my own structures. then used others as a cross reference to prove or dis-prove my own structures.

So far this is what I have for the MOD found in the game ResidentEvil6. I will be using these structures when I write a tool to get new content into the game. so there maybe some changes, as these were written during the time I wrote the model importer.

** thanks to sectus, whom purchased the FULL PC game for me. and others such as howfie, codeman and chrrox who did work on the file structure on previous games

QUOTE (MOD Format) HEADER {
LONG magic // always "MOD "
SHORT version
SHORT bone_count
SHORT mesh_count
SHORT material_count
LONG num_verts
LONG num_faces
LONG num_edges // ?Howfie Describes this as: "number of triangles excluding non-planar edge geometry"
LONG Vertex_buffer_size
LONG ukn01 // always 0
LONG groups_count
LONG bone_offset
LONG groups_offset
LONG material_offset
LONG mesh_offset
LONG vert_offset
LONG face_offset
LONG filesize
FLOAT32[4] bounding_sphere
FLOAT32[4] bounding_box_min
FLOAT32[4] bounding_box_max
LONG ukn02 -- 1000, relates to an id system.
LONG ukn03 -- 3000
LONG ukn04 -- layering info, usually 1
LONG ukn05 // Null
}

BONE {
BYTE index
BYTE parent
BYTE mirror_bone // index to the opposite bone
BYTE ukn01 // always 0x00 ?
FLOAT32 ukn02 // child distance?
FLOAT32 parent_distance // distance to the parent bone
FLOAT32[3] position // position relative to it's parent
}

BONE_MATRIX1 {
MATRIX4 bone_matrix // world transform, skeleton forms with mesh
}

BONE_MATRIX2 {
MATRIX4 bone_matrix // transform relative to it's parent
}

BONE_MAP {
BYTE[256] id_slot // bone lookup table used for animation
}

GROUP_NODE {
LONG group_id // this relates to the group ids in the mesh info
BYTE[12] padding // 0xCD used as a dummy byte
FLOAT32[4] unknown // ???bounding sphere for meshes within the group
}

MATERIAL {
id_hash // hash code gets looked up in MRL
}

MESH {
SHORT Mesh_Type
SHORT Vertex_Count
BYTE Group_Index
BYTE Unknown_1 // ? usually 0
BYTE Material_Index
BYTE Level_of_Detail_Index // 0x00 = Null | 0x01 = HightPoly | 0x02 = MidPoly | 0x03 = LowPoly | 0xFF = Shadow
BYTE class // 0x09 = Hidden? | 0x11 = Hands | 0x21 = Visible
BYTE mesh_class // either body mesh, or hand mesh
BYTE Vertex_Stride
BYTE Render_Mode
LONG Vertex_Position
LONG Vertex_Offset
LONG Vertex_Format
LONG Face_Position
LONG Face_Count
LONG Face_Offset
BYTE bone_id_start
BYTE unique_boneids
SHORT Mesh_Index
SHORT Min_Index
SHORT Max_Index
LONG Hash // ?unique ID give to distinguish each mesh? ixion-saga leaves this data blank
}

WEIGHT_BOUNDING_COUNT {
LONG num_collision_objects
}

WEIGHT_BOUNDING { // bounding area for vertices effected by a boneid
LONG bone_index
BYTE[12] pad // 0xCD
FLOAT32[4] bounding_sphere
FLOAT32[4] min
FLOAT32[4] max
MATRIX4 matrix1 // relative to bone position
FLOAT32[4] ukn01
}

VERTICES { // refer to second post, each FVFtype is broken down
// Dynamic, structure described in mesh entry as fvfInfo
}
// More documentation of the discovered vertex formats found below

FACES { // only seen use of trilist, no tristrips are seen used
SHORT vertex_index // storage type described in mesh entry as meshtype
}

Discovered Types:
0x133098B0 Stride: 12
0x14A07DDB Stride: 16
0x36D0D7A7 Stride: 20
0x1580B60C Stride: 20
0x18B0FAA8 Stride: 20
0x1C201FC3 Stride: 24
0x3AA06FC6 Stride: 24
0x1AC0F6CB Stride: 24
0x287029D8 Stride: 24
0x3870A4D1 Stride: 24
0x3870A4D1 Stride: 24
0x2000D414 Stride: 28
0x29F0B449 Stride: 28
0x16C020A3 Stride: 28
0x2C207F5E Stride: 28
0x3C004EA1 Stride: 28
0x2D30A6AF Stride: 28
0x2ED06F92 Stride: 32
0x2AE06DB8 Stride: 32
0x33C09993 Stride: 32
0x21A055DA Stride: 32
0x1B8077D8 Stride: 32
0x244042BB Stride: 36
0x1F1092B3 Stride: 36
0x341068B6 Stride: 36
0x2FC0B663 Stride: 36
0x23305964 Stride: 40
0x2770CFCB Stride: 48
0x3DC0552F Stride: 64




QUOTE 0x133098B0 Stride: 12
0011 0000 0001 0011
1011 0000 1001 1000
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT boneid_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
)
example: .\data\chara\pl\pl0100\model\pl0110.mod
ukn01: 9
ukn02: 195
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 198
ukn08: 27

QUOTE 0x14A07DDB Stride: 16
1010 0000 0001 0100
1101 1011 0111 1101
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT weight_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
SHORT boneid_1
SHORT boneid_2
)
example: .\data\chara\pl\pl0100\model\pl0110.mod
ukn01: 17
ukn02: 195
ukn03: 0
ukn04: 4
ukn05: 192
ukn06: 0
ukn07: 113
ukn08: 26

QUOTE 0x36D0D7A7 Stride: 20
1101 0000 0011 0110
1010 0111 1101 0111
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
SHORT u_texture_coordinate
SHORT v_texture_coordinate
)
example: \data\id\title\opcredit.mod
ukn01: 513
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 19 --
ukn08: 26

QUOTE 0x1580B60C Stride: 20
1000 0000 0001 0101
0000 1100 1011 0110
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
BYTE boneid_1
BYTE boneid_2
BYTE boneid_3
BYTE boneid_4
BYTE weight_1
BYTE weight_2
BYTE weight_3
BYTE weight_4
SHORT u_texture_coordinate
SHORT v_texture_coordinate
)
example: .\data\chara\pl\pl0100\model\pl0100.mod
ukn01: 33
ukn02: 195
ukn03: 0
ukn04: 5
ukn05: 192
ukn06: 0
ukn07: 186
ukn08: 27

QUOTE 0x18B0FAA8 Stride: 20
1011 0000 0001 1000
1010 1000 1111 1010
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT boneid_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
SHORT u_texture_coordinate
SHORT v_texture_coordinate
)
example: .\data\chara\pl\pl0100\model\pl0100.mod
ukn01: 9
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 155
ukn08: 27

QUOTE 0x1C201FC3 Stride: 24
0010 0000 0001 1100
1100 0011 0001 1111
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT weight_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 boneid_1
FLOAT16 boneid_2
)
example: .\data\chara\pl\pl0100\model\pl0100.mod
ukn01: 17
ukn02: 67
ukn03: 0
ukn04: 6
ukn05: 192
ukn06: 128
ukn07: 158
ukn08: 27

QUOTE 0x1AC0F6CB Stride: 24
1100 0000 0001 1010
1100 1011 1111 0110
(
SHORT x_position
SHORT y_position
SHORT z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
SHORT ukn01
SHORT ukn02
SHORT ukn01
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn01
SHORT ukn02
)
example: .\data\chara\sm\sm6058\model\sm6058.mod
ukn01: 5129
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 198
ukn08: 31

QUOTE 0x3AA06FC6 Stride: 24
1010 0000 0011 1010
1100 0110 0110 1111
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
)
example: .\effect\mod\0220\md0220_00.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 218
ukn08: 27

QUOTE 0x287029D8 Stride: 24
0111 0000 0010 1000
1101 1000 0010 1001
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
)
example: .\data\fig\base\base00.mod
ukn01: 1
ukn02: 3 --
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 128
ukn07: 131
ukn08: 27 --

QUOTE 0x3870A4D1 Stride: 24
0111 0000 0011 1000
1101 0001 1010 0100
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
)
example: .\data\stage\s1100\scr\scr00\s1100.mod
ukn01: 513
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 172
ukn08: 27

QUOTE 0x37607D20 Stride: 24
0110 0000 0011 0111
0010 0000 0111 1101
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
)
example: .\data\stage\s1100\scr\scr00\s1100_enkei.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 20
ukn08: 26

QUOTE 0x2000D414 Stride: 28
0000 0000 0010 0000
0001 0100 1101 0100
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT weight_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
BYTE boneid_1
BYTE boneid_2
BYTE boneid_3
BYTE boneid_4
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 weight_2
FLOAT16 weight_3
)
example: .\data\chara\pl\pl0100\model\pl0100.mod
ukn01: 33
ukn02: 3
ukn03: 0
ukn04: 5
ukn05: 192
ukn06: 0
ukn07: 178
ukn08: 27

QUOTE 0x29F0B449 Stride: 28
1111 0000 0010 1001
0100 1001 1011 0100
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
SHORT x_tangent
SHORT y_tangent
SHORT z_tangent
SHORT w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
)
example: .\data\stage\s1100\scr\scr00\s1100.mod
ukn01: 1
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 178
ukn08: 27

QUOTE 0x16C020A3 Stride: 28
1100 0000 0001 0110
1010 0011 0010 0000
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
BYTE boneid_1
BYTE boneid_2
BYTE boneid_3
BYTE boneid_4
BYTE boneid_5
BYTE boneid_6
BYTE boneid_7
BYTE boneid_8
BYTE weight_1
BYTE weight_2
BYTE weight_3
BYTE weight_4
BYTE weight_5
BYTE weight_6
BYTE weight_7
BYTE weight_8
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
)
example: .\data\chara\em\em3800\model\em3800.mod
ukn01: 41
ukn02: 195
ukn03: 0
ukn04: 31
ukn05: 192
ukn06: 0
ukn07: 43
ukn08: 46

QUOTE 0x2C207F5E Stride: 28
0010 0000 0010 1100
0101 1110 0111 1111
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
)
example: .\data\stage\s2001\scr\scr00\jukebox_bady.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 128
ukn07: 224
ukn08: 25

QUOTE 0x3C004EA1 Stride: 28
0000 0000 0011 1100
1010 0001 0100 1110
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
)
example: .\effect\mod\000d\md000d_01.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 128
ukn07: 17
ukn08: 26

QUOTE 0x2D30A6AF Stride: 28
0011 0000 0010 1101
1010 1111 1010 0110
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
SHORT ukn01
SHORT ukn02
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn03
SHORT ukn04
)
example: .\effect\mod\00cb\md00cb.mod
ukn01: 1
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 128
ukn07: 11
ukn08: 26

QUOTE 0x2ED06F92 Stride: 32
1101 0000 0010 1110
1001 0010 0110 1111
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
BYTE r_colour
BYTE g_colour
BYTE b_colour
BYTE a_colour
)
example: .\data\stage\s2001\scr\scr00\jukebox_bady.mod
ukn01: 1
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 128
ukn07: 75
ukn08: 26

QUOTE 0x2AE06DB8 Stride: 32
1110 0000 0010 1010
1011 1000 0110 1101
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
SHORT ukn01
SHORT ukn02
)
example: .\data\stage\s0702\scr\scr00\s0702__south_Building_top.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 245
ukn08: 25

QUOTE 0x33C09993 Stride: 32
1100 0000 0011 0011
1001 0011 1001 1001
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
LONG ukn01
BYTE r_colour
BYTE b_colour
BYTE g_colour
BYTE a_colour
)
example: .\data\stage\s1208\scr\scr00\cap.mod
ukn01: 1
ukn02: 3
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 149
ukn08: 26

QUOTE 0x21A055DA Stride: 32
1010 0000 0010 0001
1101 1010 0101 0101
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
SHORT ukn01
SHORT ukn02
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn03
SHORT ukn04
SHORT ukn05
SHORT ukn06
)
example: .\data\chara\em\em1370\model\em1370.mod
ukn01: 33
ukn02: 67
ukn03: 0
ukn04: 32
ukn05: 192
ukn06: 128
ukn07: 137
ukn08: 27

QUOTE 0x1B8077D8 Stride: 32
1000 0000 0001 1011
1101 1000 0111 0111
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn01
SHORT ukn02
SHORT ukn03
SHORT ukn04
SHORT ukn05
SHORT ukn06
)
example: .\data\chara\em\em5210\model\em5210.mod
ukn01: 9
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 129
ukn08: 29

QUOTE 0x244042BB Stride: 36
0100 0000 0010 0100
1011 1011 0100 0010
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT weight_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
SHORT weight_2
SHORT weight_3
BYTE boneid_1
BYTE boneid_2
BYTE boneid_3
BYTE boneid_4
BYTE boneid_5
BYTE boneid_6
BYTE boneid_7
BYTE boneid_8
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
BYTE weight_4
BYTE weight_5
BYTE weight_6
BYTE weight_7
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
)
example: .\data\chara\em\em3800\model\em3800.mod
ukn01: 41
ukn02: 67
ukn03: 0
ukn04: 12
ukn05: 192
ukn06: 128
ukn07: 16
ukn08: 46

QUOTE 0x1F1092B3 Stride: 36
0001 0000 0001 1111
1011 0011 1001 0010
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT weight_1
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 boneid_1
FLOAT16 boneid_2
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
LONG ukn1
LONG ukn2
)
example: .\data\chara\em\em1200\model\em1200.mod
ukn01: 17
ukn02: 67
ukn03: 0
ukn04: 2
ukn05: 192
ukn06: 0
ukn07: 82
ukn08: 26

QUOTE 0x341068B6 Stride: 36
0001 0000 0011 0100
1011 0110 0110 1000
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn01
SHORT ukn02
SHORT ukn03
SHORT ukn04
SHORT ukn05
SHORT ukn06
)
example: .\data\stage\s1208\scr\scr00\cap.mod
ukn01: 5
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 23
ukn08: 26

QUOTE 0x2FC0B663 Stride: 36
1100 0000 0010 1111
0110 0011 1011 0110
(
FLOAT32 x_position
FLOAT32 y_position
FLOAT32 z_position
BYTE x_normal
BYTE y_normal
BYTE z_normal
BYTE w_normal
BYTE x_tangent
BYTE y_tangent
BYTE z_tangent
BYTE w_tangent
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
FLOAT16 u2_texture_coordinate
FLOAT16 v2_texture_coordinate
FLOAT16 u3_texture_coordinate
FLOAT16 v3_texture_coordinate
LONG ukn01
)
example: .\data\stage\s1100\scr\scr00\s1100.mod
ukn01: 1
ukn02: 67
ukn03: 0
ukn04: 1
ukn05: 192
ukn06: 0
ukn07: 170
ukn08: 27

QUOTE 0x23305964 Stride: 40
0011 0000 0010 0011
0110 0100 0101 1001
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
SHORT ukn01
SHORT ukn02
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn03
SHORT ukn04
SHORT ukn05
SHORT ukn06
SHORT ukn07
SHORT ukn08
SHORT ukn09
SHORT ukn10
)
example: .\data\chara\pl\pl0100\model\pl0100.mod
ukn01: 33
ukn02: 67
ukn03: 0
ukn04: 7
ukn05: 192
ukn06: 128
ukn07: 166
ukn08: 27

QUOTE 0x2770CFCB Stride: 48
0111 0000 0010 0111
1100 1011 1100 1111
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT w_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT w_normal
SHORT ukn01
SHORT ukn02
SHORT ukn03
SHORT ukn04
FLOAT16 u_texture_coordinate
FLOAT16 v_texture_coordinate
SHORT ukn05
SHORT ukn06
SHORT ukn07
SHORT ukn08
SHORT ukn09
SHORT ukn10
SHORT ukn11
SHORT ukn12
SHORT ukn13
SHORT ukn14
)
example: .\data\chara\em\em5210\model\em5210.mod
ukn01: 49
ukn02: 67
ukn03: 0
ukn04: 13
ukn05: 192
ukn06: 0
ukn07: 40
ukn08: 28

QUOTE 0x3DC0552F Stride: 64
1100 0000 0011 1101
0010 1111 0101 0101
(
SHORT x_position
SHORT y_position
SHORT z_position
SHORT x_normal
SHORT y_normal
SHORT z_normal
SHORT ukn01
SHORT ukn02
SHORT ukn03
SHORT ukn04
FLOAT16 u_texture_coordinate
FLOAT16 y_texture_coordinate
SHORT ukn05
SHORT ukn06
SHORT ukn07
SHORT ukn08
SHORT ukn09
SHORT ukn10
SHORT ukn11
SHORT ukn12
SHORT ukn13
SHORT ukn14
SHORT ukn15
SHORT ukn16
SHORT ukn17
SHORT ukn18
SHORT ukn19
SHORT ukn20
SHORT ukn21
SHORT ukn22
SHORT ukn23
SHORT ukn24
)

example: .\data\chara\em\em8110\model\em8110
ukn01: 35
ukn02: 3
ukn03: 0
ukn04: 6
ukn05: 192
ukn06: 128
ukn07: 83
ukn08: 30

 

 

 

Post by bastien on Apr 8, 2016 at 12:26pm
Here's documentation about Capcom's MOD format compiled from various sources, mostly research by Surveyor, revelation, chrrox, Rick and shadowmoy among others.
The research back in 2008 was useful to make good enough importers, for example, Noesis has been supporting Resident Evil 5 since then. However, the situation for exporters is a little more complicated, since some unknowns make developing tools a bit of a pain, resulting in unstable hacks to fill the unknowns, or in limitations for quality mods (e.g. materials).

The goal of this post is to continue the research to fill the unknowns, updating it with new discoveries. My focus right now is Resident Evil 5, since I'm developing a tool for a simpler import/export workflow, that hopefully can be done for other RE games. Below there's information about the structures and points I got stuck in. The more the format is figured out, the better tools can be developed.

Previous discussions:



Current tools:





  • (import) Noesis script by chroxx for Noesis, works for Resident Evil 6




----Structures (last updated: 2016-04-04)-----


Mod version 156 (Resident Evil 5)

| name | type | size |
|----------------------|------------|---------------------------------------------------------|
| id_magic | char[4] | 4 |
| version | ubyte | 1 |
| version_rev | ubyte | 1 |
| bone_count | ushort | 2 |
| mesh_count | ushort | 2 |
| material_count | ushort | 2 |
| vertex_count | ushort | 2 |
| face_count | ushort | 2 |
| edge_count | ushort | 2 |
| vertex_buffer_size | uint | 4 |
| vertex_buffer_2_size | uint | 4 |
| texture_count | uint | 4 |
| group_count | uint | 4 |
| bones_offset | uint | 4 |
| groups_offset | uint | 4 |
| materials_offset | uint | 4 |
| meshes_offset | uint | 4 |
| vertex_buffer_offset | uint | 4 |
| index_buffer_offset | uint | 4 |
| reserved_01 | uint | 4 |
| reserved_02 | uint | 4 |
| sphere_xyzw | float[4] | 16 |
| box_min_xyzw | float[4] | 16 |
| box_max_xyzw | float[4] | 16 |
| unk_01 | uint | 4 |
| unk_02 | uint | 4 |
| unk_03 | uint | 4 |
| unk_04 | uint | 4 |
| unk_05 | uint | 4 |
| unk_06 | uint | 4 |
| unk_07 | uint | 4 |
| unk_08 | uint | 4 |
| unk_09 | uint | 4 |
| unk_10 | uint | 4 |
| unk_11 | uint | 4 |
| reserved_03 | uint | 4 |
| unk_12 | ubyte[] | mod.bones_array_offset - 176 if mod.unk_08 else 0 |
| bones | Bone[] | mod.bone_count * sizeof(Bone) |
| bones_unk_1 | float[][] | float * 16 * mod.bone_count |
| bones_unk_2 | float[][] | float * 16 * mod.bone_count |
| unk_13 | ubyte[] | 256 if mod.bone_map_count else 0 |
| bone_maps | BoneMap[] | mod.bone_map_count * sizeof(BoneMap) |
| groups | Group[] | mod.group_count * sizeof(Group) |
| textures | char[] | char * 64 * mod.texture_count |
| materials | Material[] | mod.material_count * sizeof(Material) |
| meshes | Mesh156[] | mod.mesh_count * sizeof(Mesh156) |
| meshes_unk_buffer | ubyte | sum(mesh.vertex_group_count for mesh in mod.meshes) + 4 |
| vertex_buffer | ubyte[] | mod.vertex_buffer_size |
| vertex_buffer_2 | ubyte[] | mod.vertex_buffer_2_size |
| index_buffer | ushort[] | 2 * (mod.face_count) - 1 |


Mod version 210 (Resident Evil 0HD, 1HD, Revelations)

| name | type | size |
|----------------------|------------|-----------------------------------------------------|
| id_magic | char[4] | 4 |
| version | ubyte | 1 |
| version_rev | ubyte | 1 |
| bone_count | ushort | 2 |
| mesh_count | ushort | 2 |
| material_count | ushort | 2 |
| vertex_count | ushort | 2 |
| face_count | ushort | 2 |
| edge_count | ushort | 2 |
| vertex_buffer_size | uint | 4 |
| vertex_buffer_2_size | uint | 4 |
| group_count | uint | 4 |
| bones_offset | uint | 4 |
| groups_offset | uint | 4 |
| materials_offset | uint | 4 |
| meshes_offset | uint | 4 |
| vertex_buffer_offset | uint | 4 |
| index_buffer_offset | uint | 4 |
| file_size | uint | 4 |
| sphere_xyzw | float[4] | 16 |
| box_min_xyzw | float[4] | 16 |
| box_max_xyzw | float[4] | 16 |
| unk_01 | uint | 4 |
| unk_02 | uint | 4 |
| unk_03 | uint | 4 |
| unk_04 | uint | 4 |
| unk_05 | uint | 4 |
| bones | Bone[] | mod.bone_count * sizeof(Bone) |
| bones_unk_1 | float[][] | float * 16 * mod.bone_count |
| bones_unk_2 | float[][] | float * 16 * mod.bone_count |
| unk_07 | ubyte[] | 256 if mod.bone_map_count else 0 |
| groups | Group[] | mod.group_count * sizeof(Group) |
| materials | uint[][32] | 32 * 4 * mod.material_count |
| meshes | Mesh210[] | mod.mesh_count * sizeof(Mesh210) |
| meshes_unk_buffer | ubyte | sum(mesh.vertex_group_count for mesh in mod.meshes) |
| vertex_buffer | ubyte[] | mod.vertex_buffer_size |
| vertex_buffer_2 | ubyte[] | mod.vertex_buffer_2_size |
| index_buffer | ushort[] | 2 * (mod.face_count) - 1 |
| file_padding | ubyte[] | TODO |


Bone

| name | type | size |
|--------------------------|----------|------|
| anim_map_index | ubyte | 1 |
| parent_index | ubyte | 1 |
| mirror_index | ubyte | 1 |
| bone_map_index | ubyte | 1 |
| unk_01 | float | 4 |
| unk_02 | float | 4 |
| location_relative_parent | float[3] | 12 |


BoneMap

| name | type | size |
|--------|-----------|------|
| size | uint | 1 |
| values | ubyte[32] | 32 |


Group

| name | type | size |
|-------------|-------|------|
| group_index | uint | 4 |
| unk_01 | float | 4 |
| unk_02 | float | 4 |
| unk_03 | float | 4 |
| unk_04 | float | 4 |
| unk_05 | float | 4 |
| unk_06 | float | 4 |
| unk_07 | float | 4 |


Material

| name | type | size |
|------------------|-----------|------|
| unk_01 | uint | 4 |
| unk_02 | uint | 4 |
| unk_03 | uint | 4 |
| unk_04 | uint | 4 |
| unk_05 | uint | 4 |
| unk_06 | uint | 4 |
| texture_indices | uint[8] | 32 |
| unk_color_values | float[26] | 104 |


Mesh156

| name | type | size |
|----------------------|--------|------|
| group_index | ushort | 2 |
| material_index | ushort | 2 |
| constant | ubyte | 1 |
| leven_of_detail | ubyte | 1 |
| unk_01 | ubyte | 1 |
| vertex_format | ubyte | 1 |
| vertex_stride | ubyte | 1 |
| unk_02 | ubyte | 1 |
| unk_03 | ubyte | 1 |
| unk_04 | ubyte | 1 |
| vertex_count | ushort | 2 |
| vertex_index_end | ushort | 2 |
| vertex_index_start_1 | uint | 4 |
| vertex_offset | uint | 4 |
| unk_05 | uint | 4 |
| face_index | uint | 4 |
| face_count | uint | 4 |
| face_offset | uint | 4 |
| unk_06 | ubyte | 1 |
| unk_07 | ubyte | 1 |
| vertex_index_start_2 | ushort | 2 |
| vertex_group_count | ubyte | 2 |
| bone_map_index | ubyte | 1 |
| unk_08 | ubyte | 1 |
| unk_09 | ubyte | 1 |
| unk_10 | ushort | 2 |
| unk_11 | ushort | 2 |


Mesh210

| name | type | size |
|--------------------|--------|------|
| unk_01 | ushort | 2 |
| vertex_count | ushort | 2 |
| unk_02 | ubyte | 1 |
| material_index | ubyte | 1 |
| leven_of_detail | ubyte | 1 |
| unk_03 | ubyte | 1 |
| unk_04 | ubyte | 1 |
| vertex_stride | ubyte | 1 |
| unk_05 | ubyte | 1 |
| vertex_index | uint | 4 |
| vertex_offset | uint | 4 |
| vertex_format | uint | 4 |
| face_index | uint | 4 |
| face_count | uint | 4 |
| face_offset | uint | 4 |
| bone_map_index | ubyte | 1 |
| vertex_group_count | ubyte | 1 |
| unk_06 | ubyte | 1 |
| unk_07 | ubyte | 1 |
| unk_08 | ubyte | 1 |
| unk_09 | ushort | 2 |
| unk_10 | ushort | 2 |
| unk_11 | uint | 4 |


TODO: add structures of vertices

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...