Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Source code for Quake 2 rerelease (github.com/id-software)
575 points by steveklabnik on Aug 10, 2023 | hide | past | favorite | 227 comments


Quake II was my first experience writing C.

The code is clear, coherent, and straightforward. I’m not going to say it’s the best source code I’ve ever read, but it set a high bar. I’ve read source code to games since then, and I’ve seen all sorts of weird stuff… I’ve seen functions with nesting levels that go past the right side of the screen, I’ve seen functions a mile long that do a million things, you know. It was an early lesson that you could do cool things with simple code.

We used Quake and Quake II to teach a VR class to kids in the late 1990s and early 2000s. You got a VR headset, you got a half-dozen PCs with Q.E.D. or Qoole, and you taught a room of 12-14 or 14-18 year-old students how to make their own virtual reality game.

“Make your own virtual reality game” was, essentially, making your own Quake or Quake II level, without any monsters or guns in it. The story for the game could be told through on-screen messages triggered in the level. Students made all sorts of levels. One group made a level with slime you had to cross, and a button that turned on pumps to drain the slime (very much like what you would see in a standard Quake II level). Another group made a 3D maze out of water that you had to swim through, floating in space. I still have some of these student-made levels on my hard drive, after all these years, although I have trouble getting some of them to work.

For the class, I made a mod that gave the players a flaregun instead of the blaster. Basically, it was still the blaster, but with a different sound effect and no weapon model. I modified the blaster bolt to be affected by gravity, bounce off of things, and go out after a certain amount of time.

(If you were in that class—you may not have gotten the headset. We couldn’t always get it to work.)


Certainly id's code is clean and well-structured, however I always had a tough time trying to grok it as a layperson. Comments (those within the functions) are relatively sparse, and the code often contains quite cryptic expressions that are somewhat bewildering to those without an high understanding of 3D graphics.

This, of course, makes perfect sense as an output from an industry leader in the field (Carmack). However it definitely requires a lot of foreknowledge and, dare I say it, a mathematical bent to follow with confidence.


"I’ve read source code to games since then, and I’ve seen all sorts of weird stuff… I’ve seen functions with nesting levels that go past the right side of the screen, I’ve seen functions a mile long that do a million things, you know. It was an early lesson that you could do cool things with simple code."

Guilty as charged!

I used to chronically write macaroni code. So you would have like 25 lines of code that ended up being the back bone of like a dozen things that would have another dozen things stacked on top of each. Would execute super fast BUT would amount technical debt quickly and eventually said functions would become untouchable because you would risk breaking a lot of stuff build on top of stuff.

Comments would try to clear it up, but communication skills where not the best. Explain function but not workings. Things like - "Does SINE table". "Table Defrag". "Binary resolve" etc.

Get a lot of people going "What the F*K is this shit?! But... it does the job damn fast". If it was any field other that video games, I would not have lasted long and neither would the product...


Appreciation for that id code means you may appreciate "John Carmack on Inlined Code (2014)": https://news.ycombinator.com/item?id=12120752


I never scrutinized the id software source, but man have I seen some horrifying game source. The bar is extremely low.

What's surprised me is that successful, fun to play, and stable enough games have been shipped with such absolute unmitigated disasters behind the curtain.

It makes me question sometimes all the effort(and time) I put into preventing the chaos, when such carelessly bodged together garbage can be perfectly profitable.


It's nice when you can have both but I have yet to see a game review that mentions how clean the source code is!


That's usually because the high level gameplay code needs to be incrementally tweaked over months or years based on very subjective feedback like "this doesn't feel quite right, can you maybe try...".

You can start with a great plan, but no plan survives gameplay- and balance-tweaking for very long.

Ideally the lower layers are much more structured though, usually those need to be maintained over a longer time and across games.


You can see places in the Q2 code where it has been incrementally tweaked a bunch. The player movement code got a bunch of changes, and you can see blocks of it that are commented out or have #if 0. There are some comments explaining the thought process, but it’s not very clear.


That garbage code brought about the speed run culture, highlighted by charity events like Awesome Games Done Quick. The speed runner and their crew on stage will explain the latest level skips, wall clipping to avoid tedious areas, enemy weaknesses and exploits, and frame perfect input strings needed to accomplish those. And some will perform speed runs blindfolded with only the audio cues to work with.


That hardly has to do with code quality, but instead that some edge-case "features" were not anticipated by the game designers, programmers and QA team, but "discovered" later by speedrunners.


Sometimes it is about code quality. Defensively written, well-documented and well-tested code would not be as likely to suffer from such bugs.

It's not just subtle floating-point errors either, but also outright wrong maths that appears to work (see [1] for an example), memory leaks [2], buffer overflows [3] etc.

[1] https://www.youtube.com/watch?v=4gNYTqn3qRc

[2] https://news.ycombinator.com/item?id=20410166

[3] https://arstechnica.com/gaming/2021/03/how-to-beat-paper-mar...


I think they made the right trade-off, back in the 90s on hardware that could barely run the game, sticking extra defensive checks to make sure you have not accidentally clipped through the geometry, or simpler ones like making sure you are not running too fast, seems excessive.

They weren't coding for some NASA space probe and they knew it.


Typically you'd put the checks only in debug builds.


The id software source code gets increasingly cleaner for each game I think. I've read the Doom source code and Quake II's. I remember Quake II being very clean and elegant. Doom is not quite there. It's fairly well organized, the functions are generally short and concise, but it's a mess of global variables.


Can you share any screenshots of the results of this course? It sounds amazing!


Whoa, I still remember watching a show about VR on the Discovery Channel around 1999 when I was a kid. They used Quake 2 as a demo, and it blew my mind. I was playing Quake 2 on my PC also, but the concept of VR was revolutionary to me at the time. It's stuck in my head to this day. To now learn that using Quake 2 was a common practice for teaching VR. Maybe it was you in that documentary!


Talking about clear and coherent, does anyone know if there is a deeper reason for using `break' and `continue' instead of pure structured programming? The snippet

  i = ent->client->chase_target - g_edicts;
  do {
     i++;
     if (i > maxclients->value)
        i = 1;
     e = g_edicts + i;
     if (!e->inuse)
        continue;
     if (!e->client->resp.spectator)
        break;
  } while (e != ent->client->chase_target);
for instance, from the function ChaseNext in the file original/rogue/g_chase.c can be reduced to

  i = ent->client->chase_target - g_edicts;
  do {
     i = i % maxclients->value + 1;
     e = g_edicts + i;
  } while ((! e->inuse || e->client->resp.spectator) && (e != ent->client->chase_target));
which in my opinion is clearer since the exit condition for the loop is in one place.


I find the latter - with all the conditions much less clear. I have to pause and reason about each condition and it’s relation to the others, the order of the comparisons and the effect of short circuits.

The first example makes it very clear that condition A means do it again and condition B means exit this loop while condition C establishes the boundaries of the loop.


I think it's debateable which is clearer. Your while condition requires some mental parsing of the booleans whereas the original can be analysed one at a time.

I'd say I prefer the original.


For me the original is much clearer and is how I normally structure my iterators/do/for loops, since explicitly checking for conditions and using 'continue' when the iterated value is not worth processing makes it nice and clear that everything _after_ these checks is valid and can contain the meat of the processing without more if/else checks.

This approach also works fine for c++ and c# code (probably also java too), which I like as it keeps my projects nice and consistent and I can jump between codebases and feel at home.

The only thing that I don't like about it is the if() statements not being contained in {}'ies. That always makes me nervous.


One nice property with (pure) structured programming is that the statement

  do {
     ...
  } while (p);
guarantees that p is false after the loop and this makes it easier to reason about the program. With breaks, however, the loop could be "lying" so to speak.


Agreed. I think it's also a little easier to understand what's going on when stepping through the code in a debugger.


Using % vs comparison and reset was probably more efficient with the compilers of the time; might still be.

Also I doubt everyone would agree that the one exit condition is more clear. For example, if I know that if e->inuse is 0 it will continue with the next round. Arguably it's more difficult to understand that from the single combined expression—because it isn't so: if !e->inuse but e == ent->client->chase_target, the original will loop but yours will exit.

Though I'm guessing ent->client->chase_target->inuse is probably never 0.


> if !e->inuse but e == ent->client->chase_target, the original will loop but yours will exit.

No, the continue statement will jump to the test part also for `do' loops:

"The continue statement is related to break, but less often used; it causes the next iteration of the enclosing for, while, or do loop to begin. In the while and do, this means that the test part is executed immediately"

-- "The C programming language (Second Edition)"


Well today I have learned something I may have forgotten, thank you :). It seems natural in for and while so it does make sense also the do loops use it.


Seconded that the main reason was probably avoiding a mod. But it's not because of the compiler, but the processor. Mod and division instructions are always more expensive than additions and multiplications. If this function was on the hot path (and looking at where it's called, it's at least called once per frame), that may have mattered a lot.


A modern optimizing compiler would quite likely do induction variable elimination/strength reduction and replace the % with increment-and-reset if it deemed it more efficient, so it’s also about the compiler.


Pretty sure your line 3 and the original lines 3-5 are not equivalent. Check it with `i` entering the loop with value `maxclients->value`.

The best reason not to re-write for style reasons is you break it.


Thanks, now corrected.


If `i` can enter with value greater than `maxclients->value` (why not), it's still wrong.


Break, continue, return (and arguably even C's goto before variables could be declared in the middle of a scope block) are all entirely normal tools in the structured programming toolbox. How those are used is just personal taste.


I had to laugh at this https://github.com/ESWAT/john-carmack-plan-archive/blob/mast...

----------------------------------------- John Carmack's .plan for Jan 31, 1997 -----------------------------------------

I went down to the ferrari dealership today with Ann and American with the intention of buying a new f355 as a "sensible" car (in contrast to my other twin turbo monstrosities).

There was an F40 sitting out front.

Umm. Sensible car. F40. Sensible car. F40. Hmmmm.

American played the evil conscience and Ann played the good conscience. For a while. Then Ann got infected by the Dark Side. :-) I bought the F40.

Ok, I now have too many ferraris. I have a plan to fix that. This hasn't gone through all the legal crap necessary yet, but it is my intention to give away my first ferrari as the grand prize of a Quake tournement.

Yes, I am serious.

DO NOT SEND ME ANY MAIL ABOUT THIS! When we have more to say about it, we will make a formal announcement. This would be a good time to start a heated debate in the newsgroups about what the fairest tourney rules would be, though.

The specs:

1987 328 GTS with turbocharged engine. Feature in the january, 1994 issue of Turbo magazine. Made 360 HP at the rear wheels on a chassis dyno. New engine (I melted the first one...), new paint. The interior could use a little work.

I plan to also include enough cash to cover tax and insurance.


A prospective buyer is coming, you say? Hmm, let's park the F40 exactly next to the gate accidentally.


As I recall, when Seymour Cray would buy a new car, he'd pick the first car on the left as he entered the dealership.

After 2 or 3 purchases, the dealer habitually put the most expensive car in that spot.


I'll drop my Quake II anecdote here. Quake II was the first FPS I ever beat (at least I think I beat it). I did it over a week in the summer when visiting a friend out of state (never would have been allowed otherwise).

When I started, I had only ever played the original DOOM, so I used those controls, and lo and behold they worked, and I thought nothing of it. At some point as I was playing along, my view suddenly became locked to the ceiling and I was thoroughly confused and stuck. Turns out I had bumped the mouse, and managed to figure out that mouse look was a thing after extended fiddling with the system to try to determine the cause and get back to killing badguys. Needless to say, the game got quite a bit easier after that.

There wasn't internet, neither I nor my friend knew what mouse-look was, we had never seen anyone play a true 3d fps. It is hard to imagine how obscure and alien the interfaces for games are because of how pervasive the knowledge has become.

Glad to see the source code released!


> Glad to see the source code released!

In case you were unaware, this is actually the source code of the rerelease of Quake II. The source code for the original Quake II has been released for many years[0], along with many of the id Software classics[1].

[0]: https://github.com/id-Software/Quake-2

[1]: https://github.com/id-Software


It's also only the code for the game.dll, which is important for modding but doesn't include the new engine.

If it's anything like the Quake re-release, it's not actually using idTech 2 at all.


In case you were unaware, the source code of the original is included along with the re-release in this repository, as stated in the first sentence of the readme.


I think Zambyte just wanted to let the GP know that the code for the original had already been released before this one. No need to be mean.


You reminded me of the first time I saw a lan full of people playing an fps.

I was at a ComicCon in Rome, Italy, circa 1999, anyway Half Life just hit gold production and released multiplayer demos there were at least 20 people all playing on lan multiplayer half life, with mouses too! Crazy.

I went to many many lan parties since then up to 2005, then online match making killed quakenet and socializing.


Oh man! Memories.

Back in 1999, Quake II was the game I played (like, literally the only one). I sunk so much time in QII and I wrote my very first code building a Mod.

I think it's fair to say, Quake II turned me from a computer user into a computer programmer. And set the course for my entire adult life and career.

From my original mod, I learned how to calculate vectors, learn an existing code base, integrate autobuilds for rapid testing.

I also dabbeled in making maps, learning 3rd art, but, quickly realized I am no artist or designer.

Sadly, my version control and backup policies at the time were non-existant and I've lost all my original code.

The next game that really got my attention in the same way was Tribes 2, the scriptings and modding you could do there was truly amazing.


In my endless files, I just found the binary of my mod.

https://xn0.co/Xeno-Mod_1.9_Setup.exe

Because I'm sure everyone on HN just downloads execs from a random internet source and runs them!

But if you have the OG QII, are curious, it is safe to run.


No way I’m running that unless you publish it on NPM.

Then you could even do: npx run quake-2-xeno-mod@1.9


Someone making a Nix with quake 2 and that specific mod and making sure it runs fine on OpenBSD as we speak.


> Because I'm sure everyone on HN just downloads execs from a random internet source and runs them!

Not true, some of us have JavaScript disabled.


> Because I'm sure everyone on HN just downloads execs from a random internet source and runs them!

...should I not?


This is what work computers are for.


This. If you aren't helping test your company's security - who is??


What does your mod do?


This is all from memory so, I might be missing some things:

Adds 10 extra weapons

Changes the damage ratio of all weapons

Imports the "gravity mines" from one of the Q2 expansion packs

Adds togglable "moon boots" (low gravity, on a per-player basis)

Adds a grappling hook, with swing physics

Has "secret" command to turn invisible. (I can't remember what it is). Because back in 1999 I didn't realize people could unpack binaries and read them.


My cousin and I burned hours in Quake2 with a mod that did these. Jumping around in low G while grappling around all over the map while trying to hit each other was fantastic - thank you for some of the best early FPS gaming I can remember!


Tribes 2 was my first taste of modding, the game holds a super special place in my heart too. Then came Ultima Online emulators Sphere and RunUO that turned me from a gamer into a programmer too.


I had a lot of fun making the HaVoC Tribes 1 mod. It was really cool seeing there was 1000 people online playing my mod at once.


You made HaVoC?! I loved HaVoC! Thank you so much for making it and putting time into it.

I assume this[1] is your website, please do not ever let the website go offline. It is such a perfect reminder of the time it is from.

[1] http://havoctribes.com/


Hello! Yes! It's cool you remember. I resurrected the site a while ago and gave it a domain. I also have a HaVoC server running on a Linode, so there will always be a server up. The master servers are a bit of a mess and it's a little hard to setup a client, but it's possible. I skipped T2 and haven't played T1 in a long time. I played Tribes: Ascend for a while, it's pretty good but now dying/dead. I miss T1. PubG and others just don't do it for me. Nowadays I play Rocket League occasionally and that's it.


_the_ havoc? That's awesome. I was toying around with tribes modding too but only trivial stuff. Havoc was always the ultimate thing you could do and an inspiration for me. Thanks!


I didn't really expect anyone who played HaVoC to see my post. It's cool you guys are out there!

Like you I was just tinkering, though I stuck with it for a long time. At that point I was 19 and literally living in my mom's basement.

It's all server side so there wasn't a huge amount you could do. The flame thrower was just the grenade launcher rotated upside down. The shotgun was my best invention, IIRC made up of two ELF guns rotated 90. Deadly up close with a delay before firing, only useful from afar to take off a sliver. Cloaking and hitting someone in the back with it was great -- click-click BANG dead. Good times!


Rune was mine. A buddy and I got into level design, and I got into modding along with it


Tribes 2 and Unreal Tourney were childhood faves.. when I played something other than CS 1.6


This man computes


Discovering the drop down console was a revelation.

An homage: http://guake-project.org/


I wish I could find a use for that, it is a funny idea. Unfortunately in a world where all of you stuff is in terminals, having one special drop down one is less useful.


I hadn't set this back up after getting a new laptop, but it's great for any of the one-off things you might need to do like confirm that some webserver is down like someone on chat complained it was, or lookup an ip or dns entry.

So the real benefit IMO is that it then lets you keep your actual terminals more clean and focused, and not just interleave that kind of stuff with whatever you are doing.


I use Yakuake (KDE's equivalent) for my password manager at work.

I find most DE's painful without that ability. The main exceptions are i3/sway or cwm, where I just launvh a terminal and then kill it.


I think that must be it, I use i3, so popping open a shell is always an easy option.


Never use sudo again! make the drop down be always at your root shell.


sv_cheats 1


I use iTerm2 that pops up F12, it's surprisingly close to that drop console behavior.


The Windows terminal now has a quake-style dropdown mode by default.


Incredible and just sent me way back to the nineties. To be fair, I'm talking about the first Quake game here. I had a PC rig on my bedroom floor which as I recall was a Pentium 166MMX, and my friend came over with a similar machine which was a bit faster (a 233) perhaps. No LAN cards insight.

Using one of my dad's ancient parallel cables and fooling Windows into thinking it was a LAN connection, which worked well enough, we played for days, until it got kind of tedious. So we then got into the whole modding scene - not creating anything, but downloading and testing the things which were out there. I will never, ever forget Girobot and KQP (Killer Quake Patch).

The Girobot bots were a force to be reckoned with when they didn't get stuck in the terrain. It was KQP which added all kinds of crazy mods/weapons/bot systems to the game that was the real gold. The Vampire Gun left us in stitches every time someone was hit by it, because it basically guaranteed a slow but not too slow death in which the hit player would crumble into little chunks of flesh. I miss the nineties very, very much.


"Girobot", do you mean the "Gyrobot" by "Gyro Gearloose" [1]?

Also, I believe KQP had ZeusBots included (for reference).

[1] https://github.com/Jason2Brownlee/QuakeBotArchive


ZeusBots were where it was at, for me.

First few computers were too slow to run Quake effectively, but then I had a Duron 900 (they ran slow AND hot!), bought a 'PC Powerplay' magazine that came with a CD full of quake mods, and a map with 20-40 of ZeusBots worked just fine!


Oh man, PCPowerPlay! I had my q3 mod written up in there in 2000 [1].

[1] https://github.com/Jason2Brownlee/HumanDebrisArchive/blob/ma...


Holy shit it's Soldat in the quake engine. Dude that's cool. Totally giving that a bash with friends if we ever LAN again.


Thank you for the correction, sorry, it has been forever. The link is fantastic, thank you for that as well.


I had 8gb of downloaded-over-modem and sometimes T1 mods, maps, skins for quake 2 multiplayer. I miss the mods so much.


The endless amounts of user created mods, maps, and skins many of us enjoyed in early days were killed off so that game publishers could make a fortune charging us for a small selection of sanctioned DLC. In the process they killed off an entire ecosystem that grew up around user created content. Forums, review sites, file hosting, and generations of new talent who found their love of programing by creating mods all lost due to greed and a desire for control.


my dad's ancient parallel cables

With a null modem? I had same setup with my college roommate in our apartment. This was mid 90s, so it was Doom 2 and other FPS from that time.

Great memories.


Indeed. My brother and I played starcraft using the same trick. When the fight started to escalate and there were hundreds of units fighting, the lag got really really bad, but it worked well enough that we kept coming back to it. That and Warcraft 2, Heretic, Hexen, all the rest. The best days in gaming IMO.


it reminds me of the saying: the golden age of sci-fi is 15.


Quake 1 (original DOS version only) supported null modem, but Quake 2 didn't -you had to use a null modem with Windows 95 dial-up networking, which was a bit more tricky to setup.


I saw grumbling elsewhere about how the re-release doesn't include a Linux version, but here they are with the source and it claims to be tested with clang. Big props to iD for sticking to their principles.


I wonder why they released the source code for this one. Is it purely because of the principles, or did they have a legal requirement since the old one is also GPL licensed?

I'm assuming they don't have legal requirements since they owned the old code anyway.


John Carmack has been fairly vocal about releasing the source code for his games, particularly the Quake/Doom series for as long as I can remember, going back to at least Quakecon 2004 during one of his keynotes there. I think at the keynote when they announced Doom 3, he even talked at length about eventually releasing that engine as open source, I think in 7 years (which eventually did happen). He is not the flag carrier for open source games, but he may be one of the most consistent at following through on open sourcing their base engine over the last 20 years. Before leaving Meta as CTO he was speaking about making sure the GO and Quest 1 were usable in offline mode with sideload capability when they become EOL'd. In my view this release of code is not at all surprising in the least.


I went to quakecon 2004, it was an amazing experience. I keep wanting to go back but never do, maybe next year I'll go as a 20-year follow up. I have no excuse because I live very close to the hotel!


Quakecon 2023 is happening right now till Sunday, maybe you can get back some of those memories watching the Quake Pro League matches live stream https://youtube.com/@Quake


ID has traditionally release code for their games when they reach...I forget, 10 years, or end of official support or something. This is just continuing the tradition of giving their games the longest of tale by opening them up. Check it out. https://github.com/id-Software


They used to open source the code after 5 years, but I think they stopped open sourcing their games after Carmack left.

It could just be that they started using other proprietary components in their code though.

Would've loved to read the source code for Doom 2016!


Yeah they use a substantial amount of proprietary middleware now, so even if they wanted to open source the engine it would be difficult to pull off. As of Doom Eternal they're using middleware for at least audio (Wwise), video (Bink), compression (Oodle), physics (Havok), culling (Umbra) and networking (Playfab), plus any references to console SDKs would have to be meticulously scrubbed from a public release, which was less of an issue back when they were a PC-first studio.


Rage should still be releaseable as Carmack wanted to release the source code at some point but he left id before that happened.

I always found amusing that to replace him Zenimax built a whole new studio in Germany to hire the top programmers from Crytek and even then Doom 2016 used a litany of middleware :-P.


Shame they never finished Rage. It was a pretty good game up to the point where the boss came in and said they needed to have it out the door in a week.


It probably went through some heavy development hell, it was id's longest game in development (7 years) and IMO it wasn't really that great as a game - the shooting bits were great and felt very good (the best part of the game), the driving sections felt bad with the levels being too small to drive around and too large to walk and the quests felt tacked on. The various "bonuses" (like those things that hang in the air and you can pick up by making stunts) feel like excuses to pad out the game's length.

It was like the game didn't know if it wanted to be an FPS or some seamless open world ARPG so it tried to do a bit of both and the only reason the FPS side didn't felt bad was because id was masters at making FPSs by that time - but it was certainly dragged down.

It would have been way better if it was a regular FPS with a linear progression of levels like id's previous games.


Doom 3 even had that issue to a smaller degree. They had to rewrite some sort of lighting middleware before open sourcing. That's just one piece of middleware though, and modern stuff is probably much more hairy and complex.


That one wasn't middleware but rather a patent issue, the code in question was written by Carmack but he had unwittingly rediscovered a technique that had already been patented by Creative Labs. Id licensed it from Creative for Doom 3s commercial release but legal wouldn't sign off on including it with the open source version so Carmack swapped it out for a different, slower algorithm.

https://www.gamedeveloper.com/design/patent-issue-forces-new...


Ah thanks for the correction. It's been a while since I've read the details.


This is why software patents shouldn't be a thing at all =(


Original Doom used proprietary DMX audio library https://doomwiki.org/wiki/DMX, didnt stop Carmack and Raven from releasing sources.


Per the article they only open sourced the Linux port, which had already had DMX stripped out and replaced with an open source alternative.

With the newer engines there isn't a convenient branch that already has the proprietary parts substituted, and there's a lot more of them.


It's such a good thing for the company to do - gives back to the community, generates a load of good will and ensures that we don't lose the history of games. Props to ID.


It also helped them out for porting to phones and stuff for official releases if I remember right.


I remember in one if Carmack's last Quakecon keynotes, after the acquisition, he was talking about future source code releases. He didn't say anything definitive, but he did tell a story where he spoke with a Zenimax lawyer, and they told him how important the GPL releases were.


This is not the engine code, this is the game code that was released even prior to Quake 2 being GPLd.

    -----------------------------------------
    John Carmack's .plan for Dec 11, 1997
    -----------------------------------------

    The Quake 2 public code release is up at:

    ftp://ftp.idsoftware.com/idstuff/quake2/source/q2source_12_11.zip

    This source code distribution is only for hard-core people that are
    going to spend a lot of time pouring over it. This is NOT a
    how-to-make-levels-for-q2 type dsitribution!

    This should keep a bunch of you busy for a while. :)
https://github.com/ESWAT/john-carmack-plan-archive/blob/mast...


They shipped this version on all of the major platforms, and I'm reasonably sure that Nintendo and Sony both use Clang/LLVM for their SDK toolchains nowadays. Maybe Linux was on their mind but getting it to build for modern consoles will have been the main motivation.


This is only the game code and not the engine source code, or am I missing something ?


Yes it seems to be missing the rendering code. game.h defines a generic list of imported function pointers which have no implementation in the repo.


There are so many games that aren't being sold anymore and aren't playable on modern software/hardware stack.

I wish there were a law that if you don't release a patch for your software for 20 years to make it workable for newer platforms, you've to release it as open source from the perspective of cultural significance.


What are people's thoughts on using "_t" as a suffix for types in C/C++, as this source does? My understanding is that it is technically reserved for language defined types, but I haven't come across a reasonable alternative (and having no suffix makes for odd code, for example a custom type for a "viewport" is better imo as "viewport_t viewport;" than "viewport viewport;")


I don’t believe that’s a c language thing, but a posix thing. anyway, in my own code for myself I do it, but it is frequently forbidden in coding standards I’ve worked under (even in a non posix environment) and it doesn’t rise to the level of pushing back on it usually, I’ll name types however the style guide wants, even if it’s worse. t prefix, worse. The whole word typedef, worse.


From what I understand, it's POSIX that reserves the _t suffix, not C.

That being said, I picked up the _s/_t habit from working on idtech codebases, and decided that I'm fine with my own C codebases forever having a "not POSIX compliant" stamp on it, whatever that means in practice. For C++ I just use InitialCamelCase.


Probably not everyone's cup of tea, but I tend to use CamelCase for types, and under_scores for variables. It does result in constructs like 'Viewport viewport;' but at least it's easy enough to tell that Viewport is the type.


Mixing CamelCase type names and snake_case variable names feels chaotic to me, but it’s the standard coding style for Python, Ruby, Rust, and Google’s C++ code. I wonder who used it before Python.


It's been in Java since Java 1.0


It's useful when you have an IDE that doesn't help you very much and you need to know what a thing is just from what code is in front of you.


Where I work the style guidelines for C specify to use "_type". Interestingly enough, the huge code base for embedded products with a custom OS does not rely on <stdint.h> types for fixed-width integer types: "uint32_t", for example. Instead, a company-wide header defines "uint32" etc. without the "_t" suffix. I don't know what guided that decision.


For a very long time the fixed-width types in stdint.h were not universally available, or in other headers, especially Visual Studio trailed behind. I guess this problem has stuck even after all C compilers caught up with C99.


It's totally fine and legal. Only POSIX reserves the _t for types, but POSIX is not the C standard (but even when writing code for POSIX, it's not like POSIX changes much these days, so unexpected type collisions because of POSIX updates will be very unlikely).


I've being using it for a long time and the only time i had a problem was when i ported an old 3d game engine of mine to Mac OS X and i had a type "key_t" which conflicted with some Mac header.

I just used the preprocessor to #define key_t mykey_t (or something like that) after the Mac-specific headers in the couple of files where the conflict was and never thought about it again.


Recently I was musing to myself about adopting the convention `func_r`, to denote "the thing that the function `func` returns".

Why spend the energy trying to think up two names (one for the function you're writing and one for what you should call the type of its result)? It's also amenable to preprocessor macros, if you're so inclined.


You're not supposed to do it, but anyone who works with the Quake family of engines is used to it, so when in Rome...


I've seen that suffix on loads of C stuff from ages ago. All stuff that circa 90s codes (some older)


I use and prefer capitalization for typedefs.

Cube instead of cube_t.


This was the game for me growing up. It introduced me to clans, ladders, and really online gaming culture.

My map was The Edge and my weapon was either the rail gun or rocket launcher. I was on dial up back then so finding a server was good latency was critical. Most annoying of course were the folks using that gun that caused lag for everyone.

I know Q3 is the bigger game that perfected the genre but my favorite will always be Quake 2. Not only was there a solid single player + expansion packs, but the pace was just right for me. Everything got too fast when Q3 came around.


You might like the Quakelive servers that use VQL physics rather than PQL.

VQL is much closer to Q2, whereas PQL is more CPMA or Quakeworld.

Bonus, "The Edge" is also available in Quakelive.


rail gun and you finish with the machine gun, gg


If you were a Quake 2 fan and have access to an Oculus Quest 2, try out Quake2Quest. It was a real trip running around in maps that I spent so much time in back in the day.


Quake II soundtrack is still in some sort of copyright limbo. It's easy enough to find on Youtube, but it's not on streaming services as far as I know.

EDIT: maybe it's getting sorted out, there's even a fricking vinyl release

https://www.lacedrecords.com/products/quake-2-limited-editio...


Quake always had amazing soundtracks. Nine Inch Nails "nailed" it on Quake 1. Quake 3 soundtrack is dope as well, but my all time favorite is the Quake 3 Rocket Arena vibes: https://youtu.be/clkOT6vRKDg


I was a bit annoyed when I bought Quake II on Steam a few months back and found it didn't come with the soundtrack. I just grabbed it from archive.org and dumped the files in the right folder, worked fine.


Presumably this is a general comment, since this release does not (and wasn't intended to) include any of the Quake II models, levels, graphical assets, sound effects, or music. It's purely engine source code.


It's not engine source code, just gameplay code.


It was so good that I would sometimes put the game disc in a CD player just to vibe.

Unfortunately that CD cracked, so I no longer have access to the music nor the game.


I think Sonic Mayhem did QII. NIN did Quake I (or maybe just Trent). I remember the ammo boxes for the nailgun had the NIN logo.


If you use Spotify, you can actually find the Quake I soundtrack under Nine Inch Nails. A real blast from the past. Quake was my first FPS with multiplayer, and I hogged the only telephone line my family had, so I could play mods like capture the flag, including the grappling hook. This was also around the time I started exploring Linux with Slackware, and dialing into my local university professor's Linux server to build web pages (before CSS was even available in browsers). Those are my favorite days of the internet, although it was much slower.


You can still buy Q1 soundtrack on vinyl.


It's beautiful. It's a double LP but only takes up 3 sides.

The remaining side has audio code from the game etched into it.


If you buy Quake 2 on GOG, the CD images are part of it.


it's weird that this isn't the case for the Steam version... base1 doesn't hit the same without Operation Overlord.


Yeah Sascha (Sonic Mayhem) says digital may come: “I think digital outlets will follow. Not 100% tho.”

https://twitter.com/sonicmayhem/status/1689688600362037249


The Quake series' source code is a must-read if you wish to learn how to create a fast-paced multiplayer game from scratch. Obviously, you can use Mirror or other 3rd-party middleware nowadays, but reading it gave me multiple layers of knowledge regarding the netcode aspect of a game.


This is essentially Microsoft releasing this. After ZeniMax acquired id, they were acquired by Microsoft.


Its scary how many products and people are connected to megacorps that don't seem related at first glance. This reminds me of that conversation at the beginning of Deus Ex:

“Corporations are so big, you don’t even know who you’re working for. That’s terror, terror built into the system”- Deus Ex, NSF.


Yeah, and sometimes it leads beyond megacorps to governments, too.

Optus (telco in Australia), owned by Singtel, which is majority owned by Temasek, which is owned by the Government of Singapore. You can also substitute in India's 2nd largest telco (Bharti Airtel) for Optus in that example, by the way.


I’m sure it’s widely known among readers of this thread, and I can’t vouch whatsoever for its veracity, but god damn is “Masters of Doom” a fun read.


I didn’t realize Quake 2 had been re-released!

For what it’s worth, the first expansion (The Reckoning) was probably my favorite single player Quake 2 experience. Favorite multiplayer was Devastation Quake, where one player is in a mech and everyone else has to team up to knock them out.


Quake 2 remaster was surprise released and this was released at the same time.


The title is a bit misleading. In Quake-speak, the "game" is the what defines the game rules, hence what enables modding. This source release does not include the actual game engine, only the gameplay logic, which has traditionally always been released.


Upvote if the name "Thresh" rings a bell


Upvote if you remember watching the curbstomp that was Thresh vs Billox.


Makes me wonder whatever became of Carmack's 328GTS.


Why do people like Quake so much? I'm too young to understand. Does it do something unique compared to other shooter games?


It was absolutely revolutionary in its time, it’s difficult to think of any current day parallels because the industry has matured so much.

For instance, Quake was the first FPS where the maps were truly 3D and could have one piece of floor on top of another. It would be considered insane for a game to not have that now. Quake(World) was the first truly massive online gaming FPS. Quake II was the first game I ever owned that used a 3D graphics card, I still remember the first time loading it up after I installed my card to set this wondrous coloured lighting that followed a rocket when I fired it.

Anyway, point is you’re right, you are too young to understand. I don’t mean that in a patronising way, it’s just that it’s not impressive today in any way. The enthusiasm you see here is nostalgia. It’s a museum piece.


> For instance, Quake was the first FPS where the maps were truly 3D and could have one piece of floor on top of another.

And you could see both at the same time. The Build Engine used by Duke Nukem 3D could also have one piece of floor on top of another floor (or even going through another floor), but due to how it worked, if both were visible at the same time you would have a "hall of mirrors" effect instead of rendering properly. And also water: while the Build Engine faked it by teleporting the player to another room when entering or leaving a water area, Quake did not need that kind of trickery.

Other than Duke Nukem 3D, other popular FPS games from that era also used "2D map with varying height" (like the Doom family), or even simpler things like rectangular 90-degrees-only single-height maps (for instance, Wolfenstein 3D).


Or simulated floors with sprites as in System Shock. Also one of the few 2.5D engines to allow sloped floors.

Also, "first true 3D FPS" depends on how you would classify Descent.


> For instance, Quake was the first FPS where the maps were truly 3D and could have one piece of floor on top of another

Bethesda's Terminator: Future Shock predated Quake by a year and also had truly 3D maps - which were often more expansive than Quake's (also you could drive vehicles, fly a helicopter or something like that IIRC, enter various places to find loot - though the loot variety was limited to basically ammo, weapons and grenades). I think Quake got more attention because Doom made way more of a noise than Bethesda's previous game (which AFAIK was a poor Wolf3D clone[0]) and unlike TFS Quake also had multiplayer support which was HUGE (TFS was criticized at the time for not having it).

Amusingly enough TFS controls pretty much like a modern FPS with its mouse look and the ability to configure WASD whereas Quake was still a hybrid of mouse being used to move forward/backward (unless you typed the "+mlook" command in the console) and again TFS was criticized for this.

[0] ok, they also made Arena but still id's previous game was way bigger and even at the time your last game was what people paid most attention to for the next one


1: It was ID, not Betsheda.

2: Doom's impact was more huge than Quake. The MOD community still releases PWADs today. Doom basically boosted LAN multiplayer matches.


I'm not sure what part of what i wrote "1" refers to. Terminator: Future Shock was made by Bethesda, not id and when i mentioned Doom i was comparing it to Terminator: Rampage (though Arena also came before Terminator: Future Shock) which had much less of an impact than Doom.


I think badsectoracula was comparing Doom with one of Bethesda's previous games - Terminator: Rampage.


The firsts are actually insane. Here are some of them:

- First real 3D FPS game using OpenGL (GLQuake)

- First real multiplayer 3D game with 16 players

- First to introduce the idea of a "clan" or "guild" for a multiplayer game. It's where the term "clan" came from

- First esports game

- First instance of Capture the Flag mod later used in other games

- First instance of Team Fortress later used in other games (e.g. TF2)

- First game to have "demos" (aka VODs) where you can rewatch / replay a match

- First game with a multiplayer competition match mode (Clanring or CRCTF or CRDM)

- First web service allowing you to see what's going in in games from the internet [qstat](https://github.com/Unity-Technologies/qstat)

Aside from all of these firsts Quake 1 and Quake 2 were incredibly executed.

- Soundtracks made by Nine Inch Nails. Who at the time ever heard of a tier 1 famous band making entire videogame soundtracks?

- Creepy gothic lovecraftian demonic theme combined with space. The space parts were later ripped off by Half-Life. And you can see the influences even on modern cultural artifacts like the show Stranger Things (which itself seems to rip off Half Life's storyline).

Quake is basically the original online multiplayer game and had almost everything we have today but had it all the way back in 1996. The only things that game didn't really have was deep API integrations to websites the way games have now or complex matchmaking with elo and ranks.


Great summary. Just wanted to say that the Q2 OST (at least the base game) was made by Sonic Mayhem while the Q1 one was made by NIN.

Both are great OSTs, Q1 is a "ambient-horror-esque" styled album [1] while Q2 OST [2] is practically industrial metal made using synths.

[1] https://youtu.be/5n8iU7abqkQ [2] https://youtu.be/svRkAEoT5Hc


It was one of the very first FPS games where you had true mouselook. All the predecessors either didn't (wolf3d/doom/rott), or faked it (ultima underworld). Notable exception is Descent (which is probably the actual first 3d FPS game), but IMO controlling a spaceship in 3d was a barrier to entry that Quake didn't have.


Descent had mouselook? Now I feel stupid. Or maybe I just didn’t have a mouse when I used to play it with friends, can’t remember.


TBH I could certainly be wrong about that. I remember playing with two hands on the keyboard and a gravis on the floor that I used my feet on to press buttons because movement was so complicated.


Yes. Very difficult to play with a mouse, but the pros with a mouse were amazing. I had a few friends that were mouse players.

The most popular choice of accessory was the Sidewinder 3D Pro. That was my choice of input device and I was easily a top 5% player in my teens.

I never touched one, but many people swore by the SpaceOrb 360 as the pinnacle of controllers for Descent.


Descent was closer to DOOM tech, not fully 3d but kind of a 2.5d . Quake was one of first true 3d games


What was 2.5d about it? I mean the rooms needed to be convex IIRC and it had sort of a teleport thing going on, but it was basically all 3d, right?


It did it all first.

They did a lot to open the idea that game mods could be more than cheats and cracks, too.

I still remember the grenade launchers and wild modded grenades fondly. the bouncing ones were so much fun in hallways.


One of my favorite modes for Quake II: Weapons of Destruction.


thanks for the prompt, i looked and found: https://github.com/ulatekh/quake2-WOD


Quake didn't have the best gameplay but it had the best technology. Entering a true 3d world on your computer was possible for the first time.

Duke 3D had gameplay that was more fun, but it was a 2.5D game with a Doom-style engine (it was much more sophisticated with scripting and slanted ceiling/floors but still not true 3D like Quake).

Post-release, Quake had patches called GLQuake which added 3d accelerator support, and Quakeworld which added internet movement prediction so playing online didn't feel as jank. Quake 2 came out with these features integrated and more - colored lighting, transparent surfaces, etc.


> I'm too young to understand

Allow me to share the perspective of someone around 18 years old at the time.

First, Id Software created the FPS category with Wolfenstein. However, the company didn't gain widespread recognition until they released Doom. Doom was exceptionally unique, to the extent that it made headlines in mainstream news.

With the launch of Quake, although other FPS games existed, the expectations were high as everybody saw it as the successor of Doom. Also, Quake had a genuine 3D environment as opposed to Doom's 2.5D. 3D graphics cards were not common, making Quake a marvel of PC gaming. Moreover, Quake featured an advanced mod system and a level editor, which were rare in games of that time.

FPS games are now ubiquitous, and even budget smartphones have more 3D capabilities than high-end PCs of that era. So, the “wow” factor of Quake was extremely high.


With DOOM (and a little bit with Wolfenstein), ID developed a game that encourages an almost reckless play style.

You can get into a rocket fight with your opposition, sustain a fair number of hits, heal in the next room, and repeat. Their goal was to make you feel like an amazing demon-killing machine.

Quake was one of the first PVP FPS games to bring that feel to the game. Death had minimal consequence, your goal was to find and kill the opposition, lethality was set low enough that you could shoot a rocket at your feet to "jump" higher.

At least, that's what made Quake (and ID games of that era) stand out to me.


Perfect blend of nostalgia, aesthetics, gameplay, simplicity not to mention that id software releasing everything open source at the end has continued development and created a massive amount of third party content, mods, etc. The same applies to Doom, Duke Nukem and to a lesser extent a few other older fps games.


Correct me if I'm wrong, but wasn't Quake the first shooter to have a separate server where players could join and quit at will? At least that's what I remember at the time. In many games before Quake, if one player quit the whole game would quit. Rise of the Triad was great, but damn, it was painful if there was any sort of network hiccup. Quake was a revelation in that regard.


To be honest, a lot of it is nostalgia. The gameplay was pretty danged good, but feels pretty repetitive and meaningless to modern players - basically no plot or progression to speak of, an endless array of elaborately sculpted mazes with monsters in them for you to explore to find the way to get to the next level.

However, Carmack was the most brilliant engine developer of his time and was heavily committed to open platforms, so that meant these games looked head and shoulders above their peers and played amazing online and had massive communities of modders and admins running the online games. Basically they created the modern FPS genre.

Until Unreal Tournament and Counterstrike came along, the Quake series was the king of online FPS gaming. And even after they appeared, Quake 3 held its own.


No plot or progression and just endless shooting? That's almost some kind of meditation for me and other people.

Both the resurgence of "boomer shooters" (at least in PC) and by extension the recent remastering of both Q1/Q2 indicates an existing target group for these kind of games.

Point taken that younger players may see no fun or meaning in games like this, but modern gamer <> young gamer.


> No plot or progression and just endless shooting? That's almost some kind of meditation for me and other people.

Indeed, some years ago i'd wake up, take a shower, make some coffee, do a quick play of the first episode of Quake (i stopped at first death but i pretty much knew the game so well by that point that i rarely died before the last couple of maps) to wake up and then go to work :-P.


Honestly if it were endless shooting I'd like it more -- for me that's the Serious Sam series. Q1/Q2 is a lot about navigating the map and rationing your ammo. Doom 1/2 had more fun pitched battles but also had some very tedious map design -- games where I have to look for corpses to figure out where I've already been hold no nostalgia for me.


My main experience at the time was with Heretic (only slightly more sophisticated than Doom I/II) - you're right that it's a bit tedious but at the time (when 3d was still a novelty) it somehow added to the feeling of really being there. Additionally I was 12 years old in 1995 which must have helped :)


Yes, you're right. 90s-early 2000s/boomer shooters have different levels of "map complexity" ranging from open pseudo-flat landscapes or big rooms ala Serious Sam (afair, I haven't played one in years) with tons of enemies, to more complex mapping and enemy positioning like Q1/Q2/D3D/etc.

One can drift naturally to one or another extreme, but the more the variety the better imho. I just enjoy simpler games both in graphics and gameplay.


I don't think it's that much any more based on what I'm seeing when I log into Quake Champions. For me Q3 Arena and variations was the pinnacle shooter duel experience.


Bunny hopping!


I played the original Quake in college the year it came out. They gave away so much of the game on demo floppy disks that your could play deathmatch for free. We took over a whole computer room in the journalism school (trash 486s, but nobody really used that room so we were left alone).

Quake II was at my first proper job, at DEC. I worked on the server/storage support team. At 5pm when the phone lines closed we'd fire up Quake II on a server and at least 20 people would hang around for an hour or two after work to smoke cigarettes and play Q2. The mods are terrific. One person used a perfectly crafted Homer Simpson mod, complete with sounds effects sampled from the show. Also remember a "Bananas in pyjamas" skin and a small floaty robot (which was a bit of a cheat because it was harder to see than Homer). And the maps! Christ, so many great maps. Some of them are in Xonotic, and I still play DM in them occasionally.


I got in trouble for playing this in class from a teacher in her early thirties who I had a crush on. The red hot chili peppers had just released Californication. The matrix was all the rage and felt threatening to my young Christian sensibilities


Quake 2 and especially the Jailbreak mod were my first big foray into online multiplayer gaming. I was in two clans, one named after the band 311 (had no idea what it even was when they invited me to join because I hung out on their server which had a decent ping), and then later a clan named Atomic Slug Slingers ("ASS", haha, get it?).

It's really too bad that the old ways of independent servers and mods went the way of the dodo. Just the other day for no reason at all I found myself repeating the old guttural "Welcome to GameSpy" voice intro to myself.


I hope we'll see some old Quake 2 mods dusted off and reapplied to this new version. There were some greats back in the day - Action Quake 2, Transformers Quake 2, Superheroes Quake 2, etc.


Darn right. Lithium mod was my favorite. The grappling hook and runes made for some incredibly fun LAN parties!


This game and slackware3.4 are most of my memories of my early teen years. I played Q2 for hundred (if not thousands) of hours in multiplayer, more than any other FPS. And I only ever played q2dm1 (the edge) to the point to where when I tried other maps, it felt like I was playing a totally different game. The amount of subtle tricks like long jumps you could do due to the openGL "bug", or rocket launcher jumps were so awesome. I remember I played at fov 110 and somehow never missed with the railgun.


My first thought is - what will the modders do.

I watched some videos about MyHouse.wad (a Doom 2 level/mod that became popular with the indie horror crowd), and it's seriously impressive.

I wonder what happens in the context of Quake, after seeing the community take Doom to places Carmack could never have imagined.

I'm a lot more interested in how people mess with the rules of the game without necessarily breaking them, leading to some super subversive storytelling, rather than just porting the code onto a smart fridge or some shit.


I honestly don't expect anything nearly as impressive as what we currently have in the Doom community. While there's still plenty of folks making PWADs and IWADs that are vanilla Doom compatible, the ZDoom team has brought the technology of Doom so far that it's some mishmash hybrid of capability of Quake 1-2, and folks not only make amazing free mods for you to grab, there's even brand new games being built and released on ZDoom[0], with aesthetics ranging from "this feels right at home as a Doom game" to "a Doom engine game has no right looking this good" to incredibly stylized, unique takes.

Nightdive did a nice job giving new tools to make modern mods possible (effectively giving us much of the kit they used to remaster Q2). My read is that this isn't an accessibility to be able to make cool mods problem so much as an inertia one.

[0]https://www.doomworld.com/forum/topic/136771-every-gzdoom-ga... (Many of the links to games are various grades of NSFW)


Have to say I have a lot of respect for Nightdive after finishing their System Shock remaster. It was faithful, but modernised, and none of the tension or horror was lost in the process. It remastered a 30 year old game but didn't make it unrecognisable, just gave modern gamers an old-but-new immersive sim to enjoy (which are few and far between). Lots of younger gamers get to enjoy the series with modern advancements in UX.


If anyone's curious, start here: https://www.youtube.com/watch?v=5wAo54DHDY0

If you don't care about Doom (or even video games, honestly): I haven't even thought about Doom in 20 years. Just click the link and watch.

One of my favorite YouTube rides of all time.


The author's enthusiasm is infectious and you can just feel how excited he is when the House of Leaves connections become more clear.


The Quake source has been around for quite a while, this release is just for the rerelease.

Quaddicted is a great site to find mods; QuakeSpasm is a fantastic binary for enjoying them; and nQuake is where the multiplayer is at.


Quake 2 was surprisingly playable online even with late-1990s-era ping times.

I played the hell out of the LMCTF mod back in the old days. Great times.


I played a ton of LMCTF too. The offhand grapple was such a game changer in terms of speeding across maps. The LMCTF community was also great: hours spent on IRC, competitive ladders, forums (nachos), etc. It was a great time to be into online games.

Alliance for q3 was also great too, but it wasnt quite the same.

There is a Facebook community alive for LMCTF. Last time I checked they have a few servers online and organize pick up games.


We had a thing in university where most of the research staff would do a few rounds of Quake 2 death match around the end of the afternoon. We were all on the same local network; so ping times were great. The same levels over and over again. Great fun. And very satisfying to hear the groans of agony after a rail gun blast.


Are there any open source asset packs you can get?


Quake 2 Enhanced is very impressive, check out the subtle but clear differences they have made for each model: https://youtu.be/UVKxhoA77Vo


Anyone have a history of being addicted to Action Quake 2? First time programming jumps!


Yes I really loved that mod


As someone pointed out to my similar comment, https://www.aq2world.com exists and is on steam for free.


Obviously it makes sense but it feels sacrilegious that there’s an official version of the Quake II codebase that relies on… JSON?! Everything should be either a tightly packed binary file or a .ini! (or something)


What do the comments like `// ROGUE` or `// PMM` `// STAND` mean? Also, can anyone explain the code in insane.cpp? Lots of magic numbers and hand-crafted arrays.


This nomenclature was often used in licensed Quake codebases to indicate places where a vendor would put their own Mission Pack-specific alterations into the code. I guess they just 'up-merged' the modified code to the main id source when they were done, or perhaps the changes were done by id on behalf of them?

I believe there were similar bits in the Quake 1 source, e.g. for Scourge of Armagon (Mission Pack No. 1) you would see things like '// HIPNOTIC'.


hacking games based on the quake engine is how I learned to program initially (ld preload hooking and offsets and such). this brings back memories of hacker servers where we played against other hackers. it was a mix of programming skills and human agility. really fun times... the quake engine sent all world state to every player so you could build ESP functionality and other neat things.


If I wanted to read the source code of just one version of Quake, to learn from it, which do you think would be the most interesting?


Quake 1 is most likely the simplest and most straightforward though it does have a bunch of alternative things for stuff like GLQuake vs software rendering.

Quake 3 was designed to be used by 3rd parties and is more well put together, focuses on OpenGL and Carmack considers it his best C code.

I'd say one of these two.


I would wait for Fabien to write a book on Quake I :)

https://fabiensanglard.net/three_books_update/index.html


Thank you! Didn’t know these existed, so I should actually start with Doom. :)


The question would be “by what dimension of interesting”?

Quake 3’s source is pretty interesting from the perspective of id just transitioning from C to C++, and famously has an implementation of fast inverse square root. It’s also a pretty clean codebase overall with a reasonably modern engine architecture.


Quake 3 was still completely C, IIRC. You might be thinking of Doom 3?


the rerelease mentioned here rename .c to .cpp globally but the code base is still c, why is that? I thought it was rewritten in c++.


It's a light touch (looks like the original structure is mostly intact) but if you search for 'std::' in, say, https://github.com/id-Software/quake2-rerelease-dll/blob/mai... you'll see there's some C++ stuff floating about.


Oh, this is the best cool game of my childhood, we play it on a sony playstation and the screen was divided into 4


Can anyone get this working? I followed all the instructions in the readme and can't get it compiling.


Can they just offer the art assets too? Anyone interested is just going to hunt them down anyway.


Qball mod was likely the inspiration for Rocket League many years later.


Q2 explosions were actual meshes which I thought was rather unique.


i learned C, linear algebra and much more from working on the Q1 engine, by far the most influential piece of code for me! thx iD!


Action Quake II remains my perfect shooter.


Still has a tiny but active community on discord, also has been re-released as AQtion on Steam.


Ooh, thanks for mentioning that, I’m ready to re-visit!

I wonder if jungle1 and teamjungle are ported? Those were the first maps I made for any game (and I had no idea what I was doing).

I fondly remember a conversation with a random person in a bar, about a decade ago. Somehow, they brought AQ2 into the conversation, pointing to my creations as their favorite maps (without knowing I made them).

That was a good feeling :)


Where on discord?


discord.aq2world.com


...WASM version anyone?


No openGL/Vulkan/whatever. Why are the renderers missing?


rerelease in c++ that is,cool




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: