Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Quake3 is open sourced now

 
Post new topic   Reply to topic Printable version
 View previous topic  Need a host Post :: Post You had to go global about your stupid...  View next topic  
Author Message
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sat Aug 20, 2005 11:02 pm   Post maybe stupid    Post subject: Quake3 is open sourced now Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Aug 20, 2005 11:20 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sat Aug 20, 2005 11:48 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Never played it either. But, I guess this is good?
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Purge
Episode I > Eposide III
Jar-Jar is kool


Age:36
Gender:Gender:Male
Joined: Sep 08 2004
Posts: 2019
Offline

PostPosted: Sun Aug 21, 2005 12:04 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Yes, we can all stare at it now.
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:38
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Aug 21, 2005 7:25 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

I'd actually enjoy reading it.
My friends have been playing it a lot, and well, I didn't, because I... sucked. icon_sad.gif
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
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sun Aug 21, 2005 11:47 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

I still like the cool hacks used to help speed up the game.
Code: Show/Hide
int Q_log2( int val ) {
   int answer;

   answer = 0;
   while ( ( val>>=1 ) != 0 ) {
      answer++;
   }
   return answer;
}
Code: Show/Hide
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
View users profile Send private message Add User to Ignore List Send email
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Aug 21, 2005 2:19 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Optimizers can't do that? I hate micro-optimized C. icon_sad.gif
_________________
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
View users profile Send private message Add User to Ignore List Visit posters website
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Sun Aug 21, 2005 10:30 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Aug 22, 2005 5:08 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Mon Aug 22, 2005 5:31 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Gravitron
VIE Vet


Age:43
Gender:Gender:Male
Joined: Aug 02 2002
Posts: 993
Location: Israel
Offline

PostPosted: Mon Aug 22, 2005 5:48 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

I thought fear factor was the geek version.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address Yahoo Messenger MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:42
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Mon Aug 22, 2005 10:54 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue Aug 23, 2005 12:07 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

In hardware design languages optimizations of this kind are much easier for the compilers because the use of the inputs and outputs is explicit. If you have an add "function" that takes 2 8-bit values, adds the upper 7 bits, then outputs only the lower 6 of those...In C it would look kinda like this:

Code: Show/Hide
wire[6:0] add (wire [7:0] a, wire [7:0] b)
{
wire [7:0] c;

c = a[7:1] + b[7:1];
add = c[6:0];
}


One bit of each input, and one bit of the output are not used, so they are completely removed from the final compiled result, including "outside the function". No wires will exist for them. It's much more explicit but much more of a pain in the ass.

I'm glad C is the way it is.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue Aug 23, 2005 9:39 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Here's some VHDL code for a circuit that adds two 3 bit lines and puts the output on a 4 bit line. This is straight from a calculator circuit I did last semester.

Code: Show/Hide
entity summer is
  port(input1, input2: in std_logic_vector(2 downto 0); output: out std_logic_vector(3 downto 0));
end summer;

architecture algorithmic of summer is
begin
  process(input1, input2)
  begin
    -- the ampersand is concatenation. it's used here to change
    -- the three wide inputs to four wide.
    output <= ('0' & input1) + ('0' & input2);
  end process;
end algorithmic;
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue Aug 23, 2005 10:28 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

I've only ever used Verilog.
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Aug 23, 2005 4:38 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 251
Location: Greenwich
Offline

PostPosted: Tue Aug 23, 2005 4:49 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Depending on your distribution of numbers for val, this log2 function might run significantly faster. It works faster for higher values of val -- the border is at 128 or 256.

Code: Show/Hide
int log2(unsigned long val) {

    int ret = 0;

    if (val >> 16) {
        ret |= 16;
        val >>= 16;
    }

    if (val >> 8) {
        ret |= 8;
        val >>= 8;
    }

    if (val >> 4) {
        ret |= 4;
        val >>= 4;
    }
   
    if (val >> 2) {
        ret |= 2;
        val >>= 2;
    }

    ret |= val >> 1;

    return ret;
}
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue Aug 23, 2005 5:43 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Something tells me this is wrong, but I don't want to spend the time to figure it out. icon_wink.gif
Back to top
View users profile Send private message Add User to Ignore List
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 251
Location: Greenwich
Offline

PostPosted: Tue Aug 23, 2005 7:46 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

Or maybe this version, which in my testing beats or ties Q_log2 for like, all inputs except 0 and 1.

Code: Show/Hide
int log2quick(unsigned long val) {

   int ret;

   if (val >> 8) {
      val >>= 8;

      ret = 8;

      if (val >> 12) {
         ret = 20;
         val >>= 12;
      }

      if (val >> 6) {
         ret += 6;
         val >>= 6;
      }

      if (val >> 3) {
         ret += 3;
         val >>= 3;
      }

      ret += (val >> 1) & 1 + (val >> 2);

   } else {
      ret = 0;
      if (val >> 4) {
         ret = 4;
         val >>= 4;
      }

      if (val >> 2) {
         ret |= 2;
         val >>= 2;
      }

      ret |= val >> 1;
   }

   return ret;

}
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 21 page(s) served in previous 5 minutes.

phpBB Created this page in 0.943767 seconds : 42 queries executed (86.9%): GZIP compression disabled