Doom 3 Source Code is Free

Everything related to programming.
Post Reply
draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Doom 3 Source Code is Free

Post by draconic74 » Wed Nov 23, 2011 5:23 pm

http://www.pcgamer.com/2011/11/23/doom- ... ee-to-all/
https://github.com/TTimo/doom3.gpl

Well, if this isn't something to learn from then I don't know what is. It's the Doom 3 source code, now released for free. And even better, it has an Xcode project file, so it's not limited to Windows. Linux works too. (Make sure to read the README for info on this)

In fact, I just opened it and hit compile. Aside from a few thousand warnings of deprecated stuff, it went just fine. Thats pretty damn awesome. I'll be completely honest, I have no idea what I'm doing or what to even do with it, this sort of stuff is far above my head right now, but it's at least interesting to scroll through the code (decently commented, too) and just look at it.

So for anyone who knows what they are doing, have fun. To everyone else, I dunno... Look at the pretty text! :o
Image

Fonzeh
Ranger
Posts: 1894
Joined: Tue Oct 16, 2007 3:57 am
Location: "I didn't just take your mom out to dinner. I ate your mom for dinner."
Contact:

Re: Doom 3 Source Code is Free

Post by Fonzeh » Wed Nov 23, 2011 5:42 pm

Im guessing it's written in C++?
G[v]N wrote:HUGE NOTIFICATION
THIS GRAVY HAS BRAINS
Mota-Lev was here 30/4/2010@2:18pm
Image

draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Re: Doom 3 Source Code is Free

Post by draconic74 » Wed Nov 23, 2011 7:19 pm

Should have mentioned that, but yes.

Have a snippet of Model.cpp, IN YO FACE

Code: Select all

/*
================
idRenderModelStatic::MakeDefaultModel
================
*/
void idRenderModelStatic::MakeDefaultModel() {

	defaulted = true;

	// throw out any surfaces we already have
	PurgeModel();

	// create one new surface
	modelSurface_t	surf;

	srfTriangles_t *tri = R_AllocStaticTriSurf();

	surf.shader = tr.defaultMaterial;
	surf.geometry = tri;

	R_AllocStaticTriSurfVerts( tri, 24 );
	R_AllocStaticTriSurfIndexes( tri, 36 );

	AddCubeFace( tri, idVec3(-1, 1, 1), idVec3(1, 1, 1), idVec3(1, -1, 1), idVec3(-1, -1, 1) );
	AddCubeFace( tri, idVec3(-1, 1, -1), idVec3(-1, -1, -1), idVec3(1, -1, -1), idVec3(1, 1, -1) );

	AddCubeFace( tri, idVec3(1, -1, 1), idVec3(1, 1, 1), idVec3(1, 1, -1), idVec3(1, -1, -1) );
	AddCubeFace( tri, idVec3(-1, -1, 1), idVec3(-1, -1, -1), idVec3(-1, 1, -1), idVec3(-1, 1, 1) );

	AddCubeFace( tri, idVec3(-1, -1, 1), idVec3(1, -1, 1), idVec3(1, -1, -1), idVec3(-1, -1, -1) );
	AddCubeFace( tri, idVec3(-1, 1, 1), idVec3(-1, 1, -1), idVec3(1, 1, -1), idVec3(1, 1, 1) );

	tri->generateNormals = true;

	AddSurface( surf );
	FinishSurfaces();
}
Isn't AddCubeFace OpenGL? Sounds familiar.
Image

nil
Halo Moderator
Halo Moderator
Posts: 1090
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: Doom 3 Source Code is Free

Post by nil » Wed Nov 23, 2011 9:25 pm

No, it's most likely a function or method in the Doom 3 source code that modifies the tri data.

Nice to see the source code is now open, although I do not own the game.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Re: Doom 3 Source Code is Free

Post by draconic74 » Thu Nov 24, 2011 6:00 am

Well hello there.

Code: Select all

/*
================
AddCubeFace
================
*/
static void AddCubeFace( srfTriangles_t *tri, idVec3 v1, idVec3 v2, idVec3 v3, idVec3 v4 ) {

	BLAH BLAH BLAH - A bunch of  " tri->verts[tri->numVerts+0] "
	Like 20 of em, with different suffixes and numbers. 

}
So if I understand correctly, you should be able to compile this code and use the game's original data to play the actual thing? Again, this is pretty much way above my head. It does generate a Doom3.app though. And the console goes all the way to getting a config file error, which seems to be a common error in games using id Tech engines. So basically, you need that file before it starts checking for anything else.
Image

nil
Halo Moderator
Halo Moderator
Posts: 1090
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: Doom 3 Source Code is Free

Post by nil » Thu Nov 24, 2011 11:13 am

draconic74 wrote:So if I understand correctly, you should be able to compile this code and use the game's original data to play the actual thing?
Yeah.

I think I remember being able to compile the Quake 3 source code and run the app without supplying any game content, though. I'm not sure about the config file and how Doom 3 works. Maybe you could just grab the Doom 3 demo (that exists, right?), and get the data you need from there.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Re: Doom 3 Source Code is Free

Post by draconic74 » Thu Nov 24, 2011 1:03 pm

That would be worth a shot. Unless it's like Halo/Halo Demo and the mapfile has oddities.

Also, Doom 3 is on sale on Steam right now... Hm... Windows only though -_-
Image

Fonzeh
Ranger
Posts: 1894
Joined: Tue Oct 16, 2007 3:57 am
Location: "I didn't just take your mom out to dinner. I ate your mom for dinner."
Contact:

Re: Doom 3 Source Code is Free

Post by Fonzeh » Thu Nov 24, 2011 4:49 pm

maybe now that halo has been remade, they will release the source code?

Yeah i know... Imagine the shit we could do....
G[v]N wrote:HUGE NOTIFICATION
THIS GRAVY HAS BRAINS
Mota-Lev was here 30/4/2010@2:18pm
Image

draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Re: Doom 3 Source Code is Free

Post by draconic74 » Fri Nov 25, 2011 5:16 pm

Don't really think I would change anything... I suppose the source code allows for some awesome tweaks, but to be honest Halo just plays fine as it is. I guess if you could improve rendering and whatnot to make it run a bit better, then shove in proper support for 10.6 and 10.7.


Though I doubt they will release it. For one thing, the Halo engine as far as I know is exclusive to the Halo franshice and Stubbs the Zombie (made by a split-off group of the Bungie team). I don't think anyone has used it aside from them. It's not like id Tech, Unreal, or Source, these ones are widespread.
Image

Dirk Gently
Commando
Posts: 2047
Joined: Sun Oct 21, 2007 2:34 pm
Location: 3C0E9056
Contact:

Re: Doom 3 Source Code is Free

Post by Dirk Gently » Mon Nov 28, 2011 5:41 am

Halo's code is still owned by microsoft and will not be released.

-- Source: Roger Wolfson, bungie employee

draconic74
Green Beret
Posts: 3470
Joined: Sat Jun 03, 2006 11:08 am
Contact:

Re: Doom 3 Source Code is Free

Post by draconic74 » Mon Nov 28, 2011 11:56 am

Dirk Gently wrote:Halo's code is still owned by microsoft and will not be released.

-- Source: Roger Wolfson, bungie employee
Not even surprised in the slightest, really...
Image

Fonzeh
Ranger
Posts: 1894
Joined: Tue Oct 16, 2007 3:57 am
Location: "I didn't just take your mom out to dinner. I ate your mom for dinner."
Contact:

Re: Doom 3 Source Code is Free

Post by Fonzeh » Tue Nov 29, 2011 8:45 pm

same
G[v]N wrote:HUGE NOTIFICATION
THIS GRAVY HAS BRAINS
Mota-Lev was here 30/4/2010@2:18pm
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest