让我们像1997年一样编译Quake。
Let's compile Quake like it's 1997

原始链接: https://fabiensanglard.net/compile_like_1997/index.html

## 重建1997年Quake构建 本文详细介绍了编译原始*Quake*游戏的过程,力求在历史准确性上与1997年保持一致。该游戏最初在NeXT硬件上开发,并使用DJGPP交叉编译,但在*Quake*发布后,id Software转而使用Windows NT和Visual C++ 4.X。目标是使用相同的工具和环境重建Win32版本(winquake.exe)。 作者探讨了多种设置选项,从寻找原始的Intergraph或Pentium Pro工作站,到利用VirtualBox安装Windows 98SE或NT 4.0。过程包括安装Windows NT 4.0,然后安装Visual C++ 6(尽管游戏最初使用的是4.X版本),并从Quake官方档案中获取原始*Quake*源代码。 一个关键的挑战在于汇编手动优化的汇编文件,这需要VC++6处理器包,而后者本身需要以特定顺序安装MDAC 2.5。构建过程故意繁琐,反映了90年代开发的挫折感。成功重建*Quake*,甚至*QuakeWorld*,展示了VC++6在当时的力量,即使没有像Intellisense这样的现代便利功能,它也提供了调试和堆栈跟踪等功能。

一个黑客新闻的讨论集中在重现1997年Quake原始构建环境这一引人入胜且出乎意料的复杂过程。核心观点是,实现软件构建的*精确*可重复性——验证二进制文件的来源——至关重要,并且随着现代开发实践的进步,保证这一点变得越来越困难。 虽然现代CI/CD依赖于容器,但编译器、库,甚至CPU指令集的细微差异都会改变最终产品。一位评论员强调了一个极端例子,需要重新安装Windows NT以支持第二个CPU,这说明了那个时代硬件/操作系统紧密耦合的特点。另一位评论员澄清说这不是抽象的缺乏,而是一种权衡:将所有多处理器支持代码包含在单个操作系统层中会影响单处理器系统的性能。 讨论还涉及了Quake最初开发中对DJGPP的使用,以及一个相关项目成功引导早期版本的GCC,揭示了其代码生成中一个以前未知的错误。这种“软件考古”突出了理解历史构建过程的价值。
相关文章

原文
Let's compile Quake like it's 1997!

Feb 5, 2026

Let's compile Quake like it's 1997!


The first batches of Quake executables, quake.exe and vquake.exe were programmed on HP 712-60 running NeXT and cross-compiled with DJGPP running on a DEC Alpha server 2100A. In June of 1996, having shipped their title but concerned with NeXT stagnation, id Software switched their development stack.

We moved to Intergraph hardware running Windows NT right after shipping Quake.

The next versions of Quake, winquake.exe, glquake.exe, and QuakeWorld (qwcl.exe and qwsv.exe) were all developed and compiled on Windows NT with Visual C++ 4.X.

This article describes the steps to re-create the experience of building the win32 binaries of Quake as it happened in 1997.

The purist's corner


Depending on the level of historical accuracy you want to reach, you can follow the steps with four environments.

  • Find an Intergraph RealizM Dual P6-200MHz workstation (good luck).
  • Find a dual Pentium Pro machine (good luck again but finding a W6-LI is doable).
  • Use a regular late 90's PC like the Quake PC.
  • Download Oracle's Virtualbox and create a VM.

I tested these steps both on the Quake PC and in Virtualbox, running either Windows 98SE or Windows NT 4.0.

Installing Windows NT 4


Installing Windows NT 4 is pretty easy since the CD is bootable. Installation took 30 minutes.

I love how minimalist Windows NT startup screen is. It proudly displayed how many CPUs are detected (Windows 95/98 only supports one CPU) and how much RAM is there. There is no silly animation.

Adding a second CPU to a system won't be automatically detected by Windows NT. You need to re-install to get the HAL handling SMP systems. The same thing goes with dual CPU motherboard. On a W6-LI, one need not only to add another Pentium Pro but also a regulator!

Windows NT 4 uses the same UI theme as Windows 9X. The first release, Windows NT 3 used the same UI elements as Windows 3.1. It looked awful.

Installing Visual C++ 6


The Win32 version of Quake were coded on Visual C++ 4.X since it was the most recent version of Microsoft IDE available in mid-96. However, by 1999, the project had been migrated to Visual C++ 6. If you don't have the CD handily available, you can likely find it on the Internet Archive or winworldpc.com.

In a time before "always on" Internet, most software had a product ID to fight piracy.

The installation screen also brings up the next "Visual Studio", combining many development environments. It would soon become THE Microsoft IDE to rule them all.

The installation screen looks off. There is a lot of empty space and the progress bar is awkwardly placed. That is because Microsoft did not expect this to run at the crazy high resolution of 1280x1024 (which id developers likely used on their 21" monitors). It only looks as intended in 640x480 or 800x600.

With VC++6 installed, we now need to get the source code. DO NOT get it from github or transfer the files via FTP. This will mess up the workspace .dsw file. Then VC++6 will be unable to parse it. And it won't even give you an error message, it will just open and show no file / project associated. And you will lose 1/2 a day trying to debug the problem.

Instead, you need to get q1source.zip. It used to be available on id Software's FTP server but now you can get it from the awesome Quake Official Archive maintained by Jason Brownless[2].

With a VM you can transfer files via drag/drop. Alternatively you can use Quick ‘n Easy FTP Server which works on both 9X/NT.

To decompress q1source.zip, you will need WinRar. The v2.50 still works well on 9X/NT.

Now launch VC++6. Select "Open Workspace" then pick "WinQuake.dsw".

Modern versions of Visual Studio use .sln (Solution) and .vcxproj but Visual C++ 6 uses .dsp and .dsw. The dsp contains a single project while the dsw is a workspace pointing to dsp projects.

Start the build with "Rebuild All"

The build will fail because VC6++ was unable to assemble all the .s files which contain the hand-optimized assembly by Michael Abrash.

The assembler comes with VC++6 Processor Pack (vcpp5.exe).

Of course, launching setupsp5.exe to install it will fail. This is because you need to install MDAC 2.5 first.

Don't lose an hour trying to download MDAC from somewhere. You just need to run acmsetup.exe which is in the same folder created when vs6spp5.exe decompressed itself.

Now go back and run setupsp5.exe. This time it will work. By now it should feel like you are following the solution of Monkey Island. Nothing makes sense. We are definitely deeeep into the 90s.

More awkwardly small progress bar but this is still progress.

Re-open the project with VC++6 and run "Rebuild All " again. This time it should work.

Yup! Enjoy! You can even build/run QuakeWorld and it works with QSpy!

A darn good IDE


VC++6 is remarkably powerful for 1996. It has features such as "Go to definition", breakpoints, stacktrace, and variable inspections (but no Intellisense auto-completion yet). I never used it but it must have felt like a dream at the time.

References



*
联系我们 contact @ memedata.com