RelicNews Forums

Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards > Archive Dump
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Reply
 
Thread Tools
Old 9th Sep 06, 7:46 AM Forum Rules   # 1
4E534B
Senior Member
 
Join Date: May 2006

MAD File Format

Hopefully this is complete ( ie I didn't miss any chunk )

Code:
########################################################################################################################## ---- General format ---- FORM -> 'MAD ' chunk -> -> NAME chunk -> -> VERS chunk -> -> INFO chunk -> -> STRI chunk -> -> MARK chunk -> -> CURV chunk ---- end ---- ---- NAME FORM ---- "NAME" <length of this form, in bytes, BE>, {ulong} <name of this MAD, this is "Homeworld2 MAD File" ---- end ---- ---- VERS FORM ---- "VERS" <length of this form, in bytes, BE>, {ulong} <version, this is 260, consider it as 0x04010000, LE>, ulong ---- end ---- ---- INFO FORM ---- "INFO" <length of this form, in bytes, BE>, {ulong} <fps, WHOLE NUMBER, LE>, {ulong} <number of Anim MARKers, LE>, {ulong} <number of Anim CURVes, LE>, {ulong} <number of joint maps, LE>, {ulong} <number of indices (?), LE>, {ulong} ---- end ---- ---- STRI FORM ---- "STRI" <length of this form, in bytes, BE>, {ulong} <null terminated strings ( NOT starting with a null,. AND LAST ONE HAS A NULL )>, {char} ---- end ---- ---- MARK FORM ---- "MARK" <length of this form, in bytes, BE>, {ulong} for each marker ( defined in INFO form): <start time, LE>, {float} <end time, LE>, {float} <loop start time, LE>, {float} <loop end time, LE>, {float} <number of joints animated, LE>, {ulong} for each joint: <name, this is String Block Offset in the STRI form, starting zero, and ending is first NULL, LE>, {ulong} <number of channels animated, LE>, {ulong} for each channel: <number of indices, LE>, {ulong} ---- end ---- ---- CURV FORM ---- "CURV" <length of this form, in bytes, BE>, {ulong} for each animation CURV: <name, this is String Block Offset in the STRI form, starting zero, and ending is first NULL, LE>, {ulong} <number of key-frames, LE>, {ulong} for each keyframe: <time, LE>, {double} <value, LE>, {double} <inTangentX, LE>, {float} <inTangentY, LE>, {float} <outTangentX, LE>, {float} <outTangentY, LE>, {float} <Pre-Infinity, LE>, {float} <Post-Infinity, LE>, {float} ---- end ---- ##########################################################################################################################


And a VB module:
Code:
Option Explicit Global Const HW2_FORMID = "FORM" Global Const HW2_MAD_ID = "MAD " Global Const HW2_NAMEID = "NAME" Global Const HW2_VERSID = "VERS" Global Const HW2_INFOID = "INFO" Global Const HW2_STRIID = "STRI" Global Const HW2_MARKID = "MARK" Global Const HW2_CURVID = "CURV" Global Const HW2_MADFile = "Homeworld2 MAD File" Global Const HW2_MADVERS As Long = 260 ' or [HEX:04010000] Type HW2_NAMEForm ID As String * 4 ' This is "NAME" formLength As Long ' length of this form name As String ' name of MAD. This is HW2_MADFile End Type Type HW2_VERSForm ID As String * 4 ' This is "VERS" formLength As Long ' length of this form version As Long ' this is 260 or [HEX:04010000] End Type Type HW2_INFOForm ID As String * 4 ' This is "INFO" formLength As Long ' length of this form fps As Long ' frames per second noMarkers As Long ' number of Markers noCurves As Long ' number of animation curves noJointMaps As Long ' number of joint maps (?) noIndices As Long ' number of indices {?} End Type Type HW2_STRIForm ID As String * 4 ' This is "STRI" formLength As Long ' length of this form stringData As String ' STRI data. Offset is used, so a single ' huge string instead of many messes arrays ' of strings End Type Type HW2_MARKChannel noIndices As Long ' number of indices End Type Type HW2_MARKJoint stringBlockOffset As Long ' name. numChannels As Long ' number of channels channels() As HW2_MARKChannel ' channel data End Type Type HW2_MARKMarker startTime As Single ' anim start time endTime As Single ' anim end time loopStartTime As Single ' loop start time loopEndTime As Single ' loop end time numJoints As Long ' number of joints animated joints() As HW2_MARKJoint ' joint data End Type Type HW2_MARKForm ID As String * 4 ' This is "MARK" formLength As Long ' length of this form markers() As HW2_MARKMarker ' marker data End Type Type HW2_CURVKeyframe time As Double ' time value As Double ' value inTangentX As Single ' In-Tangents and Out-Tangents inTangentY As Single ' X and Y outTangentX As Single outTangentY As Single End Type Type HW2_CURVCurve stringBlockOffset As Long ' name. numKeyframes As Long ' number of keyframes keyframes() As HW2_CURVKeyframe ' keyframe data preInfinity As Long ' Pre Infinity postInfinity As Long ' Post Infinity End Type Type HW2_CURVForm ID As String * 4 ' This is "CURV" formLength As Long ' length of this form curves() As HW2_CURVForm ' animation CURVe data End Type

Last edited by 4E534B : 9th Sep 06 at 8:32 AM.
4E534B is offline  
Reply



Go Back   RelicNews Forums > RDN - Relic Game Mods > Homeworld 2 - Tanis Shipyards > Archive Dump
User Name
Password
Register FAQ Members List Arcade Mark Forums Read



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 -7. The time now is 4:53 AM.

Page generated in 0.16836095 seconds (82.48% PHP - 17.52% MySQL) with 9 queries

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.