Study Doom 3 code

Started by
3 comments, last by Lil_Lloyd 11 years, 3 months ago
Hello,

I want to study the Doom 3 code and I would like some help. How can I start reading it? Should i find a main() function and go on from there?

Any other tips that may help me?

Thank you for your time
Advertisement

Pick a subsystem you're interested in and dive in. You may want to try to get a broad-strokes overview of the high-level setup, which is presumably why you would start with main, but since other folks have already done the work of that and written about it, I'd say the best approach is to just read their analysis for that info, and dig into specific sub-systems for details that you're interested in.

I'd also caution against putting the Doom 3 code on any sort of pedestal. Its a great resource to have the source of a commercial game as renowned as Doom 3, but there's a lot of other great open-source code too. There was a recent opinion article on the "beauty" of the Doom 3 source code, but exercise caution and judgment, as it was just that--an opinion of one person, who, in the very same article, says that he considers himself "not a coder", although he has published a game himself. Having read that article myself yesterday, much of what he considers "beautiful" are things that myself and others would consider ugly. If you're looking to the code as a model for you to mimic, you could do worse, but you could also do better. Don't assume the code or design is great just because it's Doom, or just because its Carmack.

throw table_exception("(? ???)? ? ???");

This may be of interest to you - http://fabiensanglard.net/doom3/index.php
Are you sure you want to study the Doom 3 src code?

I would suggest only studying it if you are very familiar with C/C++. Likewise I would only suggest studying a large Unity codebase if you are familiar with Unity.

The fact that you need to ask this question kinda seems that you have been recommended Doom 3 by someone a little unfamiliar with how software (especially games development) is best learnt.
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

[quote name='Ravyne' timestamp='1358364407' post='5022272']
There was a recent opinion article on the "beauty" of the Doom 3 source code, but exercise caution and judgment, as it was just that--an opinion of one person, who, in the very same article, says that he considers himself "not a coder", although he has published a game himself.
[/quote]

I think he's just being humble, as in that same opinion piece he showed quite a bit of knowledge of C++, the STL and code readability in general.

Anyway in answer to the original post, Doom3 is a MASSIVE codebase, by a team of programmers conforming to a set of standards in terms of code layout and practices. If you have little experience in 3d game programming maybe looking at the original Doom source code would be good, despite in being in C and hard to understand at times refactoring the code into an object oriented style of your choice (either using inheritance or a flat component based hierarchy) would be a good learning exercise albeit a long one.

This topic is closed to new replies.

Advertisement