Author Topic: MCG how do I edit and how do I use dpk extractor?  (Read 1715 times)

0 Members and 1 Guest are viewing this topic.

Offline luxebo

  • 25
MCG how do I edit and how do I use dpk extractor?
Both are an issue, how do I use the MCG editor (I don't know where it is?) ? Would like to give a try to it, and also I want to extract the missions that are given in MCG in (aka Bengal's Lancers, etc). I verified that everything else works however, just not the extracting of dpk files.

 
Re: MCG how do I edit and how do I use dpk extractor? (answered)
I know this thread is very old... like this subforum. Hehe

But since never anyone gave that poor guy an answer I have one, found it while collecting all valuable data I could find for MCG.

FST and DPK file format:
------------------------

Notes:
  - Data in the FST is in compressed form (typically), the compression used is a Lempel-Ziv variant
    (looks to me like an LZW). I'm not sure if this is in fact the case. Sort of redundant now as
    the compressor and decompressor code ripped out of the game executable is working fine.

    (see lzcompress_asm.c and lzdecomp_asm.c respectively).

  - DPK files use the exact same format as FST file. In short, a DPK *is* an FST file.

  - In a DPK file, I have yet to see any compressed data, while in the FST, it most definately is
    compressed, but it doesn't have to be.

  - To store uncompressed data in a FST (or DPK), simply set the uncompressed and compressed size
    to the same values and copy the uncompressed data into the correct location in the FST/DPK.

  - An FST (and hence also a DPK) file can be seen as a sort of virtual drive with a single
    directory in it.

  - In both the FST and DPK files, the path to the file (relative to the game root directory) is
    stored with the filename in the TOC. This means that we could technically extract all files
    from the FST, delete the FST, and still run the missions as long as all the files extracted
    were in the correct locations. This seems to be born out from when we create DPK packages and
    extract the FST on another player's computer.
I haven't tried this with the full mission
    campaign file though.
   
  - The MCExtractor tool normally used to extract files from a DPK actually looks for a single
    .FST file and a single .SOL file within the DPK. If this is not the case, MCExtractor will
    refuse to work with the DPK. Further, MCExtractor does not appear to be able to handle
    compression, this would then seem to be the reason why DPKs are never compressed. These
    factors should be kept in mind if attempting to create your own DPK creator using the
    information in this document.


Offset  Size         Description
------  ----         -------------------------------------
000000  DWORD        Number of entries in the TOC

000004  262 * n      TOC Entries start here (262 bytes per entry)

 xxxx   xxxx         Data for the FST/DPK (Starts immediately after TOC)

  TOC Entries (262 bytes):
  000000  DWORD      Offset into file where data is
  000004  DWORD      Size in bytes of the stored data
  000008  DWORD      Size in bytes of uncompressed data
  00000C  250 bytes  String (zero filled). File and path this entry represents.



Files in an FST and DPK file
----------------------------

For solo mission DPK files, there are only two files. First is the .SOL file for the misson, and then the actual FST file.

For solo missions, the following files are put in the FST file:

The names listed below assume the mission is called "name". Likely we only need one campaign file, the others
are individualized for each map. The campaign name (likely) needs to be the named after the FST & SOL files, but the
rest can be anything at all as they are referenced from within the campaign file. (order of files within the FST/DPK doesn't appear to be important).

  data\missions\name_VAR.ABI
  data\missions\name_STR.ABI
  data\missions\name.TXT
  data\missions\name_MP.ABI
  data\missions\name_INIT.ABI
  data\missions\name_LOP.ABI
  data\missions\name.ABL
  data\missions\campaignname.FIT
  data\terrain\name.BDG
  data\terrain\name.DAT
  data\terrain\name.ELV
  data\terrain\name.FIT
  data\terrain\name.GMM
  data\terrain\name.OBJ
  data\terrain\name.PRE
  data\terrain\name.TGA
  data\terrain\name.LOG.TGA
  data\missions\Warriors\nameParams.fit

When using the editor to create a DPK file (which also creates the FST for inclusion in the DPK), it internally renames all the names except for the file "campaignXX.fit" whose name remains intact and takes on the same name as the FST file itself. e.g. if you made a mission map called TEST, then the FST file the editor creates will be called TEST.FST, the SOL file will be called TEST.SOL and the campaignXX.fit file will be called campaignTEST.FIT. All the other files are referenced from within the campaignTEST.FIT file or one of the other files and so these files are automatically changed to some UUID number instead of TEST. This is why we get strange long filenames in the FSTs. But a simple test I made shows that the UUID names are not required whatsoever. if we simply packed all the needed loose files the editor creates for the mission (as noted above) into an FST file, and used the appropriate SOL file, the mission will run just fine.


This ive got from cmunstas notices of a simple txt file between all of his MCG Tools and Tutorials.

He also mentions the importance / role of dpk files in his campaign building guides.
« Last Edit: March 29, 2017, 07:58:22 am by RizZen »
It has become appalingly obvious that our technology has exceeded our humanity.

Albert Einstein