
Carmack: Doom 3's engine ready for open-sourcing, awaiting 'OK' from legal - barredo
http://www.engadget.com/2011/11/01/carmack-doom-3s-engine-ready-for-open-sourcing-awaiting-ok/?a_dgi=aolshare_twitter
======
johnyzee
I love how Carmack and Id since its inception has not only defined the cutting
edge of game technology, but also repeatedly utterly disrupted industry
business models (pioneering shareware distribution, the 'free demo' model,
engine licensing), all the while making an absolute killing doing so. Most
inspirational hackers out there, imho.

~~~
sammysamsam
He didn't pioneer shareware distribution or the free demo model. This is a
good write-up on the history of shareware:

<http://www.loonygames.com/content/1.24/feat/>

(Has this been posted to HN before? Good stuff in there.)

~~~
jebblue
When I think of shareware I think of id Software, Apogee, McAfee and PKZip. It
might not be official but to me that is as close to pioneering as it gets.

~~~
Fliko
Can you elaborate on why you think of Apogee? When I think of Apogee I think
"Gee, I wish my Apogee product worked on Windows"

~~~
georgemcbay
Different Apogee. Presumably you are thinking of Apogee Electronics, he is
talking about Apogee Games, which more or less* became 3D Realms (of Duke
Nukem infamy), and who back in the day published a lot of the classic
shareware games from other developers as well, including id's early stuff like
Commander Keen and Wolf 3D.

* "more or less" because the business structure is more complicated than that and there was still an Apogee Software alongside 3D Realms, but for all practical purposes, what was Apogee Games became 3D Realms and then died due to the Duke Nukem Forever project.

~~~
Fliko
Ahh yes I was thinking of Apogee Electronics, thank you that clears things up.

------
tome
This is amazing. How come ID can consistently release top quality engines as
open source and other games companies cannot?

~~~
regularfry
Scorched earth. If id release an engine at a certain tech level, they put
_serious_ competition in the way of other would-be licensors of engines at or
about that tech level. That stops smaller software houses from breaking
through that tech level to compete at the higher level.

I don't know if it's a conscious policy or not, but it's interesting
nonetheless.

~~~
derleth
I disagree: The GPL allows those smaller software houses to use the id engine
_without giving away their game resources_. After all, id doesn't give away Q3
just because it gives away the Q3 engine.

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.

~~~
regularfry
That's exactly my point. You can make and sell your own game, but you can't
compete with id by making and licensing your own engine so easily.

------
xedarius
I for one am looking forward to reading through the unified lighting model
code.

~~~
exDM69
I wanna see how they did their shadow volumes. As far as I know, they did it
without geometry shaders, which would mean that they had to do the shadow
volume extrusion on the CPU. Or maybe there's some cleverness involved.

~~~
joakleaf
They probably used the CPU -- I remember reading somewhere that Carmack also
wanted to implement a beam-tree (3D BSP) for faster culling of shadow
surfaces, but I am not sure. I did some experiments with Shadows myself 10
years ago, on that era of CPUs and GPUs and the bottleneck for me was drawing
the volumes in the stencil buffer.

------
albertzeyer
I think this is also the first C++ version of their engine, isn't it? And by
that the first C++ code released by Id.

I wonder how much C++ there is involved in the code.

~~~
i_c_b
I worked on Quake4 as a programmer for a bit over a year, though little of my
work ended up in the final game.

The Doom3 engine is mostly C++. If I recall correctly, the renderer still
looked more like a blend of C with some C++ slowly drifting in (which makes
sense, given how good of a C programmer Carmack is), but the rest of the game
code is very heavily C++, for some definition of C++, along with a scripting
layer.

Having worked extensively with the Quake 2 engine previously, I really didn't
like the Doom 3 engine, myself. It was radically less... pragmatic. Earlier id
engines, to me, were masterpieces of concision. They weren't amazing feats of
black box abstraction by any measure, and they implicitly assumed you needed a
lot of domain knowledge to understand what they were doing, but they did
exactly what they needed to do with a minimum of fuss. Features were included
because they were used, generally with the smallest and simplest code and tool
footprint possible.

Not so with Doom 3. Huge amount of code appears to have been written because
someone prolific thought it would be lots of fun to write it, many features
end up going unused or are in the way, and ultimately (because it's more
typically software engineered in style), every feature requires about 30 times
as much code to be written properly and has several extra unused layers of
abstractions crufting things up. The game code (in C++) in particular bears an
unfortunate resemblance to Windows MFC-style C++, with a giant 12 layer deep
inheritance graph with everything inheriting from a few enormous base objects.

All of that to my eyes, anyway. But then, I really cut my teeth on Quake 1 and
2, and found that their concision and brevity really helped them stay out of
the way when adding new, innovative features.

The funny thing about the code for Doom 3 is that, looking through it all,
you'd get the impression that Doom 3 was a radically more complicated game
that what you ultimately experience when you play the game.

The best way I could put it is this: Quake 1 and 2 and 3 were well made games
that ended up being enormously fruitful for white box reuse. You couldn't do
much with them without understanding fair bits of their internals, but they
didn't actively resist being understood. Doom3 was built to be used in a more
black box fashion (like the Unreal Engine), with all that entails from an
architecture perspective. I'm sure others might disagree with me from a code
ideology perspective, but it is hard to ignore how fruitful the Quake engines
were for licensing, and how much Doom 3 sank like a stone.

The code bases make really fascinating studies in contrast about the
consequences of different software engineering values, at the very least.

TL; DR: Quake 1 - 3 remind me of linux code, Doom 3 reminds me of MFC.

~~~
albertzeyer
I have read most of the Q3 code and really like it. And as you said, not much
(or any) overhead.

What you write about D3 (i.e. idTech4) makes me a bit sad. How comes it? Less
influence by Carmack? (Because he still seems to be the pragmatic guy to me.)
Too often, when C++ is involved, I see much too complicated code. Whereby I
still have the meaning that you can really end up in having simpler code with
C++. (Well but that goes into the usual C vs. C++ ranting discussion.)

Do you have any knowledge about idTech5 (or maybe even idTech6) which you can
share?

~~~
i_c_b
I think by Doom3 id had reached a point where they needed a team of
programmers, rather than Carmack + programmers orbiting Carmack. And so Doom3
represents their transition to dealing with all the software engineering /
communication issues all of us on teams always have to deal with.

I don't have any knowledge of idTech5, although I would guess it goes further
down the lineage of Doom3. id still has to find solutions to the problem of
programmers working on teams, after all - no amount of Carmack genius is going
to magically fix that all too banal (and inevitable) organizational challenge.

I had my fill of the industry by the mid-2000s and have been working on
indie/experimental/violent educational games since, so that's roughly where my
big iron engine knowledge fades...

------
albertzeyer
So, what platform are we gonna port this to? :)

~~~
wgx
JavaScript please!

~~~
dmix
Platform... not language.

~~~
wgx
Platform: the modern web browser.

------
dangoldin
If anyone's interested in reading a book about the history of id Software,
Carmack, and Romero I recommend Masters of Doom
([http://www.amazon.com/Masters-Doom-Created-Transformed-
Cultu...](http://www.amazon.com/Masters-Doom-Created-Transformed-
Culture/dp/0812972155/)). I finished it last week and it was a great read.

------
jmcnevin
I guess this will get _someone_ using id tech 4... doesn't look like it ever
got much love from a licensing standpoint.

<http://en.wikipedia.org/wiki/Id_Tech_4#Games_using_id_Tech_4>

------
jebblue
This is great news! That engine is I think the same one that powers the most
excellent ETQW and the not so bad Quake 4.

Those run on Linux and that is awesome.

------
skatenerd
I'm pretty excited to play The Dark Mod for free
(<http://www.thedarkmod.com/>)

~~~
pmh
It's unlikely that you'll be able to play TDM without a copy of Doom 3 for the
foreseeable future. TDM reuses a number of Doom 3 assets and those are not
included with the open source release of the engine.

------
pferde
Can't wait to see the awesome things fans will do with the engine - assuming
it even gets through ID's legal dept.

~~~
exDM69
Meanwhile you can go take a look at all the nice things that have been done
with the Quake engines. Nexuiz, Alien Arena and many other open source games
are based on the Quake engine.

It's fairly certain that id's legals will approve the release as they have
done with all their previous game engines. The only problem might be if D3
uses some 3rd party libraries.

~~~
bri3d
I believe one of the major issues will be Doom 3's use of the "zfail"
algorithm, which Creative claim a patent on. Generally, Creative license this
patent to game developers in exchange for the game supporting OpenAL (a net
win for Creative as it means their sound cards can make the game run faster
and more people will buy them), but I'm not sure what the terms on a source
release would be. Take a look at [1] for more info.

[1]: [http://www.doomworld.com/vb/doomworld-
news/45868-doom-3-code...](http://www.doomworld.com/vb/doomworld-
news/45868-doom-3-code-may-contain-patented-algorithm/)

~~~
maleadt
Carmack has said somewhere (I can't retrieve the source right now) that an
alternative, slower method will be used in the GPL'd codebase, effectively
working around Creative's patent claims.

~~~
exDM69
Oh this is just silly. Thankfully the patented algorithm is ridiculously
simple, so someone can write an open source patch to use the better stencil
algorithm. No doubt whatever derivatives will spring from the D3 source will
use the single pass method.

While being at it, it shouldn't be too hard to use geometry shaders for the
shadow volume extraction in the D3 engine. Hmm, maybe I should do it :)

------
bsiemon
Is it odd that it is a picture of a tweet instead of a clickable thing?

------
dantecesa
woah hello HN!

