WAD files are libraries of data files for any program that runs on the Doom Engine, such as Sonic Robo Blast 2. The term "WAD" is an acronym for Where's All the Data?. Stored in lumps, the data in a WAD file can be SOC data, maps, graphics, sound effects, and music. WAD files with all the main data of the game are IWADs, whereas WADs that work as patches are called PWADs.
WAD files are organized as a collection of lumps. These lumps can contain a wide variety of data:
- Maps: Maps are stored as a collection of several consecutive lumps that must follow each other in a strict order. These map blocks start out with a header that indicates the map number, after which several lumps that contain specific data for the map follow. Map editors typically provide a graphical interface that is able to read these lumps and display them in an easy-to-edit format, and to automatically create and modify these lumps upon saving a map.
- SOC lumps: These are text lumps that control a wide array of different game settings. The most prominent examples are the
MAINCFG, which can contain practically any SOCs, such as Object configurations, level headers and other global settings, and the
OBJCTCFGlumps for character WADs.
- Scripts: These are text lumps that automatically execute console commands. While these can be created as external files, they are often integrated into WAD files as lumps to be executed either upon loading the WAD file by using the
ExecCfgparameter in the
MAINCFGlump, or inside a level, when used in conjunction with linedef type 415.
- Flats: Located between the marker lumps
F_END. These are the graphics displayed on floors and ceilings.
- Textures: The graphics themselves are stored as patches, and are located between the marker lumps
P_END. These are the graphics displayed on walls. Additionally, a
PNAMESlump are needed to combine these patches and organize them as textures.
- Sprites: Located between the marker lumps
S_END. These are the graphics displayed by in-game Objects.
- Other graphics: Other images can also be stored anywhere in WAD files, and used for various purposes, such as the title screen, menus and cutscenes.
- Sound effects and music: WAV, MIDI and OGG files can be stored as lumps in WADs.
- Palette: These lumps are called
PLAYPAL(defines the 256 colors the game uses) and
COLORMAP(controls how to adjust these colors for different light levels).
- Demos: Recorded playback demos, such as the ones used for Time Attack, can be stored as lumps in WAD files as well. This is particularly useful for the "Staff Time" feature in XSRB2.
Loading WAD files
To launch SRB2 with added WAD files, the files must either be in the same directory as SRB2 or in a subdirectory. Then, you may add them à la one of the following methods:
- In the console, enter in
- Use the SRB2 Launcher.
- In Start Menu -> Run, type in
SRB2DIRECTORYNAME\srb2win -file filename.wadYou must enter in the directory name as the DOS command prompt would display it.
- Add the
ADDFILE FILENAME.WADin autoexec.cfg in the SRB2 directory. This particular method will load that WAD file every time you run the game.
To remove a WAD file from the game, restart the game. Alternatively, if all the new data replaced existing data, enter in
ADDFILE SRB2.SRB to revert it. Note that you must use the former method to join a netgame.
Creating and editing WAD files
- Main article: WAD editors
First of all, you need to create the necessary data for the WAD that you want to create. Depending on what you want to feature in your map, these can be textures, sprites, a SOC file, levels etc. Then you use a WAD editor to add/extract/edit data into the WAD file and store it as a lump. For raw resources such as images or music, simply adding the lumps to the WAD file and then loading it will suffice. Some of the more complicated data requires extra steps for adding it, however. Depending on what resource you want to add, there are tutorials available to help you out:
- Level design - For custom levels and other techniques associated with mapping.
- Character WAD tutorial - For character WADs, which contain both sprites and SOC lumps.
- SOC and MAINCFG - For general modification settings and other SOC lumps.
- Custom textures tutorial - SLADE and Custom textures tutorial - XWE - For custom textures, which are made up of patches, a
- Sound and music tutorial - For custom sound effect and music lumps.
If you want to replace any data that is already present in the game (such as changing the title screen, for example), simply give the replacing lump the same name as the lump that you want to replace, and store it in an external WAD. Externally loaded WADs, so-called PWADs, take precedence over the main WAD file, the IWAD. That means that if both the IWAD and a PWAD contain a lump with the same name, the game will only load the lump from the PWAD. If no lump of the same name is found in a PWAD, the lump from the IWAD is loaded.