I think id does it mostly because Carmack personally pushes for it. However it arguably makes some sense for them, relative to other game companies, because they've been particularly identified with the "genius hacks to make stuff work" aura, and every source release produces a new wave of discoveries/press about crazy things id did in the guts of one of their engines, which solidifies that reputation. Plus it's probably good for Carmack getting historical credit to put the techniques out in the open once they're no longer most-recent-gen.
wow, that sounds interesting! any links?
Carmack's Square Root implementation, which runs four times faster than the assembly language instruction.
On my computer it is indeed four times faster, but the marvellous method is on its own again four times slower than SSE, using the rsqrtps instruction, with the advantage of a way lower maximum error.
To take the square root of an array of 1024 floats:
Naive sqrtf() CPU cycles used: 48160, error: 0.000000
Vectorized SSE CPU cycles used: 2970, error: 0.000392
Marvellous Carmack method CPU cycles used: 11330, error: 0.002186
Remember, Quake was released in 1996, SSE came out in 1999.
Would you mind posting your results here? I'm quite interested if this has the same pattern everywhere.
Input array size is 1024
Naive sqrtf() CPU cycles used: 54514, error: 0.000000
Vectorized SSE CPU cycles used: 900, error: inf
Marvelous CPU cycles used: 21514, error: inf
I'm not sure how to interpret the errors. I had to make a few changes myself for this to compile on my machine.
A vectorized version of the marvelous method would be a fairer comparison. If your data is not very vectorizable and you don't need high precision, it's still fairly marvelous.
The SSE version is 16x faster than the x87 FPU version and almost 4x faster than the marvelous method. Further, the marvelous method is a loop and is much more resource-hungry than an instruction that goes away for 5-10 cycles (reciprocal throughput is now 1 cycle) but leaves you with most of your execution resources to do other useful work.
Vectorizing the marvelous method is very likely to be painful, as it has the treatment of a value as both a float and an int - while the xmm registers are dual-purpose operating on one successively as a int and a float causes some extra latency. The use of bit shifts and float operations require these cross-domain transfers...
If you have not read his work, you are in for a treat. He has a wonderful writing style that is both engaging and illuminating.
There are a number of chapters [3] in the book that specifically discuss technology and development related to Quake.
[1] PDF: http://www.gamedev.net/page/resources/_/technical/graphics-p...
[2] http://en.wikipedia.org/wiki/Michael_Abrash
[3]
Chapter 64 - Quake's Visible-Surface Determination
Chapter 66 - Quake's Hidden-Surface Removal
Chapter 67 - Sorted Spans in Action
Chapter 68 - Quake's Lighting Model
Chapter 69 - Surface Caching and Quake's Triangle Models
Chapter 70 - Quake: A Post-Mortem and a Glimpse into the Future
I don't know if it's a conscious policy or not, but it's interesting nonetheless.
They usually dual license the old engines , distribute 1 under GPL and another under a commercial (albeit relatively cheap compared to the newer engines) license.
The GPL license can only be used to create games that are also GPL licensed (so stuff like alien arena I think).
I suppose this could allow someone to start developing using the GPL'd engine and then switch to the commercial engine later once they had something ready to release.
I like to think it is more to do with carmack being curious as to what people will do with his creations.
As the game resources are what the players mostly associate with the game, you can still make and sell your own game based on a GPL'd engine without the GPL really cutting into your profits.
Also because they started the good habit a long time ago and it definitely showed off benefits. (AFAIK, the iPhone port of the DooM engine depends on the open-sourced branch of the DooM engine)
Also, compared to UE3, ID Tech 4 was not used in many games.
It's actually slightly different from that: "if you're going to make a game with id Tech 5 then it needs to be published by Bethesda"
They've since moved on and their most recent game, RAGE, uses the fifth version of their engine, not the fourth.
They're basically open sourcing the engine that they're no longer hyping/selling, while they continue to use their modern engine for business.
How can they? I mean, I guess other companies just lets their engines die instead of open sourcing it.