{"id":20555,"date":"2013-08-05T08:32:42","date_gmt":"2013-08-05T13:32:42","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=20555"},"modified":"2017-01-09T03:24:39","modified_gmt":"2017-01-09T08:24:39","slug":"quakecon-keynote-2013-annotated-part-2","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=20555","title":{"rendered":"Quakecon Keynote 2013 Annotated: Part 2"},"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>My analysis and annotation of Quakecon 2013 keynote continues. As before, I want to caution you that I&#8217;m sometimes out of my depth as much as anyone. My graphics knowledge is years out of date by now, and even when it was springtime fresh I never got as close to the hardware as Carmack does. I&#8217;ll probably make small errors or omissions in my notes. <\/p>\n<p>Times are approximate.<\/p>\n<p><!--more--><strong>11:30 &#8220;I think the Kinect has some fundamental limitations.&#8221;<\/strong><\/p>\n<p>When he mentions &#8220;latency issues&#8221; on the Kinect he&#8217;s talking about the time between the user taking some action and the point where the game knows about it. The Kinect has to analyze incoming images, identify the human being(s), extrapolate what position their body is in, and compare that to the last several frames to understand how the user is moving. That sort of image processing takes time. <a href=\"http:\/\/www.slashgear.com\/microsoft-next-gen-kinect-sensor-to-support-1080p-usb-3-0-and-60ms-latency-20270289\/\">The Kinect 2.0 supposedly will have a 60ms latency<\/a> while the original Kinect hd a latency of 90ms. For reference, I think your typical bargain wireless mouse has a latency time of about 20ms or so, meaning that even the new and improved Kinect is still three time slower than the slowest mice. <\/p>\n<p>But this strikes me as being a bit beside the point. The input lag is pretty bad in a technical sense, but it&#8217;s not the real problem in my mind. The gesture itself is going to be the real slowdown.  You can&#8217;t just wiggle a finger and have the Kinect understand what you want. You need to make broad, obvious body motions.  Those take a long time to perform.  Compare the time to wave your arm over your head compared to the time it takes to make a little micro-movement with your fingertips on a mouse. We can haggle over the 60ms input lag of the Kinect, but the real problem is probably on the scale of 200ms to 500ms.  And that&#8217;s assuming the sensor registers every gesture perfectly, which it doesn&#8217;t. <\/p>\n<p>This doesn&#8217;t mean the Kinect is worthless, but it does mean you&#8217;re limited as to what sorts of games to can use it for.  It&#8217;s a major contributor to the Xbox One price tag, and it&#8217;s just not all that useful as a generalized gaming peripheral. It&#8217;s like having every console ship with a Guitar Hero instrument.  Nice, if you&#8217;re into it. But not everyone is into it even though everyone pays for it. (And those people might just get the $100 cheaper PS4.)<\/p>\n<p><strong>23:00 &#8220;It has a lot of the messiness of Linux [&#8230;] but there&#8217;s also some of the magic of it.&#8221;<\/strong><\/p>\n<p>He&#8217;s talking about developing for Android phones, and how the system has Linux underneath it. As always, Linux is a double-edge sword. In this specific case, he&#8217;s talking about having the source code handy when things go wrong.<\/p>\n<p>How it works is this:<\/p>\n<p>There are many layers of software between the game you&#8217;re writing and the actual hardware that runs it. If you want mouse input, you ask the operating system, the operating system asks the device driver, which gives you the state of the keyboard, the mouse, the graphics card, the sound system, or whatever else you need. And when I say &#8220;operating system&#8221;, keep in mind that the OS is probably a few levels deep, all by itself.<\/p>\n<p>So when something crashes or fails to work as documented, advertised, or expected, then hopefully the problem is there in your code. But on some occasions &#8211; particularly on young and fast-changing platforms like mobiles &#8211; the problem is on one of those layers below your program.  If you&#8217;re on a proprietary operating system like Windows, then you&#8217;re out of luck. You can&#8217;t &#8220;see&#8221; those lower levels.  They&#8217;re just blocks of machine code talking to other blocks of machine code. Maybe there&#8217;s a bug in your code. Maybe the layer below you is working as designed, but the documentation is wrong. Maybe the layer below you has a bug in it that nobody&#8217;s run into before. That&#8217;s normally <strong>extremely unlikely<\/strong> if you&#8217;re doing something commonplace.  But if you&#8217;re doing something outlandish &#8211; like cutting-edge game development that pushes the device to its limits &#8211; then you may run into problems and situations that the designers never anticipated. <\/p>\n<p>But on Linux, you&#8217;ve got the source code. When a problem happens you can &#8220;step into&#8221; someone else&#8217;s code.  &#8220;Step into&#8221; here being programmer talk for when your development tools show you the exact line of code that&#8217;s being run right now, and allowing you to run the program a line at a time. If something happens in one of those lower layers, then you can see the code that goes with them and understand what&#8217;s really going on. You can see the difference between a bug on your end, bad documentation, or a bug on their end.<\/p>\n<p><strong>25:00 &#8220;You can have a four millisecond difference in when you wind up waking up the next time.&#8221;<\/strong><\/p>\n<p>I&#8217;ve never done mobile development so I&#8217;m a little out of my area of knowledge here, but what I assume he&#8217;s talking about is calling <code>Sleep ()<\/code> or the platform equivalent. If you&#8217;re developing a videogame designed to run at 30 frames per second, then you have 33 milliseconds per frame to work with. That means 33ms to process user input, make sound effects, update the state of the game, and draw the entire scene. If you take more than 33ms then you&#8217;ll have dropped frames, which makes the game feel stutter-y and uneven. (Usually only a concern with fast-paced games.) <\/p>\n<p>But if you happen to take less than 33ms, then what do you do with the leftover time? If you finish everything and you still have 10ms left over, you don&#8217;t want to begin a new frame. This can lead to uneven framerates in the other direction, and can also needlessly devour CPU cycles drawing frames that the user will never see. (Which would also be a waste of battery life on a handheld, but I don&#8217;t know if it&#8217;s enough to matter.) So what you do is call <code>Sleep (n)<\/code>, where <em>n<\/em> in the number of milliseconds you want your program to be dormant. You&#8217;re telling the operating system that your program should stop running, and that it should start it again in <em>n<\/em> milliseconds.<\/p>\n<p>The problem he&#8217;s having is that sometimes the OS wakes the program up late.  You tell the OS to wake you up in 3ms, and it doesn&#8217;t actually get around to resuming the game until 7ms later, making you 4ms late in starting the next frame. If you&#8217;re trying to run a game at 30fps, that&#8217;s really annoying. If you&#8217;re hardcore and want to run at 60fps, that&#8217;s downright scary. That&#8217;s like setting your alarm to go off at 6am, knowing that it could go off anywhere between 6am and noon. <\/p>\n<p>A few seconds later Carmack mentions that this problem is probably not going to be solved by an intrepid programmer crawling down into the guts of the operating system and finding out why the OS is so sloppy about this.  The problem will likely be solved by hardware improvements that just absorb the inefficiencies causing this. <\/p>\n<p><strong>29:00 &#8220;We are fundamentally creativity-bound.&#8221;<\/strong><\/p>\n<p>To be clear, by &#8220;creativity bound&#8221; I&#8217;m sure he&#8217;s saying &#8220;we are bound by creativity&#8221; and not &#8220;we are bound FOR creativity&#8221;. The intended meaning might be missed by non-programmers because it&#8217;s kind of a programmer thing to talk in terms of being &#8220;CPU bound&#8221;, &#8220;pipeline bound&#8221;, or &#8220;throughput bound&#8221; when describing which part of a system is limiting the performance of the whole. <\/p>\n<p>Here he&#8217;s saying that further visual improvements will be driven more by what artists can do than by how many polygons we can draw. I also want to point out that <a href=\"http:\/\/www.youtube.com\/watch?v=BiQCz2NjPR8#t=9m5s\">I said the same thing before<\/a>, and it feels pretty good to have my assertion supported by Carmack. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Link (YouTube) My analysis and annotation of Quakecon 2013 keynote continues. As before, I want to caution you that I&#8217;m sometimes out of my depth as much as anyone. My graphics knowledge is years out of date by now, and even when it was springtime fresh I never got as close to the hardware as [&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,304],"class_list":["post-20555","post","type-post","status-publish","format-standard","hentry","category-programming","tag-carmack","tag-quakcon"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/20555","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=20555"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/20555\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}