{"id":21026,"date":"2013-09-11T04:41:41","date_gmt":"2013-09-11T09:41:41","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=21026"},"modified":"2015-07-01T03:45:37","modified_gmt":"2015-07-01T08:45:37","slug":"project-good-robot-12-feedback-channels","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=21026","title":{"rendered":"Project Good Robot 12: Feedback Channels"},"content":{"rendered":"<p>Games are a young medium, and we&#8217;re still inventing (or appropriating) nomenclature for it. Ludonarrative Dissonance, Kinesthetics, skinner box, gamification, consolification, boss fight, quicktime event, RPG, difficulty curve, level scaling, <acronym title=\"Heal Over Time\">HOT<\/acronym>s and <acronym title=\"Damage Over Time\">DOT<\/acronym>s, raid, crowd control, pay-to-win, force feedback. Twenty years ago these terms either didn&#8217;t exist, or they meant something else to the average person. Some of these terms came from the audience, and some of them came from game designers, but they all arose out of a need to talk about a thing that didn&#8217;t have a name yet. <\/p>\n<p>One concept I&#8217;ve needed a word for is the way games use multiple audio \/ visual cues to let you know that a thing happened. The term I&#8217;ve settled into was &#8220;feedback channels&#8221;. But lots of people have run into this concept long before I showed up, and they already had their own terms.  These two guys call it &#8220;juice&#8221; or making a game &#8220;juicy&#8221;:<\/p>\n<p><!--more--><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\/Fy0aCDmgnxg\" frameborder=\"0\" allowfullscreen class=\"embed\"><\/iframe><br\/><small><a href='http:\/\/www.youtube.com\/watch?v=Fy0aCDmgnxg'>Link (YouTube)<\/a><\/small><\/td><\/tr><\/table><\/p>\n<p>Actually, &#8220;Feedback Channels&#8221; and &#8220;Juice&#8221; might not be the exact same concept. I think of it in terms of making specific events in the game have as many possible routes of player feedback as possible, while these guys are more talking about making the game as a whole have more stimulation. But it&#8217;s very nearly the same idea, and I&#8217;m sure there are a hundred other developers with their own name for the concept. <\/p>\n<p>An example:<\/p>\n<p><table   class=\"\" cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/gr12_borderlands2.jpg' class='insetimage'   alt='gr12_borderlands2.jpg' title='gr12_borderlands2.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>Let&#8217;s say you&#8217;re playing some kind of shootin&#8217; game of the first-person variety.  You pull the trigger to make the gun do what it does. How many different ways does the game let you know what happened?<\/p>\n<ol>\n<li>Boom! The gun makes a gunshot sound.\n<li>The player&#8217;s view is kicked slightly upward to simulate recoil.\n<li>The weapon itself jerks backwards\/upwards to further sell the notion of recoil.\n<li>Perhaps the mechanism of the gun moves somehow. The barrel spins, the character&#8217;s hands pump the shotgun, a bolt slides, etc. Some sort of animation to show that this is a machine with moving parts.\n<li>The spent round or shell casing is ejected from the firearm.\n<li>There&#8217;s a muzzle flash \/ puff of particle smoke from the barrel.\n<li>If the bullet hits a flat surface, then the game slaps a bullet decal (a picture of a bullet hole) onto it.\n<li>The struck object will give off a puff of particles depending on what it&#8217;s made of: Concrete dust, splinters, blood, etc.\n<li>If the bullet hits a physics object, the object will be knocked around by the force of the impact.  It might shatter entirely.\n<li>If the bullet hits an enemy, they will usually jerk backwards, flinch, etc.\n<li>There&#8217;s a sound from whatever was hit: Shattering sound, a metal ping, cry of pain, etc.\n<li>The bullet impact makes a sound, although it&#8217;s usually lost in the roar of the gunshot.\n<\/ol>\n<p>The game has about a dozen or so different channels it uses to convey the action.  And keep in mind we&#8217;re mostly just talking about cosmetic stuff. This is in contrast to the mechanical stuff like your ammo count going down, the enemy hitpoints dropping, your aiming reticle expanding as you lose accuracy, etc. (The view kick is an example of an effect that falls into both categories.) You could remove all of these effects aside from the view kick <em>and the game would play exactly the same<\/em>. It would be mechanically identical, but it would feel incredibly numb, muted, or distant. When people say the guns in a game feel &#8220;weak&#8221;, I suspect they&#8217;re often not talking about mechanical stopping power but about the lack of key feedback channels. <\/p>\n<p>Now think about how many other actions there are and all the feedback channels we have for them.  How many cosmetic ways does a game have to let you know you&#8217;ve been shot? That an explosion happened nearby? That you&#8217;ve hit the ground after falling or jumping? That you&#8217;re running? <\/p>\n<p>One of the things I wanted to mess around with in this project was coming up with as many feedback channels as I could. <\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/gr12_shoot2.gif' class='insetimage' width='600' alt='Note that the game runs at 60fps and this animation runs at 10. A lot is lost in the transition.' title='Note that the game runs at 60fps and this animation runs at 10. A lot is lost in the transition.'\/><\/td><\/tr><\/table><\/p>\n<p>This is an interesting exercise.  It&#8217;s also pretty rewarding from a code standpoint. Adding cosmetic systems is easy because they don&#8217;t have a lot of interplay. I can make the game rewarding and visually interesting by adding effects to the scene without worrying that I&#8217;m going to break the AI, mess up the controls, or unbalance the game. <\/p>\n<p>When I kill a robot I&#8217;ve got:<\/p>\n<ol>\n<li>It&#8217;s hard to see in the animation because the bullets I&#8217;m using are practically particle clouds themselves, but when you kill a robot a cluster of sparks fly out the back of the robot as if you were blowing its robo-brains out.\n<li>The lights on the robot go out, turning it into a pure black silhouette.\n<li>The robot falls.\n<li>When it hits the ground it breaks into a cluster of debris particles. (Which also doesn&#8217;t show up in the animation above. Did I break that without noticing, or is it just lost in this low-framerate animation?)\n<li>The robot might have a bit of spin on it, like a billiard ball. If you&#8217;re to the left of the robot and your shots grazed the top of its head then it will spin away from you. (Clockwise.) If you hit its base then it will tumble counter-clockwise.  If you hit it center-mass then it falls straight down with no spin.\n<li>While falling, it leaves a trail of black smoke.\n<li>It makes some kind of death sound when you kill it, then an exploding sound when it hits the ground.\n<\/ol>\n<p>#5 was interesting to implement. It seemed simple in my head.  I mean, I just look at the position of the impact and use it to create spin:<\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/gr12_hit1.jpg' class='insetimage' width='600' alt='Zonk.' title='Zonk.'\/><\/td><\/tr><\/table><\/p>\n<p>But hang on.  Hitting the robot like this should create a clockwise spin.  But hitting in the exact same spot from above should produce counter-clockwise spin. That means that&#8230; um&#8230;<\/p>\n<p>I spend a couple of minutes staring at the screen. This is a simple problem. Or at least, I&#8217;m pretty sure it is. I&#8217;m willing to bet it&#8217;s not more than a couple of lines of code. But I can&#8217;t picture it. I know intuitively which way an object should spin based on the point of impact, but I don&#8217;t know how to express it.  Like, if you asked me to explain why an object spins a particular way I&#8217;d result to pointing at the impact in illustrative ways. That doesn&#8217;t translate into c++.<\/p>\n<p>Deep breath.<\/p>\n<p>Okay, we&#8217;ve got at least two important bits of information. There&#8217;s the angle of the impact, and there&#8217;s the angle from the point impact to the center of gravity. (Which -in our hilariously primitive little 2D world &#8211; is just the center of the robot&#8217;s rectangle.) <\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/gr12_hit2.jpg' class='insetimage' width='600' alt='Ummmm. Wait. It&#8217;s just like&#8230; You&#8217;ve gotta take the angle of&#8230; something. And calculate&#8230; something else?' title='Ummmm. Wait. It&#8217;s just like&#8230; You&#8217;ve gotta take the angle of&#8230; something. And calculate&#8230; something else?'\/><\/td><\/tr><\/table><\/p>\n<p>I don&#8217;t know how to put these pieces of information to use. As a way of visualizing the problem I just take the difference between the two and&#8230; what? I guess I&#8217;ll just take that number and apply it to the spin of the robot when it dies.  Then I&#8217;ll shoot a few down and see if that helps me picture the problem.<\/p>\n<p>(Minutes later.)<\/p>\n<p>Oh. That was actually the solution. Take the difference and apply it as spin. It works perfectly.<\/p>\n<p>This is actually kind of disappointing. It&#8217;s like that feeling when you&#8217;re just screwing around in Portal because you&#8217;re stuck and you end up accidentally solving the puzzle.  You&#8217;re robbed of that delightful &#8220;Eureka!&#8221; moment. <\/p>\n<p>Ah well. It works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Games are a young medium, and we&#8217;re still inventing (or appropriating) nomenclature for it. Ludonarrative Dissonance, Kinesthetics, skinner box, gamification, consolification, boss fight, quicktime event, RPG, difficulty curve, level scaling, HOTs and DOTs, raid, crowd control, pay-to-win, force feedback. Twenty years ago these terms either didn&#8217;t exist, or they meant something else to the average [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[498],"tags":[],"class_list":["post-21026","post","type-post","status-publish","format-standard","hentry","category-good-robot"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/21026","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=21026"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/21026\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}