#ifdef DOOM
#define DEFAULT_IWAD   doom2.wad
#elif HERETIC
#define DEFAULT_IWAD   heretic.wad
#elif HEXEN
#define DEFAULT_IWAD   hexen.wad
#elif STRIFE
#define DEFAULT_IWAD   strife1.wad
#endif
# LONG_GAME_NAME installation

These are instructions for how to install and set up LONG_GAME_NAME
for play.

#if !PRECOMPILED
# Building LONG_GAME_NAME

Before you can play LONG_GAME_NAME, you need to compile a binary that
you can run.  For compilation, LONG_GAME_NAME requires the following
to be installed:

 * A C compiler (gcc is recommended)
 * make (GNU make is recommended)
 * SDL2 (see https://www.libsdl.org/)
 * SDL2_mixer (see https://www.libsdl.org/projects/SDL_mixer/)
 * SDL2_net (see https://www.libsdl.org/projects/SDL_net/)
 * Python (optional)

Follow the standard instructions for installing an autotools-based
package:

 1. Run `./configure` to initialize the package.
 2. Run `make` to compile the package.
 3. Run `make install` to install the package.

An automated build script is available that installs the necessary
dependencies and builds the source code automatically.  See the build
instructions on the website.

Advanced topics such as cross-compilation are beyond the scope of this
document.  Please see the GNU autoconf / automake documentation for more
information.

#endif
# Obtaining an IWAD file

To play, you need an IWAD file.  This file contains the game data
(graphics, sounds, etc). The full versions of the games are
proprietary and need to be bought.  The IWAD file has one of the
following names:

|  IWAD                      | Game                            |
| -------------------------- | ------------------------------- |
#if DOOM
|  doom1.wad                 | Shareware Doom                  |
|  doom.wad                  | Registered / Ultimate Doom      |
|  doom2.wad                 | Doom 2                          |
|  tnt.wad                   | Final Doom: TNT: Evilution      |
|  plutonia.wad              | Final Doom: Plutonia Experiment |
|  chex.wad                  | Chex Quest                      |
|  freedoom1.wad             | Freedoom: Phase 1               |
|  freedoom2.wad             | Freedoom: Phase 2               |
|  freedm.wad                | FreeDM                          |
#endif
#if HERETIC
|  heretic1.wad              | Shareware Heretic               |
|  heretic.wad               | Registered / Commercial Heretic |
#endif
#if HEXEN
|  hexen.wad                 | Hexen                           |
#endif
#if STRIFE
|  strife1.wad (+voices.wad) | Strife                          |
#endif

#if DOOM
If you don’t have a copy of a commercial version, you can download
the shareware version of Doom (extract the file named doom1.wad):

 * https://www.doomworld.com/idgames/idstuff/doom/win95/doom95
   (idstuff/doom/win95/doom95.zip in your nearest /idgames mirror)

#endif
If you have a commercial version on a CD-ROM, obtaining the IWAD
file is usually straightforward. Simply locate the IWAD file on the
disc and copy it off.

#if !__MACOSX__
#if DOOM
The Doom games are available to purchase for download on Steam
(https://store.steampowered.com/), all releases containing the classic
games including Doom 3: BFG Edition are supported.
#endif
#if HERETIC
Heretic is available to purchase for download on Steam
(https://store.steampowered.com/).
#endif
#if HEXEN
Hexen and its expansion pack are available to purchase for download on
Steam (https://store.steampowered.com/).
#endif
#if STRIFE
Strife: Veteran Edition is available to purchase for download on Steam
(https://store.steampowered.com/).
#endif
#if !_WIN32
For Steam on Linux, you need to enable “Steam Play” for all titles in
order to install the games.  You may do this from the Steam menu,
Setup, and the Steam Play tab.
#endif
LONG_GAME_NAME will autodetect IWADs installed by Steam and you do not
need to do anything.
#else
The Doom, Heretic, Hexen, and Strife games are available to purchase
for download on Steam (https://store.steampowered.com/), but are only
available for Windows.  To find the IWAD files on a Windows or Wine
system, look in the Steam directory (usually within “Program Files”),
under the “steamapps/common” path.
#endif

#if DOOM || STRIFE
The Doom and Strife: Veteran Edition games are available for purchase
on GOG.com (https://www.gog.com/).
#if _WIN32
LONG_GAME_NAME will autodetect IWADs from the standalone or GOG Galaxy
installers and you do not need to do anything.
#else
The games are only available for Windows, but you may find the IWAD
files on a Windows or Wine system, typically within the “C:\GOG Games”
or “C:\Program Files\GOG Galaxy” directories.
#endif

#endif
#if DOOM || HERETIC
Older floppy disk versions are harder to deal with. The easiest way
to install from floppies is to run the original installer program
inside an emulator such as DOSbox (https://www.dosbox.com/).
As an alternative to using an emulator, it is possible to extract the
files manually. On the install disk(s), you will find several files
with numbered extensions (eg. “doom_se.1”).

From the command line it is possible to combine these files into a
single large file, using a command similar to the following:

#if _WIN32
   copy doom_se.1+doom_se.2+doom_se.3+doom_se.4+doom_se.5 doom_se.lzh
#else
   cat doom_se.1 doom_se.2 doom_se.3 doom_se.4 doom_se.5 > doom_se.lzh
#endif

The resulting file is an LHA archive file, and it can be extracted
using an LHA archive tool (there is one available for almost every
operating system).

#endif
# Running the game

#if __MACOSX__
Once you have an IWAD file, you can specify its location within the
graphical launcher program.  Click the “Configure...” button, and then
click “Set...” for each IWAD to choose its location.  From the main
launcher dialog you can then choose which game you want to play and
click the “Launch” button to start the game.

If you are an advanced user and like to run Doom from the command
line, you can use the “Command Prompt...” menu item to open a Terminal
window.  The DOOMWADPATH environment variable is preconfigured
to point to the locations of the IWAD files set within the launcher.
You can launch the game with a specific IWAD file by typing, for
example:

    LONG_EXE_NAME -iwad tnt.wad
#else
LONG_GAME_NAME needs to know where to find your IWAD file. To do this,
do one of the following:

#if _WIN32
 * Within Explorer, simply place the IWAD file in the same folder as
   the LONG_GAME_NAME files, and double-click `LONG_EXE_NAME.exe`.

 * Run LONG_GAME_NAME from the command prompt with the `-iwad` command
   line parameter to specify the IWAD file to use, eg.

       LONG_EXE_NAME -iwad c:\games\DEFAULT_IWAD

 * Set the environment variable DOOMWADDIR to the location of a
   directory containing your IWAD files.

 * If you have multiple IWADs in different directories, set the
   environment variable DOOMWADPATH to be a semicolon-separated list
   of directories to search (similar to the PATH environment
   variable).
#else
 * Run LONG_GAME_NAME from the Unix console with the `-iwad` command
   line parameter to specify the IWAD file to use, eg.

       LONG_EXE_NAME -iwad /root/DEFAULT_IWAD

 * Put the file into one of the following directories:

     $HOME/.local/share/games/doom
     /usr/share/doom
     /usr/share/games/doom
     /usr/local/share/doom
     /usr/local/share/games/doom

 * Set the environment variable DOOMWADDIR to specify the path to a
   directory containing your IWAD files.

 * If you have multiple IWADs in different directories, set the
   environment variable DOOMWADPATH to be a colon-separated list of
   directories to search (similar to the Unix PATH environment
   variable).
#endif
#endif

#if DOOM
# Playing with Freedoom

Freedoom is an open content project to create a Doom engine-based game
that is entirely free software. The website can be found here:

  https://freedoom.github.io/

Check out the [Chocolate Doom wiki’s page on
Freedoom](https://www.chocolate-doom.org/wiki/index.php/Freedoom)
for more information.

# Playing with Chex Quest

Chex Quest is a game based on Doom with some minor modifications that
was distributed with boxes of Chex cereal in 1997.  It is possible to
play Chex Quest using LONG_GAME_NAME.  To do this, the following files
are needed:

 * The IWAD file “chex.wad”, from the Chex Quest CD.

 * The dehacked patch “chex.deh”, which can be found here:
   https://www.doomworld.com/idgames/themes/chex/chexdeh
   (themes/chex/chexdeh.zip in your nearest /idgames mirror)

Copy these files into a directory together and use the `-iwad` command
line parameter to specify the Chex Quest IWAD file:

   LONG_EXE_NAME -iwad chex.wad

#endif
# Installing upgrades

#if DOOM
LONG_GAME_NAME requires a version 1.9 IWAD file.  Generally, if you
install a recent version of Doom you should have a version 1.9 IWAD.
#elif HERETIC
LONG_GAME_NAME requires a version 1.2 (Shareware) or version 1.3
(Shadow of the Serpent Riders) IWAD file.  Generally, if you install a
recent version of Heretic you should have a version 1.2 or 1.3 IWAD.
#elif HEXEN
LONG_GAME_NAME requires a version 1.1 IWAD file.  Generally, if you
install a recent version of Hexen you should have a version 1.1 IWAD.
#elif STRIFE
LONG_GAME_NAME requires a version 1.2 IWAD file.  Generally, if you
install a recent version of Strife you should have a version 1.2 IWAD.
Please note that Strife version 1.3 does not update the IWAD, if your
version.txt file says “STRIFE(TM) VERSION 1.3”, you are still good.
#endif
However, if you are installing from a very old CD version or from
floppy disks, you might find you have an older version.

The most obvious symptom of an out of date IWAD file is that the game
will exit at the title screen before the demo starts, with the message
“Demo is from a different game version!”.  If this happens, your IWAD
file is out of date and you need to upgrade.

Upgrade patches are available that will update your game to the latest
version, the following sites have the patches:

#if DOOM
  * http://www.doom2.net/doom2/utils.html
  * http://www.gamers.org/pub/idgames/idstuff/doom
  * http://www.gamers.org/pub/idgames/idstuff/doom2
#elif HERETIC
  * http://www.gamers.org/pub/idgames/idstuff/heretic
#elif HEXEN
  * http://www.gamers.org/pub/idgames/idstuff/hexen
#elif STRIFE
  * http://www.gamers.org/pub/idgames/roguestuff
#endif

Please see the
[Doom Wiki’s page on game patches](https://doomwiki.org/wiki/Game_patch)
for more information.

#if _WIN32
As the patches are binary patches that run as DOS executables, on
recent 64-bit versions of Windows you will need to use a DOS emulator
(such as DOSBox) to run them.
#else
As the patches are binary patches that run as DOS executables, you
will need to use a DOS emulator (such as DOSBox) to run them.
#endif

# Music support

LONG_GAME_NAME includes OPL emulation code that accurately reproduces
the way that the in-game music sounded under DOS when using an
Adlib/Soundblaster card. This is, however, not to everyone’s taste.

LONG_GAME_NAME includes a number of different options for better
quality MIDI playback; see the file README.Music for more details of
how to set these up.

#if !PRECOMPILED
When compiling from source, be sure to compile and install Timidity
before installing SDL2_mixer.

#endif
