Structures
The way Doom 64 is structured as software is into two main sections: the code and assets. Sometimes information can be hardcoded into the code, but generally assets are stored in other files. Below is a list of software which can add assets to the various file formats you will encounter with Doom 64.
- WAD/KPF (PC)
- WAD (N64)
- SF2
- DLS
- WDD/WMD/WSD
Asset Organization
How the assets of Doom 64 is stored varies amongst the various ports. In general, WAD files are where the majority of the Doom 64 assets are stored, which includes the graphics and levels, and the Nintendo 64 ROM has one embeded. The information, music, and sound file locations vary from engine to engine. Below is a list of where each asset type is stored.
- Graphics Assets
- Sprites
- All Engines - In WAD file between lump S_START and S_END markers
- Doom 64 EX (Optional) - In WAD file between lump SS_START and SS_END markers
- Palettes
- PC Engines - In WAD file outside lumps between the WAD S_END and T_START lump
- N64 Engines - In WAD file between lump S_START and S_END markers before corresponding sprites
- Textures
- All Engines - In WAD file between lump T_START and T_END markers
- Doom 64 EX (Optional) - In WAD file between lump TT_START and TT_END markers
- Other Graphics
- N64 Engines - In WAD file outside lumps after T_END marker
- Doom 64 Remaster - In WAD file outside lumps after T_END marker and in KPF files
- Doom 64 EX+ - In WAD file outside lumps after T_END marker and between SYMBOLS and MOUNTC
- Doom 64 EX - In WAD file between lump G_START and G_END markers
- Sprites
- Audio Assets
- Gameplay Sounds
- Doom 64 Remaster - In WAD file between lump DS_START and DS_END markers
- Doom 64 EX Engines - In the DOOMSND.SF2 soundfont file
- N64 Engines - In the WDD/WSD files
- Music Sound Assets
- Doom 64 Remaster - In the DOOMSND.DLS soundfont file for MIDI music sounds
- Doom 64 EX Engines - In the DOOMSND.SF2 soundfont file
- N64 Engines - In the WDD/WSD files
- Music and MIDI
- Doom 64 EX - In WAD file between lump DS_START and DS_END markers
- Doom 64 Remaster / Doom 64 EX+ - In WAD file between lump DM_START and DM_END markers
- N64 Engines - In the WMD/WSD files
- Gameplay Sounds
- Other Assets/Information
- Maps
- All Engines - Embedded as individual WADs within the main WAD file
- PC Engines - In the WAD file dilineated by map markers
- Definitions (Maps/Skies/Animations)
- PC Engines - In the WAD file as text lumps (ANIMDEFS Lump, MAPINFO Lump, & SKYDEFS Lump)
- N64 Engines - Hardcoded in source code
- CHECKSUM (MD5 hash of the IWAD generated by Wadgen)
- PC Engines (optional) - End of WAD
- Maps
WAD Structure
For the PC Engines, WADs can be made and opened with any Doom WAD editor, and the file structure is very similar to the other Doom games. Here asset types are stored in lumps designated by markers, and each map is in its own lump. For Doom 64, maps can also be stored in WADs and placed into the main WAD. One of the more popular WAD editors for this is Slade.
The Nintendo 64 format of the WAD file is very similar to the PC format. However, the algorithm used for loading data from the catridge into memory requires assets and lumps of a specific length (divisible by 2 bytes). This means these assets must be padded, and the aforementioned N64 WAD utilities will do this.
Text Lumps (PC Engines)
Text lumps were introduced by Doom 64 EX to define texture animations (ANIMDEFS), map properties (MAPINFO), and sky effect properties (SKYDEFS). These have been utilized in all other PC engines of Doom 64. The pages below define which properties can be used.
KPF Format (Doom 64 Remaster)
The Doom 64 Remaster has additional files to store extra engine and high-resolution game assets in the form of KPF files. These "KEX program files" compressed archives in the ZIP file format. Any program which can decompress ZIP archives, such as Slade, can open and decompress these files.
Nintendo 64 Compression
The Doom 64 engines for the Nintendo 64 come with a utility to rip a assets from the Doom 64 ROM. Although general Doom WAD editors can open up this WAD, they cannot view and properly save the assets. This is because these assets are compressed to save space and are padded for Nintendo 64 loading purposes (must to be divisible by two bytes). To decompress assets, you can either use Kovic's wadutil64 or Erick194's d64tool.
Interestingly the Doom 64 engines can load uncompressed assets. So it is not required to recompress the assets. However most flashcarts can't load N64 ROMs above 64 MB, so it may be helpful to recompress the assets. Erick194's d64tool can do this recompression; it can reduce the WAD size by nearly a half of its original size in many cases.