{"id":12574,"date":"2011-08-10T04:23:39","date_gmt":"2011-08-10T09:23:39","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=12574"},"modified":"2011-08-10T04:41:32","modified_gmt":"2011-08-10T09:41:32","slug":"john-carmack-2011-keynote-annotatedpart-3-of-3","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=12574","title":{"rendered":"John Carmack 2011 Keynote Annotated:<br\/>Part 3 of 3"},"content":{"rendered":"<p>You should know the drill by now. Movie first, followed by my response with links to the part of the speech in question.<\/p>\n<p><table class='nomargin' cellspacing='0' width='100%' cellpadding='0' align='center' border='0'><tr><td><iframe loading=\"lazy\" width=\"1024\" height=\"576\" src=\"https:\/\/www.youtube.com\/embed\/4zgYG-_ha28\" frameborder=\"0\" allowfullscreen class=\"embed\"><\/iframe><br\/><small><a href='http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28'>Link (YouTube)<\/a><\/small><\/td><\/tr><\/table><\/p>\n<p>Please, please, would someone from Quakecon log in to YouTube and CHANGE THE THUMBNAIL FOR THIS MOVIE? Thank you. Geeze.<\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=37m15s\">37:15<\/a><\/h3>\n<p>&#8220;Every game has taken longer than the one before, and that <em>cannot<\/em> continue.&#8221;<\/p>\n<p><!--more-->This is, of course, one of the things <a href=\"http:\/\/www.escapistmagazine.com\/articles\/view\/columns\/experienced-points\/6069-Death-to-Good-Graphics\">I&#8217;ve been griping about<\/a> incessantly for years now. I think everyone should have come to this conclusion about five years ago.  Right now, Carmack is the only one saying it. (Or at least, the only one formulating a plan.  So for EA&#8217;s brilliant plan is to continue to Spend Too Much, but make up for it by Charging Too Much. But that&#8217;s a rant for another time.) Other industry leaders will eventually follow Carmack, but I&#8217;m confident that the rash of studio closings over the last couple of years is a result of an entire industry that refused to see the wall they were about to run into. Even now, a few dozen studios and a few thousand jobs later, we&#8217;re still not seeing a real change in behavior that would bring these development times under control.  <\/p>\n<p>At this sluggish pace I imagine a few more development houses will be driven into the ground before industry leaders DO SOMETHING about it.  And of course, if Microsoft or Sony hit us with another console generation, it might delay that realization even further. Because nobody will want to show up to the ball wearing last year&#8217;s graphics engine. Perish the thought. <\/p>\n<p>I would love if the next generation of hardware wasn&#8217;t used to make anything look better, but simply used to make everything easier to develop.  Imagine if Rage didn&#8217;t need that complicated four-tier staging system to bring textures from optical media to memory.  However, until industry leaders repent, I&#8217;m sure any new hardware they get will be put into MOAR GRAFIX, and not used to give the artists and programmers a break.  <\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=42m00s\">42:00<\/a><\/h3>\n<p>&#8220;16k of ROM.&#8221;  <\/p>\n<p>Like he said, the high-end Atari 2600 games fit everything into 16K of memory, and it took some fancy technological tricks to make even that possible. That means that <a href=\"http:\/\/www.youtube.com\/watch?v=zYLA_uO-XH0\">River Raid<\/a>, that innovative game by plucky underdog development house Activision, was so small that its memory banks couldn&#8217;t even hold the HTML source for the web page you&#8217;re reading right now. (Not even <em>close<\/em>.)<\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=46m00s\">46:00<\/a><\/h3>\n<p>&#8220;We don&#8217;t have detail maps [&#8230;]&#8221;  <\/p>\n<p>I give a basic visual demonstration of detail textures <a href=\"?p=5267\">here<\/a>.<\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=46m30s\">46:30<\/a><\/h3>\n<p>So, even though Blu-Ray discs can hold a lot more data, id isn&#8217;t going to be filling up the Rage BR disc with higher-detail data.  Partly because they didn&#8217;t have time to re-code all those terabytes of data. Carmack didn&#8217;t say so, but I also suspect that this would be pointless &#8211; higher detail textures would take even longer to come of the disc, and that&#8217;s already their big bottleneck.  <\/p>\n<p>Oops. Sorry Sony. Well, your hardware is more expensive, you came to the market late, and fewer people want to develop on it, but at least you have all that extra storage space! I mean, nobody can be bothered to <em>fill<\/em> that space because games are already too damn expensive as it is, but it&#8217;s there, right? <\/p>\n<p>Again, I&#8217;m hard on Sony because this console generation should have been theirs. The PS2 is probably the greatest console ever made (going by longevity, quality, and library size) and a proper follow-up would have been enough to continue their domination.  But they tried to win by cock-blocking their competition, instead of trying to release a superior product. The result was bad for everyone. <\/p>\n<p>(Aside: We really need a less <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cock_blocked\">ribald<\/a> idiom for &#8220;cock-blocking&#8221;: To frustrate or hinder a rival, even to one&#8217;s own disadvantage.  To childishly destroy to prevent the success of another out of envy or spite. A kind of griefing. I know English is a second language for some of you, so I&#8217;ll ask: Do any other languages have one we can <del datetime=\"2011-08-10T07:39:04+00:00\">steal<\/del> borrow?) <\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=54m10s\">54:10<\/a><\/h3>\n<p>Carmack is talking about &#8220;static software analysis tools&#8221;.  That&#8217;s a program that looks at your source code, analyzes it, and lets you know about possible dangers, inefficiencies, or bad practices. Just recently I was messing with <a href=\"http:\/\/sourceforge.net\/apps\/mediawiki\/cppcheck\/index.php?title=Main_Page\">cppcheck<\/a>, which was suggested by reader Kdansky.  This is a free, open-source version of the stuff Carmack is talking about.  It&#8217;s actually kind of irritating to use, like having the world&#8217;s most pedantic nitpicker go over your code and say the same thing 11 dozen times.  But it&#8217;s also good for you, for all the reasons Carmack mentions.<\/p>\n<p>People praise Carmack and give credit for his stable code to his high intelligence, and I&#8217;m sure that factors into it. But I&#8217;m sure there are a handful of other coders in the industry with IQ&#8217;s in the same ballpark. Geniuses aren&#8217;t <em>that<\/em> rare.  No, I think the big reason his code is so excellent is simply because he <em>cares<\/em>.  Other developers have the ability to make stable, efficient, maintainable game engines, but they need to have a passion for it.  It&#8217;s the sort of &#8220;are you the sort of person who will vacuum behind the couch&#8221; (metaphorically speaking) or would you rather move on from vacuuming to do the &#8220;fun&#8221; stuff?<\/p>\n<p>I suppose it also helps that Carmack has a great deal of political power in the company, which gives him the muscle to keep games in development until he&#8217;s happy with the technology, not until some non-gaming manager decides, &#8220;Bah. Close enough. Let&#8217;s release it.&#8221;  This passion for quality has given them great financial success, which in turn allowed them to continue to spend the time needed to build well-engineered games. <\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=57m00s\">57:00<\/a><\/h3>\n<p>I always thought I was only attached to Microsoft Visual Studio because it was the programming environment I&#8217;d used the most, but as I&#8217;ve been learning over the past year, Microsoft really does make outstanding development tools.  Their dev tools are very different from their other consumer-level software like word processing, video editing, media playing, and operating systems. In sixteen years of use, I&#8217;ve never had Visual Studio crash on its own, I&#8217;ve never had my project files corrupted, and I&#8217;ve never had it give me baffling or incorrect error messages*. I doubt anyone using <a href=\"?p=11809\">Microsoft Word<\/a> for the same length of time could make a similar claim. Sadly, I&#8217;m using the <a href=\"http:\/\/www.microsoft.com\/visualstudio\/en-us\/products\/2010-editions\/express\">Hippie Freeloader edition<\/a> of Visual Studio, so I don&#8217;t have access to the Microsoft tools he&#8217;s talking about.   <\/p>\n<p>* The compiler itself gives mysterious error messages all the time, but that&#8217;s more an issue with C++ than with Microsoft. I don&#8217;t think MS is uniquely bad in this regard.<\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=1h01m10s\">1:01:10<\/a><\/h3>\n<p>Carmack is talking about a particular kind of bug that creeps into software, particularly 3D games. It works like this.  Say you&#8217;ve got a few lines of code for moving the player around:<\/p>\n<pre lang=\"c\" line=\"1\">new_position.x = player_position.x + movement.x;\r\nnew_position.y = player_position.y + movement.y;\r\nnew_position.z = player_position.z + movement.z;<\/pre>\n<p>Most programmers will simply type the first line, then copy &#038; paste it twice, changing the .x bits to .y and .z.  I once had a boss who passed along some wisdom from one of his instructors in college, &#8220;Most software bugs come from copy &#038; pasting code.&#8221;  It sounded strange at the time, but over the years I&#8217;ve come to see how true it is.  In the above example, the math involved is simple enough that you&#8217;re unlikely to make a blunder, but in a larger and more complex operation the odds of forgetting to change an .x or of transposing a .y and a .z increase.<\/p>\n<p>The problem with copy-paste code is that it is, by its very nature, code that already compiles. If I accidentally fat-finger type &#8220;neq_position&#8221; instead of &#8220;new_position&#8221;, it won&#8217;t compile and I&#8217;ll fix the problem right away.  But by copying selections of working code you can omit error checking, leave variables unchanged, accidentally perpetrate variable name collisions (where the same variable is used to two totally different things) or leave out proper memory management steps &#8211; all of which are things you&#8217;re unlikely to do if you&#8217;re forced to type out each line.  <\/p>\n<p>I don&#8217;t think the solution is to simply never copy &#038; paste code.  I think the solution is to recognize how many bugs arise from bad copy-paste, and to realize you&#8217;re doing something dangerous.  A healthy sense of paranoia can probably help you to catch a lot of blunders before you move on, leaving a landmine for your future self. <\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=1h04m40s\">1:04:40<\/a><\/h3>\n<p>Talking about game crashes, he mentions a hypothetical programmer encountering a situation, &#8220;Oh, but I didn&#8217;t expect that we would be changing weapons while falling to my death while being crushed by a vehicle that&#8217;s targeting me.&#8221;<\/p>\n<p>He was using it as an example, but I&#8217;ve often found that movement code can be so much more complex that you would normally expect.  Yes, the deep bowels of the engine can have areas of terrifying <em>mathematical<\/em> complexity, but most of it is fairly linear.  Player movement is highly <em>conditional<\/em>. <\/p>\n<p>Hypothetical example:<\/p>\n<p>The jump button makes you jump.  Unless you&#8217;re falling, or recovering from a fall of sufficient height to inflict damage. But if you&#8217;re running, then the jump button needs to delay a step, or wait for a button release so you can charge the jump. Except if you&#8217;re sliding down a slope, in which case it needs to be immediate, unless you&#8217;re not quite up to speed and you&#8217;ve only slid a few feet. But if you&#8217;re in the process of charging a jump and a situation arises where you would no longer be able to perform a jump such as sliding or encountering an edge, then the jump should begin right away or the controls will feel &#8220;unresponsive&#8221; to the player. Although, this immediate jump shouldn&#8217;t be allowed if the player has just sustained splash damage, since that means an enemy is trying to knock them off the ledge, and the player shouldn&#8217;t be able to exploit around that by charging a jump just before impact. However, the jump (if allowed, and not-charged) needs to be reduced in height when the player is actively carrying one of the &#8220;heavy&#8221; class weapons. If the jump takes place during a weapon-switch, the switch should complete instantly to avoid animation problems, but the player should have a cooldown placed on their weapon to prevent them from using it until the point where the weapon-switch animation would have completed. Also, if swimming in water deeper than waist-height, the jump button should be used to simply &#8220;swim up&#8221;, and if swimming up at the edge of a deep pool of water, the player should be allowed a jump of double height so they can leap up onto dry land&#8230;<\/p>\n<p>GAH! Now we&#8217;ve got two pages of code to handle ONE BUTTON. The indentation on that block of code is going to be <em>insane<\/em>. Input and movement code gets like this, and a huge tangle of interfacing conditions can often be far more daunting than a big &#8216;ol page of math. <\/p>\n<p>Worse, it&#8217;s a devil of a problem to actually <em>test<\/em> all of this stuff. <\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=1h08m48s\">1:08:48<\/a><\/h3>\n<p>&#8220;What I want to be working towards is a case where we can say, the game cannot&#8230; uh&#8230; cannot have an exception.&#8221;  I&#8217;ll bet the reason that he faltered there is that he was deciding if he wanted to use the word &#8220;exception&#8221;, or the more colloquial, non-techie term &#8220;crash&#8221;.  The two are not quite the same thing, and when discussing complex subjects like this there&#8217;s always the question of whether you want to be precise (because your fellow programmers love to correct you) or if you want to be understood by the masses. (Because most of them have no idea what an exception is.)<\/p>\n<p>What he&#8217;s proposing is a lofty goal. He wants to take Rage &#8211; the biggest id Software project to date, which involves many programmers and millions of lines of code &#8211; and make it <em>unbreakable<\/em>.  There may be bugs.  Maybe switching weapons, while reloading, while falling, while picking up a new weapon on the way down, will still lead to some strange behavior.  But it shouldn&#8217;t ever crash, lockup, or become corrupted in such a way that the program needs to be restarted.  <\/p>\n<p>Again, I <em>really<\/em> hope the id Software technology and culture can rub off on Bethesda.  It would mean nothing but good things for the rest of us.<\/p>\n<h3><a href=\"http:\/\/www.youtube.com\/watch?v=4zgYG-_ha28#t=1h23m55s\">1:23:55<\/a><\/h3>\n<p>&#8220;The Doom 3 source code will be released this year.&#8221; <\/p>\n<p>I&#8217;ve been waiting for this for a long time.  When Doom 3 was new, I really thought the unified lighting would open up this new world of procedural (or at least dynamically generated) games. No more building fixed light maps in a lengthy compile. I played around with the editor when it first came out. I&#8217;d wanted to make something like System Shock 2 gameplay with randomized layouts, but I found I didn&#8217;t have the fine-grain control I needed to do a real proof-of-concept. I decided to shelve the project and revisit it when the Doom 3 source went public.  (I didn&#8217;t realize how long it would take.  I suspect Rage&#8217;s lengthy development delayed the release of the source.) <\/p>\n<p>Sadly, now that it&#8217;s coming out I don&#8217;t have time to do anything with it. Between the book, <a href=\"?p=12123\">Project Frontier<\/a>, this website, and some of the other contract work I&#8217;m doing, the hours just aren&#8217;t there. Hopefully someone else will step in and make it happen. I&#8217;m sure I can&#8217;t be the only person with something like this in mind. It should be easier now than it was in 2005, since you don&#8217;t need to be nearly as picky about overdraw.  There are lots of CPU and GPU cycles to blow on un-optimized level geometry.<\/p>\n<h3><\/h3>\n<p>And we come to the end. I tried to make that as accessible as possible. I apologize if I got too jargon-heavy there at the end. Hopefully you were able to enjoy his presentation at least a fraction as much as I did.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You should know the drill by now. Movie first, followed by my response with links to the part of the speech in question. Link (YouTube) Please, please, would someone from Quakecon log in to YouTube and CHANGE THE THUMBNAIL FOR THIS MOVIE? Thank you. Geeze. 37:15 &#8220;Every game has taken longer than the one before, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[],"class_list":["post-12574","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/12574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12574"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/12574\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}