DUKE NUKEM 2 TOTALLY UNOFFICIAL GAME FILE SPECS =============================================== Compiled Sept. 2002 based on hacking and research and notes done years ago. Maybe someone will take up the torch and finally write the editor that I had planned to do, but never did. If you don't understand the info contained in this file then just delete it - it's not meant for you. Those who need it will understand it. 'Nuff said. Have fun, Dave Bollinger DISCLAIMER: =========== The information presented here is totally unofficial and without warranty of any kind and has been shown to cause cancer in laboratory animals. Any damage you do to your game files is entirely your own fault. CONTACT: ======== Feel free to email me with technical questions at: davebollinger at hotmail dot com and I'll answer as best I can, if I can, if I feel like it. But please don't spam me or otherwise abuse that email account. COMPACTED FILE SPECS: ===================== Many of Apogee's "classic" games use the same compacted file format with a bunch of individual files all crammed together into a single big file. Each of these compacted files begins with a directory of the individual files: typedef struct { char filename[12]; // 12 bytes long fileoffset; // 4 bytes long filesize; // 4 bytes } TDirectoryEntry; // 20 bytes #define NUM_DIRECTORY_ENTRIES 200 typedef TDirectoryEntry TDirectory[NUM_DIRECTORY_ENTRIES]; // 4000 bytes TDirectory Directory; // note: the file entry just after the last used entry contains // the number of files in the pack stored as ascii in the filename. // so, best way to check for last entry is 0 fileoffset and filesize. // what a wacky way to do it, too bad the number of entries used // isn't just an int at the top of the directory so you'd know // ahead of time how many entries exist without having to scan. // example usage: in = fopen("nukem2.cmp","rb"); fread(&Directory, sizeof(TDirectory), 1, in); for (i=0; i 0020 BADGUY - fast green cat, <- 0025 white box - circuit card 0026 BADGUY - flamethrower 0027 BADGUY - flamethrower 002A red box - bomb 002D BONUS - blue globe 002E BONUS - blue globe 002F BONUS - blue globe 0030 BONUS - blue globe 0031 BADGUY - bouncing sentry robot 0032 teleport 0033 teleport 0035 white box - rapid fire 0036 rocket launcher turret 003A BADGUY - bouncing sentry robot 003E BADGUY - bomb dropping spaceship 0040 bouncing spike ball 0042 electric current door 0043 BADGUY - green slime ball 0044 BADGUY - green slime container 004B nuclear waste can, green slime inside 004E BADGUY - snake 004F camera - on ceiling 0050 camera - on floor 0051 BADGUY - green hanging suction plant 0052 TRIGGER - causes object to right to appear only in med/hard difficulty 0053 TRIGGER - causes object to right to appear only in hard difficulty 0057 Duke's Ship 005D force shield - need cloaking device 005F rocket - falls over and explodes 0061 BADGUY - cross walker 0062 BADGUY - eyeball bomber plant 0065 BADGUY - BOSS Episode 2 0066 explosive charge 0067 explosive charge 0068 explosive charge 006A explosive charge 0072 white box - cloaking device 0073 BADGUY - sentry robot generator 0074 explosive charge 0075 pipe dripping green stuff 0077 circuit card door 0078 circuit card keyhole 0079 white box blue key 007A blue key keyhole 0080 auto-open vertical door 0081 keyhole mounting pole 0080 automatic door 0082 vertical fan 0083 swivel gun 0084 sliding floors by ladders 0085 sector marker 0086 BADGUY - skeleton 0089 explosive charge 008A explosive charge 008B exit 008C swivel gun mounting post 008E explosive charge 008F explosive charge 0090 rocket 0094 blue box - empty 0096 BADGUY - metal crunch jaws 0097 BADGUY - floating split laser ball 009A BADGUY - spider 009B blue box - N 009C blue box - U 009D blue box - K 009E blue box - E 009F BADGUY - blue guard 00A0 blue box - video game cartridge 00A1 white box - empty 00A2 green box - empty 00A3 red box - empty 00A4 blue box - empty 00A8 red box - cola 00AB BADGUY - blue guard 00AC blue box - sunglasses 00AD blue box - phone 00AE red box - 6 pack cola 00B0 BADGUY - green ugly bird 00B5 blue box - boom box 00B6 BADGUY - blue guard 00B7 blue box - TV 00B8 blue box - camera 00B9 blue box - PC 00BA blue box - CD 00BB blue box - M 00BC rotating floor spikes 00BD BADGUY - leaping gargoyle 00BE BADGUY - stone statue 00C8 BADGUY - BOSS Episode 1 00C9 red box - turkey 00CB BADGUY - bird 00D0 floating exit sign 00D1 rocket elevator 00D2 message box 00D4 lava surface 00D5 BADGUY - flying message ship "YOUR BRAIN IS OURS" 00D6 BADGUY - flying message ship "BRING BACK THE BRAIN" 00D7 BADGUY - flying message ship "LIVE FROM RIGEL IT'S SATURDAY NIGHT" 00D8 BADGUY - flying message ship "DIE" 00D9 BADGUY - blue guard 00DB smasher 00DC BADGUY - flying message ship "YOU CANNOT ESCAPE US YOU WILL GET YOUR BRAIN SUCKED" 00DD water depths 00DE lava fall 00DF lava fall 00E0 water fall 00E1 water fall 00E3 water drip 00E4 water fall spash 00E5 water fall bubble 00E6 water fall 00E7 lava riser 00E9 water surface 00EA water surface bubble 00EB green slime liquid 00EC radar antenna 00ED message box 00EF special hint globe 00F0 hint machine 00F1 TRIGGER - generates windblown spiders when touched 00F4 BADGUY - small unicycle 00F6 flame jet 00F7 flame jet 00F8 flame jet 00F9 flame jet 00FA ? 00FB ? 00FC floating exit sign 00FD BADGUY - caged claw monster, active 00FE flashpot 0101 water on floor 0102 water on floor 0105 caged claw monster, inactive 0106 fire on floor 0107 fire on floor 0109 BADGUY - BOSS Episode 3 010F BADGUY - small flying ship 0110 BADGUY - small flying ship 0111 BADGUY - small flying ship 0112 blue box - T shirt 0113 blue box - videocassette 0117 BADGUY - BOSS Episode 4 0128 floating arrow 012B BADGUY - swamp monster 0160 blue box - video UNPACK SOURCE: ============== This utility was originally written for Cosmo, but works just fine on DN2 and others that use the same "compact" file format. Updated slightly to compile nicely with BCB5, command line: bcc32 unpack.c Should compile clean on other "modern" compilers. // unpack.c // extracts the individual files from the compacted // archive for Apogee games like Cosmo (and DN2, et al) // #include #include #include typedef struct { char filename[12]; // 12 bytes long fileoffset; // 4 bytes long filesize; // 4 bytes } TDirectoryEntry; // 20 bytes #define NUM_DIRECTORY_ENTRIES 200 typedef TDirectoryEntry TDirectory[NUM_DIRECTORY_ENTRIES]; // 4000 bytes TDirectory Directory; void Usage(char *message); int main(int argc, char *argv[]) { FILE *in, *out; char filename[12+1]; long fileoffset, filesize; void *buffer; int i; // MAKE SURE USER SPECIFIED INPUT FILE // if (argc < 2) { Usage("No input file specified."); return -1; } // OPEN INPUT FILE // in = fopen(argv[1],"rb"); if (!in) { Usage("Unable to open input file."); return -1; } // READ DIRECTORY // fread(&Directory, sizeof(TDirectory), 1, in); // PROCESS DIRECTORY // filename[12] = '\0'; for (i=0; i called DN1MOD currently available at: http://members.iinet.net.au/~markim/admiral_bob/files So I see no purpose in trying to document the DN1 specs. Though for anyone interested, one of my later DN1 DOS-based editors can currently be found at this link (not my site): http://members.fortunecity.com/stuntracer/duke1.html That editor requires you to have the registered version of DN1 or it won't allow saving - a reasonable concession I made to Apogee at the time to keep them from taking me to court over it!) However, it might be of interest just for the extra levels it contains. As far as Cosmo goes, I had a map viewer and editor for it too, but much like a lot of work I did on DN2 it has since been lost to the great void of floppy disk backup storage. Though if you get this DN2 spec, you should be able to figure out Cosmo without too much trouble since they're very similar. None of these links are guaranteed to be functional after... Sep 16 2002 DB