3 ms·
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?
by akamaka 3y ago
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?
- ovao 3y agoThe 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.
- bhelyer 3y agoQuake 3 was still completely C, IIRC. You might be thinking of Doom 3?
- synergy20 3y agothe 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++.
- bhelyer 3y agoIt'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/main/rerelease/p_client.cpp https://github.com/id-Software/quake2-rerelease-dll/blob/mai... you'll see there's some C++ stuff floating about.
- badsectoracula 3y agoQuake 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.
- bombcar 3y agoI would wait for Fabien to write a book on Quake I :) https://fabiensanglard.net/three_books_update/index.html https://fabiensanglard.net/three_books_update/index.html
- akamaka 3y agoThank you! Didn’t know these existed, so I should actually start with Doom. :)