B0 M 7M2XS, ;@0MM 20 MWXrX '03 .XM M 2M7 M X@ :,. MM M MM .. M2 M ;a WM ,. MMBMX M ,22iM. M MX MM ar 2, Xa. SM aa;7M 8W@ MMr Mi ,0a M7XS a iZXiM ;Z 0 r @W; M M M 7iW@ M W M7M 8 S X7M M Ba M. 2i70 M 0 i M .M W M2.. ir @ M,M M MZX M M i Zr:2 Z M M 7Z 0M M ;S 7B 2 M MMr0 M ra M; M MMZWM aXM MaSZMMX SXZMMM,MM MM MM 8M XBM0M, Wa2S0MM MX ;SMMMM.MX MM ----;X-----B--------S----..:i-i;--.------------0---------------ii--------------------,---r0---- Galactic Civilizations .MTD File Format Hacked Researched by Dark Rain / Black Heaven (rochdenis@hotmail.com) v0.0.6 ====== Introduction to MTD files ========================= MTD files are an archive format for various Pear medias. A MTD file can in theory contain any type of data but there's only 4 type supported by Mutil, they're PAL_, SPR1, tiles and incl (don't ask me what incl is). The MTD extension is short for Michael T. Duffy. It's the name of the author of the pear library. The library was used extensively to create Galactic Civilizations. You can visit his website at : "http://www.ionet.net/~mduffy/". In GalCiv, the programmers used various extensions beside mtd but it's still the same file format. So far, I've identified .mdl and .tiles files as being mtd compatible files. In the context of the pear library, each MTD file is refered to as a library and each file in it as a book. I will use this analogy too to prevent confusion but dont forget that it's just files in an archive like a zip. I have to thank CariElf and MadMaz for the hints regarding the general structure of the mdl files. Notes ===== For this text, I assume that a char is one byte, a short 2 byte and a longword 4 byte. The latest version can be found at my website in the file formats section for Galactic Civilizations. Visual Designs : http://www.tauniverse.com/visual-ta/ The Header ========== Variable Name Size ============================ IDname Char[6] Unknown Short BookNumber Short "IDname" - It's always equal to MTDLIB, I'm guessing it's used to make sure it's a valid Pear Library™ file. "Unknown" - It looks like it's always the same thing so far, might be some kind of integrity check too. "BookNumber" - The number of archived books. The header is followed by a series of books. The book header =============== Variable Name Size ============================ IDname Char[6] BookLength Longword BookType Char[5] BookName Char[20] "IDname" - Always equal to LIBBLK, so it's probably another validity check. "BookLength" - This is the length in byte of the book content. It starts after the book name (more on this later). "BookType" - It's type of the book, there's 2 book type I know of so far : PAL_ and SPR1. There might be others but I haven't looked at enough files to find out for sure. "BookName" - This string is used to give a name to the book. Right after the book name, you can find the book "content". The book content is the size of BookLength. Each book is followed by another Book header until you've reached the end of the file. ................. Greetings ========= · Saruman & Bobban / DFR Engineering. · The old EVA crew and NS Hard Rock Save!