How quake.exe got its TCP/IP stack
16 points by fernplus
16 points by fernplus
My memory is fuzzy here. I don't remember ever running Quake under Windows 95 because you got higher framerates if you quit Win95 first. Once some folks got 3Dfx cards, they insisted on using GLQuake, which meant other people needed to use WinQuake (I'm a bit confused about why now, the Internet suggests that GLQuake could talk IPX? But maybe the DOS and Windows IPX stacks we had didn't play nicely together?).
Quake was a truly impressive piece of software engineering. As I recall, it was originally written on NeXT machines and ported to DOS, along with a bunch of UNIX systems. WinQuake ran on NT (most games didn't). GLQuake ran on NT and a load of UNIX systems.
The game logic was all written in a special Quake dialect of C that compiled to a progs.dat file full of bytecode, which was interpreted (I think one of the open-source forks added a JIT compiler eventually). The same mods worked on DOS as on PowerPC Macs or on any other system (OS or architecture). The equivalent in Half Life (I never looked at Quake 2 modding) was a Windows DLL, which seemed like a huge step backwards.
I wouldn't really call QuakeC a "dialect of C", just a vaguely C-shaped language with C in the name. Some things certainly do look very similar, but then there are things like:
float is used for booleans.== and !=, so you got that going for you, which is nice.entity type that auto-dereferences, but you don't get any of your own.entitys everywhere have an additional field with a given name and type.float(vector foo, float bar) baz = { ... } rather than float baz(vector foo, float bar) { ... }.local.Fascinating, thank you! It's almost 30 years since I wrote any QuakeC and my C, at the time, was pretty bad so I missed most of those differences (I also never found documentation, so I learned QuakeC entirely by reading the existing code). Sounds like an interesting language / dialect for games, though one that's largely been replaced by Lua.
My memory is fuzzy here. I don't remember ever running Quake under Windows 95 because you got higher framerates if you quit Win95 first.
I was at Microsoft at the time, and it was somewhat mandatory to run Quake under Windows 95 for testing reasons: There should have been no difference in frame-rate unless you had some 16bit drivers that were thunking regularly.
Quake was a truly impressive piece of software engineering. As I recall, it was originally written on NeXT machines and ported to DOS
That's right: It's a habit Id picked up during the development of Doom. However since they moved to djgpp for Quake I'm not sure whether they stuck with NeXT for the whole Quake development cycle. Fabien's (pay-what-you-want) book about Doom is a fabulous tech deep-dive into that period: https://fabiensanglard.net/three_books_update/index.html
The equivalent in Half Life (I never looked at Quake 2 modding) was a Windows DLL, which seemed like a huge step backwards.
Sadly that step backwards occurred in Quake 2, with which Half-Life shares DNA. I think they reverted to a bytecode interpreted for Q3A.