{"id":22502,"date":"2014-03-13T14:49:17","date_gmt":"2014-03-13T19:49:17","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=22502"},"modified":"2014-03-13T22:25:22","modified_gmt":"2014-03-14T03:25:22","slug":"experimenting-with-threes-part-2","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=22502","title":{"rendered":"Experimenting with Threes! Part 2"},"content":{"rendered":"<p>On <a href=\"?p=22455\" title=\"Experimenting with Threes!\">Tuesday<\/a> I talked about messing around with the game <a href=\"http:\/\/threesjs.com\/\">Threes!<\/a> and making variants of the established gameplay. If you didn&#8217;t read that entry, then the short version is this: I felt the game was too random, and I experimented with ways of making outcomes more related to player skill and less about the benevolence of the random number generator. I ran some simulations but didn&#8217;t come to any interesting conclusions. Then yesterday I ran a few more, and now I think I have some useful results. But first, let&#8217;s get caught up:<\/p>\n<p>It turns out that I wasn&#8217;t the only person to think of moving the game to powers of two. Someone made <a href=\"http:\/\/ov3y.github.io\/2048-AI\/\">2048<\/a>, which is also built around joining powers of two. <\/p>\n<p>One of the points I made was that there were a lot of variants of the game that you could make. Threes! is a charming little game, but the given mechanics could be altered to make dozens of different games. What if tiles moved as far as possible, instead of just one space? How do you handle multiple combines in a single move? Where are new tiles added? How far in advance should the player see upcoming tiles? What if the goal was reversed, so you wanted to fill the board in as few moves as possible? What if we added powerups or space-clearing combos, like we see in <a href=\"http:\/\/www.escapistmagazine.com\/articles\/view\/comicsandcosplay\/comics\/stolen-pixels\/8104-Stolen-Pixels-226-Chime-Chime-Chime\">Chime<\/a>, Bejewled, or <a href=\"http:\/\/en.wikipedia.org\/wiki\/Lumines\">Lumines<\/a>? What happens if we make the board larger? What if the player is told to achieve a win state, rather than delaying an inevitable lose state?<span class='snote' title='1'>Roughly, instead of playing to the highest score possible, your goal is to make a single tile worth x points.<\/span> What if we give the user an undo button? <\/p>\n<p>And so on.<\/p>\n<p>Basically, we could make a hundred different games here. Some will be okay, some might be great, and many will be terrible, random, or boring. A big part of game design (in any genre) is in being able to figure out which mechanics will lead to stimulating play. So how do we find the right design?<\/p>\n<p><!--more-->Some people pointed out that I was probably focusing too much on randomness in my last post. We shouldn&#8217;t be worried about how much the outcomes diverge from each other, but how much difference we see between high-skill and low-skill outcomes. It&#8217;s fine if I score 300 one game and 7,000 another, as long as someone randomly mashing keys doesn&#8217;t best my score, and I don&#8217;t score better than someone with far more skill.<\/p>\n<p>So for the purposes of this test, I&#8217;ve written five AI players:<\/p>\n<ol>\n<li><strong>Circle:<\/strong> An idiot AI that will move up, right, down, left, over and over, until the game ends.\n<li><strong>Step:<\/strong> Another idiot AI that will move right, up, right, up, right, up, over and over, until the game ends. (To avoid getting stuck, it will move left if right is blocked, and down if up is blocked. But it makes no effort to maximize score.)\n<li><strong>Basic:<\/strong> Our first &#8220;real&#8221; AI. It looks at the possible outcomes of the next move and chooses the move that clears the most screen space and puts the most combine-able tiles beside each other.\n<li><strong>Improved:<\/strong> Same as above, but the AI looks two moves into the future instead of just one. (So, it will make a less ideal move now if it will lead to a really great outcome the turn after.)\n<li><strong>Advanced:<\/strong> Same as above, but it looks a total of 4 moves into the future.\n<\/ol>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/twon10.jpg' class='insetimage' width='600' alt='twon10.jpg' title='twon10.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>This AI is pretty rudimentary, but I didn&#8217;t want to spend all dang day coding and testing AI. This should be good enough for the purposes of our test.<\/p>\n<p>So now let&#8217;s do a run of games using the original <em>Threes!<\/em> rule set. You need to combine 1 and 2 to make three. Tiles move one space. You can only see 1 upcoming tile. We&#8217;ll have each of the AIs play ten games. Note that they will play the exact same ten games, with the random number generator offering the same<span class='snote' title='2'>Since new tiles are based on what&#8217;s already on the board, there will still be differences. If A has a 16 on the board in turn ten, then they might get a 16 tile. If B just has two 8 tiles and hasn&#8217;t joined them, then B might get some other tile on turn 10. Other than this, both players should get the same series of tiles.<\/span> tiles. <\/p>\n<p>The result:<\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/twon8.jpg' class='insetimage' width='600' alt='A comparison of the ten games. The Y axis is the number of moves the AI lasted before losing the game. The X axis is the game number in our series of 10.' title='A comparison of the ten games. The Y axis is the number of moves the AI lasted before losing the game. The X axis is the game number in our series of 10.'\/><\/td><\/tr><tr><td class='insetcaption'>A comparison of the ten games. The Y axis is the number of moves the AI lasted before losing the game. The X axis is the game number in our series of 10.<\/td><\/tr><\/table><\/p>\n<p>As expected, the Circle and Step are at the bottom, and one doesn&#8217;t really beat the other in a meaningful way. But as many players have noted, it&#8217;s often quite possible for random play to best intelligent play. There&#8217;s a lot of overlap between the random AI and the &#8220;good&#8221; AI.  Sure, good AI beats dumb AI on average, but this chart shows the phenomena players have described: Play one game as best you can, then beat that score by mashing the keys randomly. <\/p>\n<p>(I should note that the improved and advanced AI are at a disadvantage here. They&#8217;re attempting to look 2 and 4 moves into the future. However, according to the original rules you can&#8217;t see beyond the next piece. So they&#8217;re&#8230; &#8220;guessing&#8221;. This might result in an AI that makes moves in preparation of pieces that never show up. I&#8217;ll leave it to you to decide if their numbers are useful here.)<\/p>\n<p>So now lets switch to this alternate rule set: <\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/twon11.jpg' class='insetimage' width='600' alt='twon11.jpg' title='twon11.jpg'\/><\/td><\/tr><\/table><\/p>\n<ol>\n<li>Players can see the next 4 incoming pieces, as well as see where they will appear.\n<li>Instead of needing blue and red tiles to make your first 3, players can simply join like-with-like.\n<li>When sliding tiles, they will slide as far as they are able, instead of moving 1 space.\n<\/ol>\n<p>The result:<\/p>\n<p><table width='600'  cellpadding='0' cellspacing='0' border='0' align='center'><tr><td><img src='https:\/\/www.shamusyoung.com\/twentysidedtale\/images\/twon9.jpg' class='insetimage' width='600' alt='twon9.jpg' title='twon9.jpg'\/><\/td><\/tr><\/table><\/p>\n<p>I think this paints a picture of a much better game. We can see a nice gap between random play and deliberate play. (Although I&#8217;d love to know what happened to the Basic AI in game 3<span class='snote' title='3'>I could add a way to step through the time-lapse games a bit at a time and painstakingly analyze the game turn-by-turn, but&#8230; I&#8217;m not going to.<\/span>.) Advanced AI always beats the lower AI, and improved AI beat basic AI 8 out of 10 games. The really big games belonged to the Advanced AI, and the Random AIs were shoved down to the bottom of the chart where they belong.<\/p>\n<p>I think this makes for a more rewarding game. This is one of the reasons people love Dark Souls: You can get better at it. On your first play-though you&#8217;ll die a ton of times. On subsequent play-throughs you&#8217;ll die less and less. Stick with it, and you can even become good enough at the game to <a href=\"https:\/\/www.youtube.com\/watch?v=ImMOdTxtf-s\">trivialize it<\/a>. There&#8217;s a nice, large delta between the performance of a newbie and a veteran, which isn&#8217;t usually the case in a AAA game designed to welcome players of all levels. (I don&#8217;t play Dark Souls. I can appreciate the skill-based gameplay, but the journey would be too frustrating for me. High-cost death makes me miserable<span class='snote' title='4'>While learning. I actually don&#8217;t mind adding permadeath once I&#8217;ve gotten good at a game, but punishing death while learning completely enrages me.<\/span> and angry and I&#8217;d likely end up smashing stuff while climbing that learning curve.)<\/p>\n<p>The point is, players often enjoy mastering something and improving their performance over time, regardless of whether the skill is based on logic (Threes!) skill (Mario) or knowledge (Legend of Zelda) so that their victory feels &#8220;earned&#8221;. They just want a game where they can objectively improve. Going by this criteria, <em>2048<\/em> is a better game than <em>Threes!<\/em>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Tuesday I talked about messing around with the game Threes! and making variants of the established gameplay. If you didn&#8217;t read that entry, then the short version is this: I felt the game was too random, and I experimented with ways of making outcomes more related to player skill and less about the benevolence [&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":[343],"class_list":["post-22502","post","type-post","status-publish","format-standard","hentry","category-programming","tag-threes"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/22502","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=22502"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/22502\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}