{"id":20614,"date":"2013-08-11T07:29:22","date_gmt":"2013-08-11T12:29:22","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=20614"},"modified":"2013-08-12T06:52:38","modified_gmt":"2013-08-12T11:52:38","slug":"quakecon-keynote-2013-annotated-part-4","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=20614","title":{"rendered":"Quakecon Keynote 2013 Annotated: Part 4"},"content":{"rendered":"<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\/Uooh0Y9fC_M\" frameborder=\"0\" allowfullscreen class=\"embed\"><\/iframe><br\/><small><a href='http:\/\/www.youtube.com\/watch?v=Uooh0Y9fC_M'>Link (YouTube)<\/a><\/small><\/td><\/tr><\/table><\/p>\n<p>As before: In the process of going through this I&#39;m bound to commit minor omissions, errors, misunderstandings, grammatical errors, or war crimes.<\/p>\n<p>Times are approximate.<\/p>\n<p><strong>41:00 &#8220;I don&#8217;t mind blocking for the 1.2 milliseconds it will take for this to come in from flash.&#8221;<\/strong><\/p>\n<p>Carmack is talking about the difficulty of loading resources while rendering.  This is mostly a problem with multi-threading.  <\/p>\n<p><!--more-->The idea is that your program has several independent threads. One is running the game itself. Another is pumping all the data to the sound card. Another is loading in geometry or textures. They all do their own thing and in an ideal world they wouldn&#8217;t interfere with each other. <\/p>\n<p>But what happens when some asset isn&#8217;t ready just yet? Like, it&#8217;s time to draw a rusty crashed alien spacecraft. Maybe you&#8217;re still missing the doorknob for the spaceship. Maybe you&#8217;re missing the texture for the &#8220;I brake for Strogg&#8221; bumper sticker. Whatever. It&#8217;s time to draw the scene, there&#8217;s something you need, and you don&#8217;t have it just yet. Maybe you&#8217;re waiting 1.2 milliseconds for the asset to arrive from flash memory. Or maybe you&#8217;re waiting for something in the neighborhood of 12 milliseconds to grab it from the hard drive. Or maybe you&#8217;re looking at a terrifyingly long wait of 100ms (a tenth of a second) for it to arrive from (shudder) optical media like a DVD.<\/p>\n<p>In this specific case, Carmack is probably just talking about the time it takes to move stuff <del datetime=\"2013-08-11T14:22:15+00:00\">around in<\/del> <em>in from<\/em> flash memory. He&#8217;s saying he wants rendering to STOP until the asset is in place, since the game can&#8217;t proceed without this asset. (For the sake of argument let&#8217;s say this thing is critical.) Instead of the game doing a painstaking inventory and making sure everything is ready BEFORE it begins drawing, it&#8217;s way easier if you just start drawing and stop again if something isn&#8217;t ready yet. <\/p>\n<p>Hardware vendors HATE this idea, since it makes their graphics hardware perform more slowly for things that aren&#8217;t their fault and are out of their control. <\/p>\n<p><strong>56:00 &#8220;CRT&#8217;s back in the old days had essentially no persistence.&#8221;<\/strong><\/p>\n<p>Some of you young folks might not remember the early 90&#8217;s laptops, which had ghastly persistence. Persistence is where it takes time for a pixel to stop shining once it&#8217;s no longer wanted. If you&#8217;re writing white text on a black background and you backspace to remove a letter D, how long does the after-image of the D linger onscreen? <\/p>\n<p>On a CRT (Cathode Ray Tube, those big heavy monitors that re quickly going extinct) the pixels would go dark instantly. On the LCD of a laptop in the early 90&#8217;s, it would linger for a long time. I don&#8217;t actually have the numbers, but it felt like a second or so. This was really strange when you would wave the mouse around the screen and it would leave this trail of after-images behind it. <\/p>\n<p>LCD&#8217;s have gotten much, much better, but they&#8217;re still not quite as crisply on\/off with their pixels as those old CRT&#8217;s were. Sure, they&#8217;re better just about everything else (weight, space, power usage, flat viewing surface, etc) but we did take on this persistence problem. You don&#8217;t really notice it very much during normal usage, but when <a href=\"http:\/\/www.oculusvr.com\/\">you&#8217;re wearing the screen on your face<\/a> I gather it becomes important.<\/p>\n<p><strong>59:00 &#8220;We update 60 times a second, like clockwork [&#8230;] and that&#8217;s why we have vertical tearing.&#8221;<\/strong><\/p>\n<p>He&#8217;s taking about this visual problem:<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/quakecon3.jpg' class='insetimage'   alt='Vertical tearing.  (Simulated.)' title='Vertical tearing.  (Simulated.)'\/><\/td><\/tr><tr><td class='insetcaption'>Vertical tearing.  (Simulated.)<\/td><\/tr><\/table><\/p>\n<p><strong>1:13:00 &#8220;Robustness first, then predictability, then performance.&#8221;<\/strong><\/p>\n<p>This is kind of a turning point for games. The reverse has been true for over two decades. An entire generation of programmers has risen in this world where you&#8217;re fighting for every CPU cycle. They would bend over backwards coming over with tricks to get the most graphical bang for their buck.  The code wasn&#8217;t pretty, but it was fast and that&#8217;s what counted. And if the code was ugly, who cared? You were going to throw most of it way in four years when technology changed and you needed a completely different set of hacks to make things work.<\/p>\n<p>And now we&#8217;re finally reaching that point where people are saying, &#8220;We&#8217;ve got plenty of power and we&#8217;ll probably still be using this code eight years from now. Let&#8217;s make sure the code is reusable, clean, easy to read, and properly annotated.&#8221;<\/p>\n<p>It will be very interesting to see this new mindset percolate throughout the industry and see how it changes our approach to making games.<\/p>\n<p><strong>1:15:00 &#8220;OpenGL won.&#8221;<\/strong><\/p>\n<p>I actually have no idea where the battle between the Big Two is at any given moment. You can render with OpenGL, or you can render with DirectX. Each of these libraries gives the intrepid programmer a way to talk to the graphics hardware and make it draw stuff. Which do you use? <\/p>\n<p>GL was first by a long way, and was designed by and for people who programmed in vanilla C. DirectX came along years later and was more of a C++ creature. There was a tug-of-war for years, but by the middle of the last decade I assumed that DX was winning mindshare based on the number of big-name engines that used it. <\/p>\n<p>Back in the 90&#8217;s I dabbled in both and I hated the way DirectX worked. There were more steps to do simple things and there was a lot more typing involved. I remember DX as having obnoxiously long variable types and for their documentation being unforgivably horrendous. I&#8217;m sure the latter got better, but I already knew my way around GL and I never saw any reason to make the switch. Today, almost 15 years later, I&#8217;m still using OpenGL. <\/p>\n<p><strong>1:18:00 The functional programming stuff.<\/strong><\/p>\n<p>This is a big topic and I know people are kind of eager to hear my thoughts on it.  The thing is, it might take me a while to do it justice. I have another programming series planned after I&#8217;m done with this Quakecon stuff. I&#8217;m writing a kinda-game thing and I might end up talking about this stuff in the process.  It doesn&#8217;t make sense for me to delay writing about my own code and while also spoiling what I&#8217;ll have to say, while also not giving the subject the attention it deserves.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Link (YouTube) As before: In the process of going through this I&#39;m bound to commit minor omissions, errors, misunderstandings, grammatical errors, or war crimes. Times are approximate. 41:00 &#8220;I don&#8217;t mind blocking for the 1.2 milliseconds it will take for this to come in from flash.&#8221; Carmack is talking about the difficulty of loading resources [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[66],"tags":[248,247],"class_list":["post-20614","post","type-post","status-publish","format-standard","hentry","category-programming","tag-carmack","tag-quakecon"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/20614","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=20614"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/20614\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}