Slashdot Mirror


Quake 3 Source Code Review

An anonymous reader writes "id Software has a history of releasing the source code for their older games under the GPL. Coder Fabien Sanglard has been taking it upon himself to go through each of these releases, analyze the source code, and post a detailed write-up about it. He's now completed a review of the Quake 3 source code, diving into the details of idTech3. It's an interesting read — he says he was impressed in particular by the 'virtual machines system and the associated toolchain that altogether account for 30% of the code released. Under this perspective idTech3 is a mini operating system providing system calls to three processes.'"

27 of 107 comments (clear)

  1. "code" is OBSOLETE, loosers!!!! by For+a+Free+Internet · · Score: 3, Funny

    Todays compotor scientists program with pure thought connected by JSON/XMLhttpREQUEST to a HTML5 document tree located in four-dimensional time on the APP STORE. This "code" shows that Id software is living in the PAST and won't be arouned for long, it is a DINOSORE and I am going to eat its stock markets for BRUNCH with BEAUTIFUL HOOKERS and jesuse!!!!!

    --
    UNITE with the Campaign for a Free Internet because today, our future begins with tomorrow!
  2. I'm a dumbass- by WiiVault · · Score: 2, Interesting

    But I can't help but revel in the growth and extension of public domain engines and assets by willing companies. As a dum-dum, I still see a lot of value in Q3 based projects. They really look good enough(for me), and I hear good things about the netcode. It isn't the end-all-be-all of engines, but it really is one of the first modern commercially sold engines available to the rest of us. If I may be so bold; gentlemen start your engines. I can't wait to see what you come up with.

    1. Re:I'm a dumbass- by mrchaotica · · Score: 5, Insightful

      "Start your engines; I can't wait?" Dude, this was released years and years ago. In fact, the guy in the article previously reviewed the Doom 3 source code (which is much newer) and just decided to go back and do this old engine for completeness' sake.

      Wikipedia has a list of games that already exist that are based on the GPL Quake 3 source. You need to crawl out from under your rock a little more often!

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    2. Re:I'm a dumbass- by santax · · Score: 4, Informative

      UDK is free for noncommercial and educational use. You may download a copy here. Licensing is required for commercial use, however. From their site ;)

    3. Re:I'm a dumbass- by Tough+Love · · Score: 2

      Because you have source code to it and you can make it do new things because of that, while also learning something.

      --
      When all you have is a hammer, every problem starts to look like a thumb.
    4. Re:I'm a dumbass- by arth1 · · Score: 2, Insightful

      Why use the quake 3 engine when you can use the newest unreal engine with all the tools the professionals use for free?

      Because you might want to release the game one day? Then you have to pay for both the engine and royalties.

      Also, you may want to produce a game that can run on a tablet or normal notebook, in which case the Unreal engine requirements disqualifies it.

    5. Re:I'm a dumbass- by santax · · Score: 2

      Neh different licenses, the regular without source code but for commercial use is USD 99. And 25% of your revenue :P The one that comes with source code = please contact us for more information....

    6. Re:I'm a dumbass- by Gaygirlie · · Score: 2

      Because you might want to release the game one day? Then you have to pay for both the engine and royalties.

      Release, or release commercially? You're entirely free to develop and release completely free games with UDK, you know, you do not need to pay anything then.

    7. Re:I'm a dumbass- by tepples · · Score: 2

      With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

    8. Re:I'm a dumbass- by santax · · Score: 4, Informative

      Read this: http://www.develop-online.net/news/37234/UDK-devs-making-75k-only-give-1-to-Epic In short, they take 25% if you sell the game, but only if your game makes more than 50.000. They also take into account the 30% that applestore of android take using their distribution platform. But if it's non-commercial, there is no $99 if I'm not mistaken. Btw, that $99, could the average indy develop an engine like this for it? I would say, nah.

    9. Re:I'm a dumbass- by Gaygirlie · · Score: 2

      With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

      I do not understand what you don't understand about "do not need to pay anything."

    10. Re:I'm a dumbass- by jones_supa · · Score: 2

      Hey, at least he warned that he's stupid (just like me). ;)

    11. Re:I'm a dumbass- by gl4ss · · Score: 4, Informative

      "Also, you may want to produce a game that can run on a tablet or normal notebook, in which case the Unreal engine requirements disqualifies it."

      unreal engine isn't so bad on tablets... http://epicgames.com/infinityblade/

      it's a fine engine. what you render with it is what makes all the difference if it runs well or not.

      --
      world was created 5 seconds before this post as it is.
    12. Re:I'm a dumbass- by Smauler · · Score: 3, Interesting

      I still see a lot of value in Q3 based projects. They really look good enough(for me), and I hear good things about the netcode.

      Literally yesterday, I was looking at a bridge in Lord of the Rings Online (which is quite pretty otherwise), and thought to myself : Why isn't it curved?

      It seems the fashion with engines now is to drop curved edges - I'm not sure why. They look so much better, and have been around for ages. Quake 3 did these brilliantly, and when it came out, I thought that would be the end of crappy lumpy bridges, etc. No such luck, they're still with us, over a decade later.

      Anyone with knowledge of this issue, and why they're still about?

    13. Re:I'm a dumbass- by hairyfeet · · Score: 2

      I'm sure i'll get hate for saying this but WTF, truth is truth:

      It is NOT the engines that are the problem, hell there are still plenty of guys playing games like Freelancer and Far Cry I out there and those are pretty damned far behind the curve, its the simple fact that the FOSS community simply won't put in the work to make decent games.

      Now don't get me wrong, not saying making games is easy, just that the engine isn't the problem. i mean what did we get from the last source code releases? 50 bazillion rip offs of Q3 Arena that's what. it doesn't really matter WHAT engine you have if they are all putting out the same tired as hell DM and CTF fragfests over and over AND OVER without deviation. No single player, no story, no innovation, they just come up with some maps and character models and away you go.

      So while I'm glad they give out these engines to the community frankly the guys modding non free games have been consistently better when it comes to quality and variety than anything I've yet seen built with one of these free engines. take Freelancer, there have been a dozen new campaigns made by modders, with hundreds of new star systems, a full Elite style economy based system, factions and reputations added, you can play some of those in SP for weeks and not see it all, whereas what will we get from this? CTF and DM and...well that's all, CTF and DM.

      So while i'm sure i'll get tons of hate for pointing this out you all KNOW this guys, its the same thing we've seen with every other damned engine release. do I wish it were different? Hell yeah, I would love it if there were a free game built with this that had a rich story, interesting characters, something that would really spark some interest in FOSS gaming, but instead what we'll get is the FPS equivalent of Tux Racer, just the same old same old. And please, for the love of the FSM no more damned Q3 Arena copies, okay? I mean we already have a fricking bazillion MP only FPS games, we really don't need anymore.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    14. Re:I'm a dumbass- by Smauler · · Score: 3, Insightful

      Content is the most difficult thing about games now. Seriously. The engine is not where most of the resources go.

      It's a hell of a lot more difficult creating a decent in game universe than creating an engine. Think about it - games now require _loads_ of textures someone has to paint. Loads of voiceovers someone has to do. Loads of text someone has to write. And debug, optimise, etc. The engine is not the tough bit. A lot of it is dull, dull work.

      That being said, there are success stories, but they are few and far between. Fall from Heaven (civ4), Magna Mundi (EU3) - (though look at how that has turned out now), quite a few for X3, and obviously the old poster boy, counterstrike. These mods relied upon a large initial userbase.

      Seriously, content is king now, and it's hard to do without loads of work.

    15. Re:I'm a dumbass- by savuporo · · Score: 2

      If i had mod points .. What a lot of people don't realize is that direct coding budget is often less than 10% of any major title nowadays. A chunk goes to middleware licensing, and the rest is all pretty much content creation, be it story writing, 3d/2d artwork, audio, acting etc.

      --
      http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slashdot.org Errors found while checking this document as HTML5!
    16. Re:I'm a dumbass- by parlancex · · Score: 4, Interesting

      Q3 engine's curved surfaces are actually quadratic bezier spline patches (9 control points per patch). The patches had to be designed with special tools in an editor and were tessellated at runtime to an appropriate detail level based on the computer's graphics settings. The engine did not support any kind of collision detection with these surfaces so they had to be enveloped in invisible brushes to appease the BSP system for collision and culling.

      While they were interesting at the time the reasons nobody really does this anymore are probably:

      • The special tools required to design curved surfaces need to be supported by the artist's tools and entire game toolchain, creating more work for artists and tool programmers
      • Quadratic bezier patches are one of the simplest types of curved surface but can still be difficult to work with. Certain shapes are hard to construct properly with them.
      • Lastly I'd say they've been kind of superseded by smooth / detail surfaces available through subdivision algorithms which can work on conventional geometry and conventional tools, and is supported on modern cards in hardware
  3. Yes, you are- by MrEricSir · · Score: 5, Insightful

    "But I can't help but revel in the growth and extension of public domain engines and assets by willing companies."

    Just so we're clear, Quake 3 and its source code are NOT in the public domain.

    --
    There's no -1 for "I don't get it."
    1. Re:Yes, you are- by Baloroth · · Score: 5, Informative

      Public domain? No. GPL? Yes, which is probably what the OP meant (and to be pedantic, it is the engine that is GPL, not the game as such).

      --
      "None can love freedom heartily, but good men; the rest love not freedom, but license." --John Milton
  4. The most insightful comment. Ever. by Anonymous Coward · · Score: 5, Funny

    You have just spouted utter nonsense, and have made a more valuable comment than most other people here.

  5. What's the point of this system? by loufoque · · Score: 2

    From a quick reading, I don't get the point of this system.
    Couldn't they just compile their C code to a dll normally and then load that dll and call vmMain?

    I don't see what those "virtual machines" are bringing.

    1. Re:What's the point of this system? by loufoque · · Score: 3, Interesting

      I wrote this very comment *because* I read that article.

    2. Re:What's the point of this system? by purpledinoz · · Score: 3, Informative

      Apparently, he got around this by compiling the bytecode to x86 code on the fly:

      Moreover their design is much more elaborated: They combine the security/portability of Quake1 Virtual Machine with the high performances of Quake2's native DLLs. This is achieved by compiling the bytecode to x86 instruction on the fly.

      And here's the evolution of this:

      Trivia : The virtual machine was initially supposed to be a plain bytecode interpreter but performances were disappointing so the development team wrote a runtime x86 compiler. According to the .plan from Aug 16, 1999 this was done in one day.

    3. Re:What's the point of this system? by Drinking+Bleach · · Score: 2

      Portability is a HUGE advantage to the VM architecture. Quake 3 has been ported to many OSes and CPU architectures that didn't even exist when the game first came around (or many of the mods). With the QVM, it's no problem to have a native Quake 3 port to Linux x86_64 and still run all the old mods without having to rebuild them. Additionally, ports to Android (Qauke 3 on ARM) also don't affect mod compatibility.

      I think it's a huge step back that they regressed on the role of the VM in Doom 3.

  6. Re:Hint by UnknownSoldier · · Score: 2

    The third striking thing where he he discovered "circular buffers" but calls them "Array index cycling." Are programmers really that clueless that they don't realize MOD N can be optimized with AND N-1 ??

    http://fabiensanglard.net/quakeSource/quakeSourceNetWork.php
    arrayIndex = (oldArrayIndex+1) % 64 ;
    arrayIndex = (oldArrayIndex+1) & UPDATE_MASK;

    Which came from:
    Network Model (Part 3 of 5)
    The array cycle with the famous binary mask trick I mentioned in Quake World Network (Some elegant things).

  7. Re:So this is what happens when reddit goes down. by Hal_Porter · · Score: 3, Funny

    I believe it spelled "aneurysm". They were discovered by Aneurysm Bevin, evil inventor of British death panels.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;