This comment by Carmack seems to imply that the restrained use of advanced C++ features was more by accident then by design: I had C and Objective-C background, and I sort of "slid into C++" by just looking at the code that the C++ guys were writing. In hindsight, I wish I had budgeted the time to thoroughly research and explore the language before just starting to use it. You may still be able to tell that the rende…
Doom3 is the proof that “keep it simple” works
51–60 of 111 posts
Re: Doom3 is the proof that “keep it simple” works
#52These adverts pretending to be learning experiences, really bother me "CppDepend Tutorial" would be a better title
You must be the target audience then because I read a great article about Doom3 and have no clue what youre talking about. I also dont know what CppDepend is...
And the article is written by the creators of CppDepends
Re: Doom3 is the proof that “keep it simple” works
#53Earlier quoted context omitted.
What's wrong with this?
Over 150 lines of code in a simple method? C-style declaration of all the variables in the beginning? (Yes, I know what Carmack said about how he written the project; this explains it, but doesn't make it good C++ code.) Unclear flow with just one comment, which doesn't really explain anything?
There is a logic to keeping logic together if it is isolated: http://number-none.com/blow/john_carmack_on_inlined_code.htm...
Context is important, to anyone developing D3 code, this code might be obvious and comments would be unnecessary. Considering 'geterdone' attitude of many game projects, with high levels hackery, this is very nice code.
Re: Doom3 is the proof that “keep it simple” works
#54I wonder why they opted not to use references? It seems an odd choice to me, did id software give an explanation?
The most common argument: Pass by reference hides the implication of a side effect on the parameter. If you expect the function to manipulate the parameter, passing by pointer is clearer. Pass by reference was also only added to efficiently support copy constructors and more importantly operator overloading, both of which are syntactic sugar that a C with Classes style would normally avoid. Template programming also…
References also help avoid problems with pointer aliasing, and make it clear that the called function definitely cannot delete the passed objects. So it's more than just syntactic sugar.
(n.b. I'm not arguing that pointers are bad and should never be used, I still just don't see a clear reason never to use references. The id Software coders are smart, they must have had good reason to pick their choice)
Re: Doom3 is the proof that “keep it simple” works
#55Earlier quoted context omitted.
You think that's bad: https://github.com/dhewm/dhewm3/blob/master/neo/game/ai/AI.h... Scroll down and watch the readability disappear.
append ?ts=4 to the URL to change GitHubs default 8 character tab to 4 characters wide.
Re: Doom3 is the proof that “keep it simple” works
#56https://github.com/dhewm/dhewm3/blob/master/neo/game/Target.... This is the "nicest looking code [you] have ever seen" ?
Re: Doom3 is the proof that “keep it simple” works
#57This comment by Carmack seems to imply that the restrained use of advanced C++ features was more by accident then by design: I had C and Objective-C background, and I sort of "slid into C++" by just looking at the code that the C++ guys were writing. In hindsight, I wish I had budgeted the time to thoroughly research and explore the language before just starting to use it. You may still be able to tell that the rende…
That doesn't necessarily imply that he's saying he should've used more advanced features. It could just as well mean he should've understood better the features he did use.
Re: Doom3 is the proof that “keep it simple” works
#58These adverts pretending to be learning experiences, really bother me "CppDepend Tutorial" would be a better title
Re: Doom3 is the proof that “keep it simple” works
#59https://github.com/dhewm/dhewm3/blob/master/neo/game/Target.... This is the "nicest looking code [you] have ever seen" ?
Re: Doom3 is the proof that “keep it simple” works
#60This statement suits even better to id Tech 3 (Quake 3). John Carmack mentioned: I still think the Quake 3 code is cleaner, as a final evolution of my C style, rather than the first iteration of my C++ style [Doom 3]: http://kotaku.com/thanks-a-few-comments-in-some-ways-i-still... and he linked to his blog post about "Functional Programming in C++" on the now defunct but former popular AltDevBlog: https://web.archive.org/web/20130126164111/http://www.altdev...
The engine of Doom 3 (id Tech 4) was good. The game itself was repetitive and a bit boring. It was a few months late Aug 2004, and Far Cry 1 (March 2004) already overshadowed it in terms of graphics and gameplay.
Licensing the id-Engine to other companies was very successful during the id Tech 2 (Quake 1/2) and id Tech 3 (Quake 3) era. Back then the Unreal engine was only used in Unreal and Unreal Tournament '99, with Deus Ex as an early adopter.
But few games were released starting with id Tech 4 (Doom 3) and later id Tech 5 (Rage). Compromises during the development of id Tech 4+ meant it wasn't suitable for many different purposes. Only small levels with a few light sources were possible - the later "mega texture" addition partly solved that issue but meant a huge hardware step during development and prevented Mods and custom maps. In retrospect the Unreal 3+ and CryEngine 1+ offered comparable results without sacrifice their universalizability. http://en.wikipedia.org/wiki/Far_Cry_(video_game) , http://en.wikipedia.org/wiki/Doom_3 , http://en.wikipedia.org/wiki/Id_Tech_4
The Call of Duty franchise is still using modified Quake 3 engine heavily extended with Ritual's ÜberTools, now named IW engine and comes with many modern features like texture streaming. Half Life 1+2 are based on a heavily modified Quake 1 engine. http://en.wikipedia.org/wiki/Quake_engine , http://upload.wikimedia.org/wikipedia/commons/6/63/Quake_-_f... , http://en.wikipedia.org/wiki/File:Quake_-_family_tree_2.svg , http://en.wikipedia.org/wiki/Heavy_Metal:_F.A.K.K.%C2%B2
All of these id tech engine games can be edited with the GtkRadiant map editor (Half Life, Call of Duty, Quake 3, Doom 3, etc.): http://en.wikipedia.org/wiki/GtkRadiant