Author |
Message |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Sat Aug 20, 2005 11:02 pm Post maybe stupid Post subject: Quake3 is open sourced now |
 |
|
|
|
id Software has released Quake3's source code. A fun read if you are into learning to write games.
Since their servers are being hammered, you can download a copy here (5.45 MB). |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Aug 20, 2005 11:20 pm Post maybe stupid Post subject: |
 |
|
|
|
Hrm, I thought it already was. Maybe that's the other two quakes. Can't say that I've ever played any of them. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Sat Aug 20, 2005 11:48 pm Post maybe stupid Post subject: |
 |
|
|
|
Never played it either. But, I guess this is good? _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
Purge Episode I > Eposide III Jar-Jar is kool

Age:36 Gender: Joined: Sep 08 2004 Posts: 2019 Offline
|
Posted: Sun Aug 21, 2005 12:04 am Post maybe stupid Post subject: |
 |
|
|
|
Yes, we can all stare at it now. |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:38 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Sun Aug 21, 2005 7:25 am Post maybe stupid Post subject: |
 |
|
|
|
I'd actually enjoy reading it.
My friends have been playing it a lot, and well, I didn't, because I... sucked.
Anyway, I was forced to run a server for them.
The game really made me wonder what it'd look like "behind the scene".
Too bad this is 1.32, not 1.16j, but I guess the real difference would only be the Punkbuster protection and the updates in the menu.
Thanks though, I'll read it, as far as I can understand it. |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Sun Aug 21, 2005 11:47 am Post maybe stupid Post subject: |
 |
|
|
|
I still like the cool hacks used to help speed up the game.
int Q_log2( int val ) {
int answer;
answer = 0;
while ( ( val>>=1 ) != 0 ) {
answer++;
}
return answer;
} |
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
#ifndef Q3_VM
#ifdef __linux__
assert( !isnan(y) ); // bk010122 - FPE?
#endif
#endif
return y;
}
|
|
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Aug 21, 2005 2:19 pm Post maybe stupid Post subject: |
 |
|
|
|
Optimizers can't do that? I hate micro-optimized C.  _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Sun Aug 21, 2005 10:30 pm Post maybe stupid Post subject: |
 |
|
|
|
Cyan~Fire wrote: | Optimizers can't do that? I hate micro-optimized C. :-( |
Can't do what? Speed up a precompiled library, such as all the math functions? Sin/cose/sqrt/etc all are designed to be acurate. Those optimizations are done with the assumption that you don't need 6 digits of precision if 4 would do. In my tests, it actually is slower for that Q_rsqrt than it is to just do 1/sqrt() on my AMD 2500, but only by a small margin. As for older hardware, that Q_rsqrt is almost twice as fast as sqrt. Why? Because older processor's floating point units sucked. And since you design a game to work on slow machines, you need to optimize for them.
As for the interger log function, that thing is lightspeed ahead of doing a floating point log calculation. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Mon Aug 22, 2005 5:08 pm Post maybe stupid Post subject: |
 |
|
|
|
Well, if I ever write an optimizing compiler, I'm going to detect if someone needs a floating pt/integer function and call different code. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Aug 22, 2005 5:31 pm Post maybe stupid Post subject: |
 |
|
|
|
Cyan~Fire wrote: | Well, if I ever write an optimizing compiler, I'm going to detect if someone needs a floating pt/integer function and call different code. |
I know you are being sarcastic, but do you have any idea how complicated that is? Take a look at the Intel/AMD specs for instruction timing, pipelining, level-1/2 cache interface, North Bridge interface, RAM timing. Frankly, it sounds like the geek version of Fear Factor. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Gravitron VIE Vet

Age:43 Gender: Joined: Aug 02 2002 Posts: 993 Location: Israel Offline
|
Posted: Mon Aug 22, 2005 5:48 pm Post maybe stupid Post subject: |
 |
|
|
|
I thought fear factor was the geek version. |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Mon Aug 22, 2005 10:54 pm Post maybe stupid Post subject: |
 |
|
|
|
Cyan~Fire wrote: | if someone needs a floating pt/integer function and call different code. |
Or you could, you know, overload functions? It is the programmer's job to know what they need. A compiler doesn't know if you need 20 digits of accuracy for that sqrt function or 2. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Aug 23, 2005 10:28 am Post maybe stupid Post subject: |
 |
|
|
|
I've only ever used Verilog. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Aug 23, 2005 4:38 pm Post maybe stupid Post subject: |
 |
|
|
|
I was just talking about floating point of integer. Yes, I guess overloading functions would work just as well, but a compiler should be able to detect a typecast from, say, int to double for a log or sqrt function. |
|
Back to top |
|
 |
SamHughes Server Help Squatter

Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Aug 23, 2005 5:43 pm Post maybe stupid Post subject: |
 |
|
|
|
Something tells me this is wrong, but I don't want to spend the time to figure it out.  |
|
Back to top |
|
 |
SamHughes Server Help Squatter

Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
|
Back to top |
|
 |
|