
Quake 2 Source Code Review - DanielRibeiro
http://fabiensanglard.net/quake2/index.php
======
xedarius
I really respect Carmack, he is one of the few programmers I'd describe as an
industry trend setter. I've worked on many games in my career, and seen a lot
of engines. When you read through the Q2 and perhaps a better example is the
Q3 engine source, you sit there and think, hang on .. where's the rest of the
code? He takes a complex problem and reduces it to a set of simple components,
and reuses those components. This is incredibly hard to do.

What the article doesn't impress upon people is the effect Carmacks code has
on the industry. The shaders in Quake 3 were a huge thing, now seems so
obvious. I have no evidence for this, however I wouldn't be surprised if Q3
shaders are the reason we have vertex/pixel shaders in hardware today.

------
wccrawford
"I have no idea why id software decided to trust the C Standard Library at
this point"

This quote reminds me why I liked watching Notch's video for Ludum Dare. We
not only get to see the final result, but the way it got to be that way, and
some of his thoughts on it as well.

------
0x0
I noticed this comment in the "notes.html":

    
    
      // Set the floating point precision ...
      _controlfp                           
      // Question: Why do that for every frames ? Probably because precision is altered during the loop execution.
      // Answer: The is no other call to this function. It appears that floating point precision remains the same during program execution.
    

I seem to vaguely recall reading something about some versions of Windows not
preserving the FPU state across task switches. Could it be that this call to
configure the FPU for every frame is a workaround for that?

~~~
apaprocki
[http://gafferongames.com/networking-for-game-
programmers/flo...](http://gafferongames.com/networking-for-game-
programmers/floating-point-determinism/)

Search for _controlfp.. seems some MS API calls could change it.

~~~
daemin
I've also experienced Windows / DirectX API's use MMX, hence the floating
point code I was using (x87 FPU) required a femms instruction before it to
change back from MMX state.

This just goes to show that if you need a particular state on a processor
(CPU, FPU, GFX, etc) you need to set it explicitly before use.

------
kleiba
3D graphics is something I've always wanted to look into more once I have a
lot of time on my hands. Watching a good deal of Notch's ludum dare already
whetted my appetite. And now just glancing over this article makes my finger
tips itch, I'd like to take a week off and start diving into it. It's just
great. I love the extra work Fabien put in to link to many external books and
articles.

This is _so_ bookmarked!

~~~
wccrawford
I said something very similar to that for many years.

I finally just jumped into 2D games recently and found it surprisingly easy.
Once I'm comfortable with 2D, I'm moving on to 3D as well.

I'd suggest you just jump in as well. Don't worry about taking a week off or
whatever. Just use some of your free time at night and get started.

~~~
kleiba
Free time at night? What are you talking about? ;-)

------
quux
Dammit... first the workings of Thief and now this!

I have work to do!

~~~
eru
I've missed the submission about Thief. Do you have a link?

~~~
sil3ntmac
<http://news.ycombinator.com/item?id=3017013>

Edit: changed direct link to YC link.

------
VMG
Excellent. I had a lot of fun recently looking at ioquake3 code and picking up
a thing or two.

------
Agathos
On a totally different note, my wrists hurt just looking at that picture of
Carmack in front of his Intergraph monitor. Lower your keyboard, man!

~~~
secoif
D: At first, I thought you were telling us you were getting a bit too excited
about John Carmack and his monitor.

------
msftguy
"Since I was running Windows on a Mac with Parallels it was uneasy to hit
"printscreen" while the game was running. I hardcoded the '*' from the keypad
to produce the same"

Umm.. educational, sure, but can't you just: alias +shift "bind 8 screenshot";
alias -shift "bind 8 whatever_was_bound_to_8"; bind shift +shift;

