Resurrected Entertainment

Building Wolfenstein 3D Source Code

June 16, 2014

Way back on Feb 6, 2012, id Software released the source code to Wolfenstein 3D — 20 years after it had already been written. The source code release does not come with any support or assets from the originally released game. In fact, id Software is still selling this title on various Internet stores like Steam. I played around with a DOS port of the DOOM source code quite some time ago, but I had never bothered to try and build its ancestral project. Until now!

As it turns out, it’s actually quite straight-forward with only a minor hiccup here and there. The first thing you’ll need is a compiler, that almighty piece of software that transforms your poorly written slop into a form that the operating system can feed to the machine. For this project, the authors decided to settle on the Borland C++ v3.0, but it is 100% compatible with v3.1. I don’t know if more recent compilers from Borland are compatible with the project files, or the code present in the project produces viable targets, so good luck if you decide to make your own roads.

As per the details in the README file, there are a couple of object files you will want to make sure don’t get deleted when you perform a clean within the IDE:

  • GAMEPAL.OBJ
  • SIGNON.OBJ

You can open up the pre-built project file in the Borland IDE, and after tweaking the locations for the above two files, you should be able to build without any errors. The resulting executable can then be copied into a working test directory where all of the originally released assets are located, I believe my assets were from the 1.2 release.

There are also a few resource files you must have in order for the compiled executable to find all of the right resources. According to legend, the various asset files were pulled from a sprinkling of source formats and assembled into “WL6” resource files. A utility called I-Grab, which is available via the TED5 editor utility, produced header files (.H) and assembler based (.EQU) files from that resource content which allowed the game to refer to them by constant indices once the monolithic WL6 resource files were built. There are annotations in the definition files, using the “.EQU or .H” extension, with a generated comment at the top which confirms part of that legend.

The tricky part in getting the game to run properly revolves around which resource files are being used by the current code base. The code refers to specific WL6 resource files, but locating those resource files using public releases of the game can be very tricky because those generated files have changed an unknown number of times. Luckily, someone has already gone through the trouble of making sure the graphics match up with the indices in the generated files. The files have conveniently been assembled and made available here:

After unpacking, you’ll need to copy those to the test directory holding the registered content for the game. Note that without the right resource files, the game will not look right and will suffer from a variety of visual ailments, such as B.J. Blazkowicz’s head being used as a cursor in the main menu, or failing to see any content when a level is loaded.

Google: BBS Style!

June 8, 2014

Some bored, highly creative minds created a functional Google search page circa 1985, BBS style! Make sure your speaker volume is high enough to hear the bodacious hums, beeps, and cranananghhhhtttth noises coming from the virtual modem.

Multi-player DOOM on an IPX Network

June 7, 2014

If you want the feel of a light weight and efficient network protocol, then you can start a multi-player game of DOOM via the Ultimate DOOM Setup utility on one machine and the corresponding IPX setup tool on the other machine. The easiest way to do this is to use the Windows 98 protocol stack with the following components installed:

1. Client for Microsoft Networks
2. Appropriate network adapter
3. IPX/SPX-compatible Protocol
4. NetBEUI
5. TCP/IP (you won’t need this for DOOM, but you probably will want it)
6. File and printer sharing for Microsoft Networks

I have read that you may need to enable both file and printer sharing, but personally I haven’t verified that, and I don’t really see how the components are related. If by some chance they are required, the NetBEUI protocol seems to be a requirement for the sharing to work reliably on networks between two Windows 98 machines or a Windows 98 to a Windows XP machine. I was also running this over a wired network on the same router, so if you have one or more wireless routers, make sure that machines can see each other on the network (one reason to get file sharing working between the two machines). A couple of things to keep in mind:

1. Make sure they are on the same Gateway (mine is 192.168.1.1, which is just my router)
2. Make sure they are using the same sub-net mask (I use 255.255.255.0)

A few notes on the IPX configuration:

1. Make sure the frame type is set to “Auto”
2. Make sure the network address is the same on both machines, I use the default address “0”

I have been trying off and on for a few days to get two machines using DOS-compatible IPX protocol stacks to talk to one another, and it has not been easy. I will post about that once I get them working.

2D Scrolling and EGA Support

May 29, 2014

Originally, I was using a Matrox Millennium PCI graphics card in my DOS gaming box, but I found the 2D scrolling performance to be somewhat lacking as games like The Lost Vikings would shear while playing. The card also has virtually no EGA graphics mode support, which was important to me since I wanted to run games like Crystal Caves from Apogee, and I also wanted the development option of writing computer graphics programs written for this video mode.

Enter the S3 ViRGE (Virtual Reality Graphics Engine).

Interestingly, this was S3’s first attempt at a 3D graphics accelerator card. The performance was somewhat lower than expected, however, making the card only slightly faster than the best software renderers at the time, and equal to those renderers when anything other than the simplest 3D techniques were used. Because of the card’s poor performance, it was dubbed the “Worlds First Graphics Decelerator” by critics in the graphics and gaming communities.

I own the “DX” model of this card which is somewhat more performant than its predecessor, but I didn’t buy the card for how well it could render 3D graphics so it matters very little to me. I bought the card for how well it could accelerate 2D graphics and its support for lower end video modes, and it is very impressive thus far.

Space Invaders in SVG!

I wrote a little space invaders game in SVG (Scalable Vector Graphics) several years ago. It plays sound effects and has a few of the essential features within the game. I have recently modified it to work on Google Chrome browsers, since it was originally built to run within Adobe’s SVG Viewer plug-in which could only run on Windows 98 or XP platforms.

It’s a great game for people who are new to programming to get their feet wet and hack around with it. Some of the core concepts needed to modify the game to any great extent would be a rudumentary knowledge of JavaScript, SVG, and DOM level programming; you can run the game in the browser directly, there is no need to embed it within an HTML page although that is certainly possible, and you also download it here. You can move the player using the ‘A’ and ‘D’ keys, and fire with the ‘S’ key. The space bar pauses and unpauses the game.

Here is a little excerpt taken from the Space Invaders Atari 2600 manual:

Welcome to Space Invaders! Before you can begin playing, the first step is to place your cursor over the docking rectangle in the upper-left hand corner. Once the cursor has been positioned over the rectangle, click it and it should change color. Lift your hand from the mouse and you’re ready to play!

You are a recent enlistee in the Earth Defense Corps. For the past six weeks you’ve undergone grueling and intensive training. Now you stand at attention, nervously anticipating the most critical section of your training…

“Okay, kid, you’re on!” barks your commanding officer.

Quickly you climb into a laser tank. A second enlistee follows you. You each settle into deep, leather seats. With a soft whirring sound, the automatic hatch cover closes overhead. As your eyes adjust to the dim light of the laser capsule, you begin to make out the controls. Mentally, you check off each knob, dial, button, and display. For the next several hours you and the other enlistee with operate these controls to defend your planet in an attack simulation. The screen in front of you lights up. A column of bomb-dropping aliens advances toward you. What next? For a second your mind goes blank. Have you learned your lessons well? No time to refer to the manual now. Your commanding officers are watching and it’s your show.

Your tasks are to stop the invaders from landing on your territory; avoid enemy bombs; and score as many points as possible. The simulation ends when you lose all your lives or when any invader lands on your planet. If you destroy all 36 space invaders before they touch your planet, a new set of invaders will appear on the screen. Each new set of invaders will move a little faster than the previous set.

You begin each game with three shields. Initially, you are safe behind the shields. But as you and the enemy hit the shields with lasers and bombs, they become damaged and eventually disappear altogether. As the space invaders come close to the shields in their descent toward you, the shields will be destroyed and your only hope is to destroy the remaining invaders before it’s too late…

Child of Light

May 22, 2014

Child of Light Rendition

My wife is having a great time playing the Ubisoft game called Child of Light. It looks absolutely gorgeous with an interesting narrative and character model, great music, and a fluid control system. I am definitely looking forward to playing it!

Windows 98 Game Machine

May 12, 2014

Windows 98I have been wanting to build a Windows 98 retrobox machine for a long time, since running Windows 98 games in a virtual machine with hardware acceleration that works is next to impossible, and although I know of and have downloaded games from services like Steam and gog.com, they don’t solve the problem of how to install other Windows 98 software that I am interested in using. I also enjoy the visual nuances produced by 3DFX chipsets and drivers which are not emulated by either service.

The trick is in selecting the right hardware for maximum compatibility and performance. As a starting point, I have chosen the following pieces of hardware to assemble a basic machine:

  • Asus P4B Motherboard with 512 MB of RAM
  • SoundBlaster 128 PCI
  • Radeon 9600 Pro PCI with 128 MB of VRAM
  • DFE 538-TX PCI Network Card
  • SD Card to IDE Interface Board

The last item may need a bit of explaining. Basically, I don’t want to deal in hard drives anymore; I want a technology which I can use to easily backup and recover software images for some of the older machines I maintain. I also want something a little less noisy and faster than a typical hard drive used the in early 2000-2006 period for Windows 98 installations. After some research, I have ordered a unit or two off of eBay a few weeks ago for just a few dollars. I want to use just one or two to trial the hardware, since I have never used these boards before and I don’t know what their limitations are. I have been using the board now for a few weeks and it seems to be performing nicely. I really enjoy the ability to remove the “drive”, shove it into an SD card reader, add a few files which would have been otherwise tedious to download via the platform’s ancient Firefox installation (I am using the latest for the Window 98SE platform, which is version 2.0.12 I think).

A warning around RAM and Windows 98SE installations. I began this process with 1 GB of RAM and throughout the process of getting my benchmark games up and running and the platform driver installations ironed out, I was plagued by mysterious problems like random crashes, screen freezing, DirectX audio issues, and out of memory errors. The out of memory errors happened less frequently, unfortunately, which made debugging the issue rather difficult, since it appeared that my sound card drivers were the source of the problems and not the onboard memory. In the end, it was due to the amount of memory I had installed on that motherboard several months ago. Once I removed the “extra” 512 MB of RAM, things just started working flawlessly. I have done a bit of research and it seems that certain hardware and software problems within the OS can trigger these issues, but it is still possible to enjoy 1 GB of memory on some installations and OS configurations, even though the operating system may not use it. In general, if you have a Window ME installation available, then use that as it seems to be a more robust Windows 98 era platform.

The games I have tested so far are Deus Ex and System Shock 2; there are issues surrounding the latter within my new installation, which I will get into in a later post.

The Music in id Software’s Quake

March 15, 2014

I had no idea that the music and various sound effects were created by Nine Inch Nails lead singer, Trent Reznor. That’s just a small glimpse into the popularity of id Software and their games at the time. If you don’t want to read the book, one particularly interesting video history of the company is available on-line.

id Software

Give your NES an Audio Upgrade

January 2, 2014

I learned a little while ago from a friend of mine that the North American version of the NES is somewhat crippled in the audio department, when compared against its Japanese counterpart. The NES hardware supports five channel audio and the hardware did not permit companies to add additional sound channels. The reasons for doing are unclear but is most likely attributed to the limitations placed on North American developers in an effort to regulate the quality of the NES games being produced; in Japan, for example, the game companies were not limited to simple hardware mappers, they were allowed to add additional hardware into their NES cartridge designs. One example of this is the VRC6 chip created by Konami and used in the Japanese version of Castlevania III: Dracula’s Curse.

If you are using the PowerPak, then you can perform a simple hardware mod which allows you to tap these additional music channels. Most of the work is simply removing the casing, hardware shielding, and cartridge harness. The last step is to solder a 47-ohm resistor to pins 3 and 9 on the underside of the board. I wanted to assemble a more complete walkthrough than what can be found on the Internet for those who are not use to doing this sort of thing.

First, you see the interference shield.

Step One

Remove it, and then remove the screws securing it to the base.

Step Two

Flip the assembly over so that the expansion connector is face-up. You will see two cables which need to be detached to remove the second interference shield. Be gentle when removing the cables and don’t pull the connectors out by the wires; the large plug pulled out easily by simply using my fingers, the smaller cable looks like the connector is snapped into place, but it’s simply a friction mount and can be removed with needle nose pliers by gently pulling and rocking the connector.

Step Three

Step Four

Once the shield if removed, you will see the main board and all of its components; stop and admire the beauty of this machine and smell the history. Ahhh. Now, flip the board back over and remove the last two screws for the cartridge harness. The harness slides under the cartridge slot and should be gently removed as components on the other side of the board may be damaged by your fingers if you are not careful.

Step Five

Reorient the board as shown and locate the connector pins.

Step Six

Carefully solder the 47-ohm resistor to pins 3 and 9 of the expansion bus, reassemble and you’re done.

Step Seven

Are we overemphasizing the importance of old games?

July 28, 2013

I visit the site 1up.com fairly regularly. I enjoy their articles much more than other sites and I find they have a good perspective on retro-gaming content as well. Sometime last year, they wrote up a Top 100 Games of All Time list, which is nothing new and seems to have been done to death in the game journalism industry. Their angle was a little different, though, since they wrote up a full retrospective review on each game in the list, rather than just a short synopsis on why the game was important. One of the games reviewed was Wolfenstein  3D, of course, since that was a top 100 games of all time list. In the article, they explain that Wolfenstein 3D created all the basic elements of any FPS game made today, such as items being positioned in front of the player character, armour, tiered weaponed systems, and enemies which require different combat strategies to finish them off. I personally love this game and some of the knock-offs too, like Blake Stone: Aliens of Gold; I think a number of the core mechanics present in FPS games were popularized with that game. In the article, however, they imply that FPS games made today owe much to Wolf 3D and that it defined basically everything that an FPS could be:

“id Software set these standards back in 1992, and since then, very few FPSes have veered from these fundamental ideas.”

This assertion, I think, over emphasizes its importance a little too much. Yes, they do have some of the basic elements in common, much like every good cookie has flour and sugar as ingredients, and credit should be given to those who breached the market first as well as the inventiveness of the individuals at the time. However, saying that today’s FPSes have veered very little since then, is like saying action movies continue to have action in them, but are really just boring rip offs of the very first action film, The Great Train Robbery made in 1903. Once a genre is created, by definition, there will be situations and themes in common with other products in that category. But to say that very little has been introduced to expand the FPS genre definition since then is to ignore everything that makes them different.

Since I am a programmer by trade and one who specializes in game science and computer graphics, I know how technically different games made today are from those made in 1992, and for technical reasons alone, they should rarely (if ever) be compared to earlier titles because to do so diminishes the achievement of today’s games. There is so much more technical effort, detail, and expense in making a game like Call of Duty, than Wolfenstein 3D even when you account for shifts in the technology gap. The latter was created by fewer than five people and according to Wikipedia:

“The game’s development began in late 1991… and was released for DOS in May, 1992.”, source.

There’s not a lot of sophistication that can be placed into a game in six months; the folks at id Software were shooting to fill a void in the marketplace, much like Apple did with the iPod. They depended heavily on being the first to market. Sure, there was a certain amount of inventiveness needed for both products to be successful and having a Nazi theme surely helped to popularize the title, but usually the bar tends to be much lower since you are the first to arrive in the market. For these kinds of products, timing is just as important as any other attribute. You don’t need to be the best; in fact, various markets are filled with examples of better products which have been released only a couple of months later that do not survive, simply because they were not first to fill the void.

Whereas, games like Call of Duty or Mass Effect take years of development on teams of 50-150 people, and typically have features like:

  • Complex stories and nuances of game play;
  • Interesting characters and custom look and feel to main protagonists;
  • Large variety of multi-faceted equipment and combat scenarios;
  • Full orchestral music and top of the line sound effects;
  • Physics based environments and realistic interactive environments;
  • Sophisticated level of detail within very large environments;
  • AI driven characters which can act cooperatively or competitively in a variety of environments;
  • Player created and user-driven of influenceable story arcs;
  • Dynamic levels constructions which can be destroyed and collapsed at will;
  • Multi-player scenarios with large groups of people around team based objectives;
  • Facial animation and expression techniques which map to voice samples;

The list can go on from there, but you get the idea. Comparing one of these games to Wolfenstein 3D is like comparing a bicycle to something James Bond would drive and saying they are basically the same because they are both vehicles…