Page 1 of 2

MechAssault 2: Lone Wolf / .mgf format

Posted: Mon Oct 29, 2012 6:54 pm
by Protocol X27
I've had an interest in extracting models from MechAssault 2 on the original Xbox. I have next to zero skill in extraction at present, but want to learn so I can contribute more. I also know this is likely obscure as far as interest goes, so I assume I'd be doing most of the leg work myself anyway. If anyone is willing to help me gain a better understanding of the process it would be greatly appreciated.

I have the files on a modded Xbox (presently having ftp issues), but from what I can tell most stuff is in the .mgf format. I see files for cinema, levels, templates etc.

Anyone have any suggestions or know of anything already available that will open .mgf container files?

Thanks in Advance

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Mon Oct 29, 2012 11:04 pm
by zaykho
I didn't worked yet on Mechassault 2, but I second your request too.

I love this game so much (Mad Cat and Nova Cat FTW ! 8D ).


Image
Image

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Mon Oct 29, 2012 11:59 pm
by Protocol X27
zaykho wrote:I didn't worked yet on Mechassault 2, but I second your request too.

I love this game so much (Mad Cat and Nova Cat FTW ! 8D ).
Yeah there's some great stuff in there. I'm starting dig my way through some of the resources, it'll probably be slow, but hopefully educational.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Tue Oct 30, 2012 12:35 am
by zaykho
Well upload some sample here, maybe someone will help us to convert this format.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Tue Oct 30, 2012 2:13 pm
by Protocol X27
zaykho wrote:Well upload some sample here, maybe someone will help us to convert this format.
Good idea. :)

I did get ftp working last night, so I have the files. However, I don't want to get in trouble for posting code I shouldn't, so what would be the best way to go about sharing / 'cropping' an actual game file. I know its an 8 year old game that is unlikely to resurface, but still just playin' it safe. I have the '3dlobby.mgf' which 'hopefully' should be an easier place to start.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Tue Oct 30, 2012 4:19 pm
by zaykho
Protocol X27 wrote:
zaykho wrote:Well upload some sample here, maybe someone will help us to convert this format.
Good idea. :)

I did get ftp working last night, so I have the files. However, I don't want to get in trouble for posting code I shouldn't, so what would be the best way to go about sharing / 'cropping' an actual game file. I know its an 8 year old game that is unlikely to resurface, but still just playin' it safe. I have the '3dlobby.mgf' which 'hopefully' should be an easier place to start.

Send me some sample files by PM, and then I will upload them here.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Wed Oct 31, 2012 2:16 am
by Protocol X27
Roger that, PM away

If there's something more optimal I should do let me know. Hopefully I can get some more study work done soon. So far I haven't gotten past opening it in the Hex Editor. XD

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Wed Oct 31, 2012 4:12 am
by finale00
That is a pretty strange place to be stuck at.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Wed Oct 31, 2012 1:43 pm
by Protocol X27
finale00 wrote:That is a pretty strange place to be stuck at.
Strange because I should be doing something else, or because I have no idea what I'm doing? XD I'm all ears if I should be following another approach. :)

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Wed Oct 31, 2012 3:17 pm
by zaykho
Protocol X27 wrote:Roger that, PM away

If there's something more optimal I should do let me know. Hopefully I can get some more study work done soon. So far I haven't gotten past opening it in the Hex Editor. XD

Thanks, here the sample for those who want to help us.

http://www.mediafire.com/?yath6tyzr6fphzo

BTW @Protocol X27, we will need more samples for being able to compare the result.

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Wed Oct 31, 2012 11:42 pm
by Protocol X27
zaykho wrote: BTW @Protocol X27, we will need more samples for being able to compare the result.
Cool,

Here's a few more files, not anymore glaringly useful to me, but not saying much since I don't know jack. XD

http://www.mediafire.com/?9192x0s111qwoed

I included a cinema file, mission file, template, common and text.mgf. The only one I could even see anything in was the text.mgf which looks like it includes the fonts and credits. Might at least yield some utility as to structure.

I don't know if any of this helps or not, I forgot to mention that the container is a Material & Geometry format. Looks like it is a standard format although not widely accepted one. There seemed to be a couple of dlls that control accessing it. Does it seem practical to hunt a library down that would interact with these formats? I also saw a large writeup on the actual structure of the file format, but it was rather academic in what it does. If that sounds helpful I track down the link, but again, I know very little as to what is useful or not at this point.

If anyone has any particular sleuthing methods in approaching this, I wouldn't mind hearing suggestions so I have a better understanding of what occurs in this process. I've been going through the file format exploration write up that was on the wiki, but I'm still foggy on a few things. Is there a better thread to ask general questions about that stuff?

Thanks

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Thu Nov 01, 2012 12:12 am
by chrrox
its just an zlib compressed file
offzip.exe -1 -a c:\file.dat c:\output 0
that will extract the file
here is a quickbms the follows the structure but offzip is most likely faster.

Code: Select all

get unk01 long
get unk01 long
get files long
get tsize long
get unk01 long
get size long
get unk01 long
get unk01 long
get name basename
string name + .ext
append
for i = 0 < files
get offset long
get zsize long
get crc long
if tsize >= size
clog MEMORY_FILE offset zsize size
else
clog MEMORY_FILE offset zsize tsize
endif
math tsize -= size
next i
append
get nsize asize MEMORY_FILE
log name 0 nsize MEMORY_FILE

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Thu Nov 01, 2012 1:09 am
by Protocol X27
chrrox wrote:its just an zlib compressed file
offzip.exe -1 -a c:\file.dat c:\output 0
that will extract the file
here is a quickbms the follows the structure but offzip is most likely faster.
Dang, chrrox, that was quick. :D

Of the files I zipped it looks like only the text.mgf was not compressed, not expecting it to be useful anyway. XD I started digging through them, and how about that much easier to read now. Not sure where I'm going to start just yet, but there is discernable stuff in the cinematic and template files for sure. I'm seeing model references for Foster, Natalia, Power Armor, etc. Some textures are in .tif, also see some MGMODEL file extensions. Does that mean anything?

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Thu Nov 01, 2012 9:13 pm
by Protocol X27
I have no idea if any of this is helpful. Just been spending time finding consistencies... I am struggling understanding what I'm looking for in terms of file offsets. I see file names grouped together, but not no link to where they're accessed.

I punted on the cinema / mission files for a while and focused on the common.mgf.

Anyway, here's what I've run across

Initial GRAIS / Bytes, common to .mgf container files
HEX: 6D 67 66 20 04 01 5A 5A:
ASCII: mgf ..ZZ


File formats
.ltf
.mtb
.tif
.MGMODEL {xx verts}, {xx indices}
.NODE
.ANM
.mgparticle
.mat

File Length: Variable

Consistent Values found by file type: 4 Bytes, unknown purpose (to me at least)

common.mgf
----------
.ANM: 17 36 6F 35

.MGModel: 81 CF C8 B6

.mtb: 3C 34 CA 59

.ltf: C5 59 A5 F4

.mgparticle: 56 BC 45 F5

.NODE: 81 CF C8 B6

.mat: 47 EC 98 39

.tif: ?? Variable

File Format
--
4 Bytes: Header (Static by File Type (except .tifs)) (??)
4 Bytes: Filename Length
X Bytes: Filename + Null Byte
4 Bytes: 02 2F 02 FF - Consistent
4 Bytes: __ 00 00 00 - First Byte Varies
X Bytes: Remainder of File

Re: MechAssault 2: Lone Wolf / .mgf format

Posted: Fri Jan 25, 2013 1:25 am
by Protocol X27
Any pro's have any suggestions, or some good tutorials I could start checking into?