Quake III source code to be released

That would certainly be interesting. I'm going to get the code, even though I have weak c++ skills, because it's not every day that a commercial-grade 3d engine is released to the public for free.
 
Graz'zt said:
See Sander, it's not in Pascal!
Woohoo, some 3D engine is not in Pascal...


Anyway, this might actually be an interesting thing to look at for all the amateur coders out there. Mainly to take a look at the code, how it's organised, how it works, and perhaps to look at the commentary in the code. Although all of this obviously depends on how much of the code is released (is there still commentary, for instance (I'd sure hope so)) and what the quality of the code is.
But I don't think this will be much of a help for people who want to use it to create their own games, add things and whatnot. Code written by other people can be a pest to read and use, although I don't know whether this is the case here, and moreover, trying to get new things to work in code you haven't written yourself can be even worse. This is one of the problems many game developers encounter: using code already written is often not better than doing it yourself from scratch.
 
It's reasonable to expect they will release some sort of documentation with it. After all, this *is* one of the most popular and widely-licensed 3D engines in the world. I doubt Ravensoft, Infinity Ward and other teams figured out how the engine worked by staring at the code.

I'm more worried about its age. It would probably take quite a bit of work to expand the engine with shiny new eye-candy that has become standard since 2000.
 
Graz'zt said:
It's reasonable to expect they will release some sort of documentation with it. After all, this *is* one of the most popular and widely-licensed 3D engines in the world. I doubt Ravensoft, Infinity Ward and other teams figured out how the engine worked by staring at the code.
Oh, undoubtedly, but I'm wondering how far this goes....and I'd certainly like to take a look at some of the commentary and of what quality it is. Which is probably what I'll do.

By the way, it's now downloadable here, and some global documentation is downloadable here.

And on Slashdot Carmack let's us know
Carmack said:
Personally, I think the Q3 code is pretty clean on the whole. It was a commercial product done under time pressure, so it isn't a polished gem, but I consider it good.

Anyone working on the Q3 codebase today should just delete all the asm code and use the C implementations. Making a commercial game with fairly high end requirements go 10% faster is sometimes worth writing some asm code, but years later when the frame rate pressure is essentially gone, the asm code should just be dumped in the name of maintainability. All the comments in the world wouldn't change this decision a bit.
So, basically, it has quite some code that is unreadable/unmaintainable (the asm bits), and it's far from polished.

Ratty said:
I'm more worried about its age. It would probably take quite a bit of work to expand the engine with shiny new eye-candy that has become standard since 2000.
I don't think that's really the point, you can add all the new eye-candy yourself, and it doesn't really need to look all that good, I think it's much easier to use as a means to learn, especially, as I said, for people who don't know much about professional programming.
And, of course, for the tweakers and modders out there this source code is a great thing to work with. It allows for easy and fargoing modification.
 
Sander said:
So, basically, it has quite some code that is unreadable/unmaintainable (the asm bits), and it's far from polished.
Heh, there was once a time when poverty and plague were rampant, society was primitive, people were superstitious, the Catholic Church kept the world in darkness and developers had to write not only parts of the engine, but also video and sound drivers in assembly from scratch. Thankfully, the brave and forward-thinking presbyters from SGI and Microsoft led us out of the cesspit of destitution and ignorance into a new era of wealth and knowledge.
 
I know I won't be finding much use of it. Just took a quick glance at the source files... pure C, simple syntax, no fancy language constructs :cry: like the ones I'm used to encounter in a complex C++ environment - still can't get IntelliSense to work properly with aggregate template classes though...
Maybe, just maybe it could be worthwile to take a look at the networking code... Nahh... got better things to do.
Cheers
 
So, are you saying that fancy constructs and complex code is better than simple and clear code?
To be able to do something with simple, basic, easy to read code instead of having to resort to incredibly complex systems is much better for a lot of reasons.
 
C++ can be very elegant also.... but Microsoft's Visual C++ really makes my head spin... SO MANY proprietary constructs... and miles and miles of of macros and typedefs - ack
 
Sander said:
So, are you saying that fancy constructs and complex code is better than simple and clear code?
Yes, because "fancy constructs" and "complex code" are more convenient and allow for faster and more error-proof programming. If it weren't so, there would be no Smalltalk, Ada, C++, Object Pascal, Java, C# or Visual Basic, everyone would still be writing mnemonic programs and a game engine would have millions of lines of code.

Like this one.
 
Graz'zt said:
Yes, because "fancy constructs" and "complex code" are more convenient and allow for faster and more error-proof programming. If it weren't so, there would be no Smalltalk, Ada, C++, Object Pascal, Java, C# or Visual Basic, everyone would still be writing mnemonic programs and a game engine would have millions of lines of code.

Like this one.
So basically, because there are things that facilitate the use of complex code, complex code must have a good use.
Reasoning in circles is fun, I know, but try not to. ;)

What I was saying, though, was that for some reason, Max was complaining about the fact that there weren't any fancy constructs and complex code.
My point being that it works brilliantly with simple code, so why the hell would you then start using fancy language constructs? They may save lines of code, but generally it means a lot less readability.
Also, I don't know about you, but using simple things such as procedures (or voids or whatever in C) can save a lot of lines of code, but it will also make things a lot more readable. I'd think that looking at a professionally coded graphics engine that works really well (and has been used in many different games) would show that they're not needed. Readability is key, by the way, in the fact that it was used in so many games.

Then again, I must admit that I have no clue as to which things Max was referring to, or which ones you're referring to, since I can't read minds, so feel free to prove me wrong with some examples. But I dare you to prove me wrong that in general, and in most cases, simplicity and readability are key, and not less 'lines of code' (an abstract concept in any case, since most people have different styles of coding).
 
Sander, dude, he probably meant classes, enumerations, strings and that kind of shit. C++ (and all newer languages, for that matter) has language constructs that really make programming more convenient and simplify the code. You think C code is more readable than C++ code? Try modifying a program that has a hundred procedures scattered in various files and all of them take the same variable as an argument. Changing the variable type means you need to change every single procedure, and then rewrite every single call of those procedures. A simple class would make the problem considerably easier to solve, since both the variable and the procedures would be located in one place, and procedure calls would be independent of procedure implementations.

Now, I'm not saying QIII engine code is bad - quite the contrary, from what I can tell it's well-organized and fairly easy to read and understand. What I'm saying is that using another programming paradigm would improve it, not impair it.
 
Sander, dude, he probably meant classes, enumerations, strings and that kind of shit. C++ (and all newer languages, for that matter) has language constructs that really make programming more convenient and simplify the code. You think C code is more readable than C++ code? Try modifying a program that has a hundred procedures scattered in various files and all of them take the same variable as an argument. Changing the variable type means you need to change every single procedure, and then rewrite every single call of those procedures. A simple class would make the problem considerably easier to solve, since both the variable and the procedures would be located in one place, and procedure calls would be independent of procedure implementations.
Heh, I wouldn't put any of these things under the header 'fancy constructs' or 'complex code'. So hence my reaction. :P
 
Sander said:
Heh, I wouldn't put any of these things under the header 'fancy constructs' or 'complex code'. So hence my reaction. :P
I get your drift. Pascal has had half of that stuff since almost forever. Bitch.
 
Appreciate the effort Graz't.
Sander, what I meant by „fancy language constructs“ was mainly the OOP part of C++, namely inheritance trees, object polymorphism via virtual functions and extensive use of templates. Unlike C, most features in C++ revolve around the ability to create new data types. Not only does this facilitate code organization, but in essence lays the foundation for quite powerful OOP abilities. And as all people know, OOP was a response to the ever growing size and complexity of software projects which created a so-called “software crisis” because the programmers were stuck with “non-reusable” and “non-organizable” code making project development way too long and expensive. While writing pure procedural C syntax does result with faster code in comparison to dynamic data-typing C++ provides it comes so at a cost more and more people are beginning to find unacceptable. Just take a look at what C++ gives you: abstract data types, i.e. functions inside structures; data encapsulation, i.e. access control by access specifiers (public, private, protected) enabling interfacing; object initialization and cleanup (constructors and destructors); convenient use of names via function overloading and a great deal of control over the creation and visibility of names, their storage and linkage (namespaces); syntax sugar like operator overloading; cleaner dynamic object creation; code reuse via inheritance and composition; and finally polymorphism via virtual functions – providing an another dimension of interface separation from implementation, decoupling what from how; and templates which provide the ability to reuse source code instead of just object code…and that’s just the introduction, but you get the picture.
 
Back
Top