coding:dos:setup

Setting up the DOS Wolf3D source code

This tutorial will take you through the steps to set up and compile the Wolfenstein 3D source code, which was released by John Carmack in 1999. It is based on the knowledge provided by both MCS' and The Wolf3D Dome's tutorials, which were crucial when I first started modding.

What you will need

Important notes:

  • Borland C++ 3.1, the programming we'll be using to build the engine, is a DOS program, and as such will require DosBox to run. To learn more click here.
  1. If you downloaded the source code from the link on this page, you will require all the files in the WOLFSRC folder. Extract the zip file, and move the WOLFSRC folder to your preferred location. (For this tutorial we'll be putting the folder directly into C:\. So the source will be located in C:\WOLFSRC\). You should see the following files in the folder.


    These are the source code files you will be changing later to modify the game. But first we need to get it building the original engine first, to make sure it works.

  2. Extract BORLANDC.zip to a new folder (For this tutorial we'll be using C:\BORLANDC).

  3. Copy the TASM.EXE, TASM2MSG.EXE, and TASMX.EXE files from C:\BORLANDC\BIN and paste them in your source code folder. If you don't do this, you may experience an error when attempting to compile.

  4. Open DosBox, and mount a drive to your Borland folder. Mount a separate drive (We will use D:) to your source code folder. If you're unsure of how to do this, click here. Nagivate to the drive mounted to Borland in DosBox. (For this tutorial, that is C:\)


  5. Type bin\bc.exe and press Enter. You should see the following screen.


    You're in Borland!

  6. Go to ProjectOpen Project You'll find yourself in the BORLANDC folder. Type the drive you mounted for the source code (D: in this tutorial) into the Name section, and press Enter.


    Highlight WOLF3D.PRJ and press OK (Or double-click on WOLF3D.PRJ).

  7. If you are successful, you should now see the following pop-up at the bottom of Borland, listing all the files used for the Wolf3D engine.


  8. There are two files that will cause issues. Scroll down in the pop-up in Borland until you find SIGNON.OBJ and GAMEPAL.OBJ. Delete them from the project by highlighting them and pressing the delete key on your keyboard (Do not delete them from your computer!).


  9. You need those files, but properly included in the project. Either click ProjectAdd Item, or press the insert key on your keyboard to bring up the Add to Project List window. It will probably be in the wrong folder, so type the letter of the mounted drive for the source (Remember, it is D: in this tutorial) into the Name section and press enter. You should see your source files.


  10. Scroll through the files until you find OBJ\. Double-click to enter it.

  11. The folder will appear empty, until you change the *.C in the Name directory to *.OBJ.


  12. Click on GAMEPAL.OBJ and press the Add button to re-add it to the project. Do the same with SIGNON.OBJ. Click the Done button.

  13. Next, we need to change what folders Borland works with. Go to OptionsDirectories, and change your directories to the following, then click Okay.
    • Include Directory: C:\INCLUDE
    • Library Directory: C:\LIB
    • Output Directory: OBJ
    • Source Directory: D:\


  14. Now, you should be able to build the engine! Go to CompileBuild All and Borland should compile the code, giving you an EXE in the folder you chose for the Output Directory.



  15. Take the exe from your Output Directory, and place it in a directory with the Wolfenstein 3D game files, and try running the game to see if it works!

Once this is all done, setup is complete. When you start Borland in future sessions, you'll only need to mount the two drives into DosBox, and open the project to be ready to compile!

If this is the first time you've built the code, it may be because the version of Wolfenstein 3D you are using has the wrong VGA files for what is being compiled.

Solution

To solve this, you can either identify what version of Wolfenstein 3D you are using via a source such as http://wolf3d.de and compile the correct build, try using the retail version of the game, or download and use the VGA files available at the bottom of MCS' tutorial with your project.

Editing the source can be done from within Borland C++ Compiler 3.1 if you appreciate the aesthetic, but you can also use any general text editor. A highly recommended choice is Notepad++, which is completely free and includes a lot of quality of life features for programming.

Simply open a file, make your changes, and save the file (In Borland and almost all other programs, this is done by going to FileSave).

You will then have to go into Borland and build your new executable to see your changes.

If you want help with understanding the code, visit the Coding Questions section. If you want to learn how to implement specific features, visit the Code Tutorials section.

The Wolfenstein Source Code comes with a lot of unnecessary files for our purposes. While it's not require to do, if you prefer getting rid of clutter, you can read a full explanation of what files are necessary on AReyeP and MCS' Wolfenstein 3D Page, courtesy of MCS.

  • coding/dos/setup.txt
  • Last modified: 2020/06/06 06:42
  • by zombie