12 ms·
How Quake.exe got its TCP/IP stack
- mmastrac 11mo agoI still get Google hits on my 25 year old DJGPP/NASM tutorial...
- afandian 11mo ago> I didn't work on the Chunnel. That was mainly a British guy named Henry The British guy named Henry might have named it after another feat of engineering completed around the same time. https://en.wikipedia.org/wiki/Channel_Tunnel https://en.wikipedia.org/wiki/Channel_Tunnel
- torh 11mo agoOr from the Seinfeld episode "The Pool Guy" (Aired November 1995) which had a fictional movie called "Chunnel" -- probably based on the very same channel tunnel.
- ralferoo 11mo agoFrom Google (AI slop at top of search results): "Chunnel" is not a real movie but a fictional film from the TV show Seinfeld. It is depicted as a disaster movie about an explosion in the Channel Tunnel... Weird hearing that name now though. Around that time, everybody referred to it as the "Chunnel", but I don't think I've heard it as anything but the "Channel Tunnel" since maybe 2000. I suspect even that usage is now limited to only taking cars on the train from Folkestone. Every time I've travelled on it as a regular passenger from London, it's just been referred to as the Eurostar without any mention of the tunnel at all.
- afandian 11mo agoYes, it's definitely a word from a 1990s geography textbook.
- sroussey 11mo agoI was half expecting something about how to get tcp into windows, but this is win95 where they shipped it inside the os and put some company out of business that used to sell that.
- jahnu 11mo agoI used to use Trumpet Winsock with Windows 3.1 https://en.wikipedia.org/wiki/Trumpet_Winsock https://en.wikipedia.org/wiki/Trumpet_Winsock
- hypercube33 11mo agoDidn't Win95 get tcp from FreeBSD?
- LeoPanthera 11mo agoThat was Windows 2000.
- hypercube33 11mo agoNo I'm fairly certain that berkley sockets were used as a foundation to integrate a full network stack under winsockets so people wouldn't have to go buy things like Trumpet (Windows 3.1) and you could coax out messages saying as much from the commandline but Google is failing me (I'm sure most of this stuff is on usenet which no one seems to care about these days)
- zweifuss 11mo agoThe history of the Windows TCP/IP stack went most likely like this: IBM (NetBEUI, no TCP/IP) -> Spider TCP/IP Stack + SysV STREAMS environment -> MS rewrite 1 (early NT, Winsock instead of STREAMS) -> MS rewrite 2 (make win2000 faster): https://web.archive.org/web/20151229084950/http://www.kuro5hin.org/story/2001/6/19/05641/7357 https://web.archive.org/web/20151229084950/http://www.kuro5h...
- 11mo ago
- ggambetta 11mo agoI learned to solder as a pre-teen so I could make a nullmodem :) Then I learned that resistors were a thing when I made a parallel port sound card (this thing https://en.wikipedia.org/wiki/Covox_Speech_Thing https://en.wikipedia.org/wiki/Covox_Speech_Thing). Fun times!
- d3Xt3r 11mo agoI wasn't allowed a soldering iron as a kid, so I ended up just chopping and splicing a regular serial cable and turned it into a null modem, all so that I could play OMF2097 with my friends without having to share the same keyboard (we would always fight over right side, which defaulted to using the arrow keys for movement - and so the person who got the right side generally had the advantage, as back then arrow keys were the default movement keys, unlike these days where WASD is default.)
- jacquesm 11mo agoI wasn't allowed one either so I soldered with a screwdriver heated up on the gas stove when my parents weren't home...
- ggambetta 11mo agoThat's pretty hardcore, respect :)
- jacquesm 11mo agoIt also taught me valuable lessons about hardening.
- giantrobot 11mo agoYour parents: A soldering iron is dangerous! You: I'll show you!
- pixl97 11mo ago
- nikanj 11mo ago” It is impressive to see Quake run at full speed knowing that Windows 95 runs DOS executable in a virtual machine. My guess is that, in full screen, memory writes and reads to the VGA are given direct access to the hardware to preserve performances” Virtual x86 mode had little to do with what we nowadays think of when someone says ”virtual machine”
- skywal_l 11mo agoNot entirely related but Quake had a VM though, executing scripts written in QuakeC[0] which would drive the AI, game events, etc. [0]: https://en.wikipedia.org/wiki/QuakeC https://en.wikipedia.org/wiki/QuakeC
- acchow 11mo agoBut your link says that QuakeC was a compiled language
- vkazanov 11mo agoQuakeC was compiled into QuakeVM bytecode, which made all modes and logic portable between platforms without having to recompile things everytime, unlike what had to be done for Quake 2 (which was 100% native code). This hurt performance a bit but in the longer term benefited the modding scene massively.
- Luc 11mo agoCompiled to bytecode.
- FartyMcFarter 11mo agoIt's compiled into bytecode, so it still requires a VM / bytecode interpreter (whatever you want to call it).
- deleted 11mo ago[deleted]
- hapless 11mo ago
- skrebbel 11mo agoRandom drive-by nitpick: > From the beginning of the development, id had requested from djgpp engineers that their DPMI client would be able to run on djgpp's DPMI server but also Windows 95 DPMI server. I'm pretty sure that "DJGPP engineers" is just one guy, DJ Delorie. DJGPP was always open source so I bet he got some contributors, but if the rest of this sentence is true that "id has requested from djgpp engineers", it just means they asked the maker of an open source tool they used to please add a feature. I wonder whether they paid him for it or whether DJ just hacked it all in at id's request for kicks. His "about me" page suggests he does contracting so might be the latter. DJGPP was spectacularly good back in the day. I didn't appreciate at the time what a monumental effort it must have been to port the entire GCC toolchain and runtime to DOS/Windows. Hats off to DJ Delorie!
- maybewhenthesun 11mo agoAmen to that! I think I remember there was some communication between ID and Charles Sandmann about CWSDPMI, so even though it's worded a bit strange for an open source project there's probably some thruth in it? Also a bit strange how the author is surprised about Quake running in a 'VM', apparently they don't really know about VM86 mode in x86 processors...
- trollbridge 11mo agoDPMI clients don’t run in a VM, though. They’re just a normal task like any other task / process in Windows.
- toast0 11mo agoSo... Win32 runs in virtual mode. In 2025, we don't think of that as a Virtual Machine, but it totally is. Hardware access is trapped by the CPU and processed by the OS/DPMI server.
- fredoralive 11mo agoNo, in 386 mode 3.x and 9x the System VM and other DPMI clients runs in protected mode. Virtual 8086 mode, as its name somewhat suggests, only runs real mode code.
- unit149 11mo ago[dead]
- deleted 11mo ago[deleted]
- ec109685 11mo agoThis article makes it seems like 1996 was ancient times. There was the internet then, browsers, Mac’s had a tcp stack for a while by then, quake was an extremely advanced game. Yeah, the dos to windows transitions was a big deal, but it was a pretty ripe time for innovation then.
- hylaride 11mo agoYeah, but dial-up was slow, laggy, and what 95% of people used to access the internet in those days. Real-time gaming was not fun with anything that used it. I grew up in a rural area in the 1990s and was no match for people that started to get cable modems as time went on.
- 1718627440 11mo agoDial-up, has better latency, since their is no packet-switching. So it is slow, but not laggy.
- ipython 11mo agoDialup has a ton of latency (100+ms), but little jitter.
- toast0 11mo agoIf you're dialed up directly, you should be able to get a little bit better latency as you won't need IP, UDP, and PPP/SLIP headers; at modem bandwidth, header bytes add meaningful latency. But data transmission is still pretty slow, even with small packets.
- pak9rabid 11mo agoDialing-up a friend to play Quake, there essentially was no lag. Dialing-up to the Internet to play Quake via TCP/IP...shit tons of lag (150+ ms).
- 11mo ago
- cubefox 11mo agoIn an interview with Lex Fridman, John Carmack said that in retrospect, Quake was too ambitious in terms of development time, as it both introduced network play and a fully polygonal 3D engine written in assembly. So it would have been better to split the work in two and publish a "Network Doom" first and then build on that with a polygonal Quake. Which seems to imply that the network stack was about as difficult to implement as the new 3D engine.
- bitwize 11mo agoAnd then you had Romero saying that Quake wasn't ambitious enough...
- pak9rabid 11mo agoThat's the difference between an engine and game developer.
- cubefox 11mo agoThey theoretically had more than enough time for game design in the ~2 year development period, which was long for the time.
- bitwize 11mo agoIt's the difference between someone working in a world of engineering tradeoffs and a fantasist imagining their next übergame with everything awesome in it. I looked into the development cycle behind Daikatana, partly because it had its 25th anniversary this year and so for some reason, YouTube was recommending me Daikatana content. And... there's a reason why Romero's first dev team all quit. Daikatana started life as a 400-page document full of everything Romero found awesome at the time. There were going to be time travel mechanics and a roleplaying party system like Chrono Trigger. It was going to have like a hundred awesome weapons that totally reinvented how to make things go boom. It was going to have the sweetest graphics imaginable. Etc. It was like something Imari Stevenson would have written as a teenager, which is somewhat surprising since Romero could now call himself a seasoned industry professional. What's worse, "Design is Law" basically meant "what I say goes". It was his job to have the ideas, and it was his team's job to implement them. Romero wanted to be the "idea guy", and Daikatana was an "idea guy" game. I doubt he had the maturity at the time to understand what design is, in terms of solving a problem with the tools and constraints you have. He wanted Daikatana, and Quake before that, to have everything, and didn't know how to pare it down to the essentials, make compromises, and most importantly, listen to his team. Maybe there's an alternate-universe Quake or Daikatana somewhere that's just a bit more ambitious than the Quake we got, incorporating more roleplaying elements into a focused experience. But in our timeline, Romero didn't want to make that game. Of course, after taking the L on Daikatana's eventual release, Romero wised up and started delivering much more focused and polished experiences, learning to work within constraints and going a long way toward rehabilitating his reputation. But that's not where he was when he criticized Quake for not pushing the envelope enough.
- PeterHolzwarth 11mo agoIs this the sign that Fabian is beginning his look and research at Quake (ie, in slow preparation for another Game Engine Black Book)?
- bombcar 11mo agoI feel he's stepping his way to that, but Quake is an entire other world of complexity from DooM (which is simple enough that a 400+ page book can "explain" it and the OS and the computers it ran on).
- klaussilveira 11mo agoAndre Lamothe's "Tricks of the 3d Game Programming Gurus: Advanced 3d Graphics and Rasterization" is a great book for anyone interested in graphics programming from those days.
- skywal_l 11mo agoAlso "The Black Book"[0] of Michael Abrash who worked on Quake with Carmack. [0]: https://www.amazon.fr/Michael-Abrashs-Graphics-Programming-Special/dp/1576101746 https://www.amazon.fr/Michael-Abrashs-Graphics-Programming-S...
- bombcar 11mo agoWhich itself is the inspiration for the DooM/Wolf3d Black Books.
- andrewf 11mo agohttps://github.com/othieno/GPBB https://github.com/othieno/GPBB - the last chapter is a Quake retrospective. There's also the columns he wrote for Dr Dobbs' Journal during development. They're like an expanded, illustrated version of GPBB chapter's first half. https://www.bluesnews.com/abrash/contents.shtml https://www.bluesnews.com/abrash/contents.shtml
- klaussilveira 11mo ago
- fallingfrog 11mo agoAh I remember running a serial cable from my bedroom to the hallway so we could play 1v1 quake via direct connect. Good times! I think we used to play age of empires that way too.
- sempron64 11mo agoIt's amusing to me that in the 90s you could easily play Quake or Doom with your friends by calling their phone number over the modem whereas now setting up any sort of multiplayer essentially requires a server unless you use some very user-unfriendly NAT busting.
- kamranjon 11mo agoI wonder if there is a way to use tailscale to make it easy again?
- blackcatsec 11mo agoQuite literally folks have done this for decades using Hamachi.
- sempron64 11mo agoHamachi and STUN were what I was thinking of when I referred to user-unfriendly NAT busting. It's true that these are not much harder to get working than a modem, but they don't match up with modern consumer expectations of ease-of-use and reliability on firewalled networks. It would be nice if Internet standards could keep up with industry so that these expectations could be met. It's totally understandable where we've landed due to modern security requirements, but I still feel something has been lost.
- klaussilveira 11mo agoBut how are you going to circumvent the user firewall? He still has to open ports there, even using STUN or Steam Relay or Hamachi.
- blackcatsec 10mo agoHamachi does not require you to open any ports on your firewall by nature. Except maybe the local firewall (Windows firewall, likely) which apps should automatically get asked for when they try to use a port.
- anthk 11mo agoOn DOS runnning fast under W95, how no one created a SVGALIB wrapper trapping i386 code and redirecting the calls to an SDL window?
- badocr 11mo agoI recall reading about TCP/IP-powered Internet multiplayer DOS Quake in TECHINFO.TXT that shipped with the retail version of the game, and I quote: Beame & Whiteside TCP/IP ------------------------ This is the only DOS TCP/IP stack supported in the test release. It is not shareware...it's what we use on our network (in case you were wondering why this particular stack). This has been "tested" extensively over ethernet and you should encounter no problems with it. Their SLIP and PPP have not been tested. When connecting to a server using TCP/IP (UDP actually), you specifiy it's "dot notation" address (like 123.45.67.89). You only need to specify the unique portion of the adress. For example, if your IP address is 123.45.12.34 and the server's is 123.45.56.78, you could use "connect 56.78". I looked around a little and sure enough, a copy of the software was avaiable in a subdirectory of idgames(2?) at ftp.cdrom.com. I knew nothing about TCP/IP networking at the time, so it was a struggle to get it all working, and in the end, the latency and overall performance was miserable and totally not worth it. Playing NetQuake with WinQuake was a much more appropriate scenario.
- pragma_x 11mo agoFrom that first graph: Who was using WinNT in 2005?!
- toast0 11mo ago> And in 1995 there were only two: us, and Total Entertainment Network. You might think game creators would come to us and say "please put my game on your service!", but... nope! Not only did we have a licensing team that went out and got contracts to license games for our service, but we had to pay the vendor for the right to license their game, which was often an exclusive. So, we had Quake and Unreal; TEN got Duke Nukem 3D and NASCAR. FWIW, the Total Entertainment Network (TEN) got Quake later, here's a press release from September 30 1996 [1]. Wikipedia says QTest was released Feb 24, 1996, and I can't find when MPath support launched, so I don't know how long the exclusive period was, but not very long. Disclosure: I was a volunteer support person (TENGuide) so I could get internet access as a teen; I was GuideToast and/or GuideName. [1] https://web.archive.org/web/20110520114948/http://www.thefreelibrary.com/TEN+Shakes+Up+the+Gaming+World+With+Addition+of+QUAKE%3b+First...-a018731815 https://web.archive.org/web/20110520114948/http://www.thefre...
- John-Tony12 11mo ago[flagged]
- dndvr 11mo ago-------------------------- John-Tony12 27 minutes ago | parent | context | on: How Quake.exe got its TCP/IP stack Fascinating deep dive — shows how Quake.exe integrated its own TCP/IP stack, highlighting clever engineering and early game networking innovations. -------------------------- This is AI right? the em dash and the inane sycophantic reiteration
- klaussilveira 11mo ago> inane sycophantic reiteration That's a pretty good way to put it.
- nu11ptr 11mo agoWhat a blast from the past. I recall my own experimenting with DJGPP and DPMI in my own software. It felt futuristic at the time. I was blown away. Another fond memory: I was playing Star Wars: Dark Forces (I think that was the one) and was frustrated with the speed of level loading. I think it used DOS/4GW and I recall renaming it, copying in a new dos extender (was it CWSDPMI? not sure), and renaming it to the one Star Wars used. I was shocked when it not only worked, but the level loading was MUCH faster (like 3-5x faster I recall). My guess is whatever one I had swapped in wasn't calling the interrupt in DOS (by swapping back to real mode), but perhaps was calling the IDE disk hw directly from protected mode. Not sure, but it was a ton faster, and I was a very happy kid. The rest of the game had the same performance (which makes sense I think) with the new extender.
- jhallenworld 11mo agoIn the early years of Linux, before it had networking, we used KA9Q for the TCP/IP stack: https://www.ka9q.net/code/ka9qnos/ https://www.ka9q.net/code/ka9qnos/ This worked in DOS, but was easily ported to Linux. As far as DPMI: I used the CWSDPMI client fairly recently because it allows a 32-bit program to work in both DOS and Windows (it auto-disables its own DPMI functions when Windows detected). https://en.wikipedia.org/wiki/CWSDPMI https://en.wikipedia.org/wiki/CWSDPMI
- Rodeoclash 11mo ago> If you wanted to play a multiplayer game on the internet, either you needed to have explicit host & port information, or you needed to use an online multiplayer gaming service. Technically true, although tools like Kali existed which could simulate IPX style networks over the internet. I know this because I played a substantial amount of Mechwarrior 2 online when it designed only for local network play!
- lizknope 11mo agoOf course Quake had to support DOS but id developed Quake on NeXTSTEP which of course had TCP/IP and they had been supporting Linux and other commercial Unix versions like Solaris since Doom a few years earlier.
- burnt-resistor 11mo ago> My guess is that, in full screen, memory writes and reads to the VGA are given direct access to the hardware to preserve performances. [sic] When a DOS VM is in windowed mode, Windows must intercept VGA port I/O and video framebuffer RAM access to a shadow framebuffer and scale/bitblt it to display in its hosted window. In full screen, exclusive VGA access is possible so it doesn't need to do anything special except restore state on task switching. Quake would be even faster if it didn't have to support DPMI/Windows and ran in "unreal mode" with virtual memory and I/O port protections disabled.
- xela79 11mo agoand let's not forget QuakeWorld that introduced latency compensation, allowing you to have an OK experience with up to 200ms ping, where as the normal Quake TCP/IP stack was basically unplayable with anything over 70-80ms. https://quakewiki.org/wiki/QuakeWorld https://quakewiki.org/wiki/QuakeWorld my first multiplayer Quake was with Qtest in February 1996 using a null modem cable between two machines, and later on using coax cables and IPX in DOS getting a multiplayer game running was a tech feat compared to the plug & play nature of things now. the learning curve is gone now.