<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ryan Williams on Medium]]></title>
        <description><![CDATA[Stories by Ryan Williams on Medium]]></description>
        <link>https://medium.com/@ryanjw?source=rss-6723b35cabfc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bdICGf-ERjkehCIyAITjig.jpeg</url>
            <title>Stories by Ryan Williams on Medium</title>
            <link>https://medium.com/@ryanjw?source=rss-6723b35cabfc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:56:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryanjw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unexpected gaps between 3D CSS elements in Chrome]]></title>
            <link>https://medium.com/@ryanjw/unexpected-gaps-between-3d-css-elements-in-chrome-9a2e2418ff76?source=rss-6723b35cabfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a2e2418ff76</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Ryan Williams]]></dc:creator>
            <pubDate>Tue, 17 Apr 2018 15:24:44 GMT</pubDate>
            <atom:updated>2018-04-23T20:01:18.592Z</atom:updated>
            <content:encoded><![CDATA[<h4>I’m working on a project which requires using CSS to position elements in a 3D space. Today, I discovered a bug that causes 3D elements to have little gaps between them in Chrome. Sigh — h<em>ere we go again.</em></h4><h3>Update (April 23rd, 2018)</h3><p>I discovered that instead of using an outline to combat this issue, it’s possible to use a negative margin. This achieves the same visual look but without the substantial frame rate hit. I’ve updated the post accordingly.</p><h3>Problem</h3><p>Essentially, I want to create what looks to be a single, flat surface but actually it’s comprised of numerous squares. Why on earth am I doing this? Well, that’s a story for another day.</p><p>To achieve this effect, I’ve implemented a CSS Grid Layout with boatloads of squares all given the same background, and then used transform to rotate them into an isometric perspective. This is what it looks like in Safari:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zd-_X9dHeEQ1POfO89TvEw.png" /><figcaption>Safari v11.1 (macOS)</figcaption></figure><p>Looks great! Just what I was looking for. But throw it into Chrome and we get this slightly less elegant outcome:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*evLIygzLwRVwEfz-Tjcf8g.png" /><figcaption>Chrome v65 (macOS)</figcaption></figure><p>Oh dear. Not only do all of my elements have gaps between them, the rendering is also inconsistent. In some cases the gaps are more pronounced, while in others they’re less so or missing altogether.</p><p>I’ve <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=833876&amp;can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&amp;groupby=&amp;sort=">reported this as a Chromium bug</a>, so hopefully we’ll see it rectified in an upcoming version of Chrome. The bad news is that it also happens in Safari when you zoom in, and who knows when that might be fixed. As for other browsers, I haven’t looked into it yet.</p><h3>Solution</h3><p>After a fair bit of messing around I’ve determined that the following properties combined can mask the issue and give us the perfectly smooth surface we’re looking for:</p><pre>backface-visibility: hidden;<br>margin: -1px;</pre><p>For whatever reason, setting backface-visibility to hidden both reduces the gap and makes it consistent. However, to get rid of it entirely we must make each box a bit larger than normal — so they slightly overlap—with a small negative margin.</p><p>Alternatively, you can use a small outline to achieve a similar effect without changing the dimensions of your elements, but for some reason this causes significant performance loss so I don’t recommend it unless it’s essential to not mess with the element size.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a2e2418ff76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving Donkey Kong Country’s Great DK Island Mystery]]></title>
            <link>https://medium.com/@ryanjw/solving-donkey-kong-countrys-great-dk-island-mystery-8b1d59c2d051?source=rss-6723b35cabfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b1d59c2d051</guid>
            <category><![CDATA[gaming]]></category>
            <category><![CDATA[donkey-kong]]></category>
            <category><![CDATA[nintendo]]></category>
            <category><![CDATA[videogames]]></category>
            <dc:creator><![CDATA[Ryan Williams]]></dc:creator>
            <pubDate>Tue, 06 Feb 2018 18:31:53 GMT</pubDate>
            <atom:updated>2018-02-06T22:24:50.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*50jGYCrrnwoZaEiIyFZzWw.png" /></figure><p>Ever since <em>Donkey Kong Country</em> was released over 20 years ago, a mystery has relentlessly gnawed away at its players’ minds: <strong>why are the chimney stacks that represent the factory world sticking out of the top of a temple?</strong></p><p>Having spent countless years investigating this topic, I believe that I’m in a position to present an explanation that’s sure to rock <em>Donkey Kong Country</em> fans to their core — a hypothesis that reveals development shortcuts taken by Rare, and calls into question the very nature of Donkey Kong Island.</p><p>To begin, a gander at the land mass in question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*61RzWouSlsiBBdhDZy1tIA.png" /><figcaption>DK Island</figcaption></figure><p>There’s no doubt that the chimneys indicating Kremkroc Industries, Inc’s position are on top of a temple. <em>Donkey Kong Country</em> features a number of temple-themed levels, so the presence of such a structure isn’t remarkable — but Kremkroc Industries, Inc. contains no such levels. In fact, the world is a vast environment of cliffs, factories, and even a lake:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ilo_fGsQAdpufYgTHvtkDA.png" /><figcaption>Kremkrok Industries</figcaption></figure><p>Who would consider the demented idea of building chimneys upon ancient temples in the first place? Is this some kind of political statement by the game’s developer Rare, which in the smoggy 90s saw rampant industrialisation as something that would inevitably lead to society’s collapse — leaving mankind’s great accomplishments destined to become forgotten ruins like<em> Donkey Kong Country</em>’s temples?</p><p>No. So what’s going on here?</p><h3>Comparing depictions of Donkey Kong Island</h3><p>The root of all of this can be traced back to an earlier point in <em>Donkey Kong Country</em>’s development. Several months before the game was released, screenshots were distributed in an effort to get people salivating as profusely as possible in anticipation of its November release date.</p><p>While the quality of this image is poor due to years of neglect, here is one of the aforementioned screenshots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*WoSPNvq-CdGjLKZMn8QvLg.png" /><figcaption>DK Island (pre-release)</figcaption></figure><p>You’re right to be shocked. While initially difficult to discern, the chimneys aren’t in the same place as in the final game — not even close. Instead, they’re way over behind Vine Valley, the game’s third world.</p><p>The implications are staggering. Not only are the chimneys in a completely different location, they’re protruding from the side of the island never seen within any of the<em> Donkey Kong Country</em> games. What lurks behind there? Well, apparently the horrifying environment that Kremkroc Industries, Inc. is built upon.</p><p>The lumbering gorilla’s vanity project of an island is depicted a total of four times in the <em>Donkey Kong Country</em> games. It’s seen in the distance during the final boss battle of the original game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3y187YFbX5uHbq6FM4UCAw.png" /><figcaption>Final boss battle level background</figcaption></figure><p>And then in <em>Donkey Kong Country 2,</em> we’re treated to depictions of it during the first and final regular worlds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*5l_-4HgTQ4Fr9ASpOGBSuA.png" /><figcaption>Gangplank Galleon</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*IlF8CN9u_kY5TXnHtkIWpw.png" /><figcaption>K. Rool’s Keep</figcaption></figure><p>It’s easy to assume that the same render is copied and pasted into the artwork for all three, but this is Rare we’re talking about — a developer renowned for impeccable attention to detail. The island was in fact rendered from a slighty different angle for each depiction, made obvious by this side-by-side comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOuWu4b3tZCzW2xFHCxM2A.png" /><figcaption>DK Island’s various depictions</figcaption></figure><p>Astonishing attention to detail, you’ll no doubt agree. But look more closely at the <em>Donkey Kong Country 2</em> rendition of the island behind the close-up of Kaptain K. Rool’s impressive but tragically shipwrecked galleon. It doesn’t take the most astute of eyes to see that the chimneys are in the original pre-release location, behind the trees:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVJq2BoOI1RCVxV6cNZCGA.png" /><figcaption>DK Island from Gangplank Galleon</figcaption></figure><p>They’re arguably behind the trees in the depiction seen during <em>Donkey Kong Country</em>’s final boss battle too (the left-most image in the side-by-side comparison above), but the render is so small it’s hard to say for sure.</p><p>There’s also the Game Boy Advance port/remake/whatever of <em>Donkey Kong Country</em>, where the following image appears behind the bonus level intro:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*nurdkfw7k7jDo0_G_hPd0Q.png" /><figcaption>DK Island in Game Boy version of Donkey Kong Country</figcaption></figure><h3>But why?</h3><p>So, we now know that Kremkroc Industries, Inc. was originally meant to take place in an entirely different location. Why the change so late during the game’s development? Let us consider two implications of the edit:</p><ol><li><em>Donkey Kong Country</em> has less worlds than its sequels. Things would have been more balanced if there were a temple-themed world, sadly abandoned during development. Moving the chimneys allows an otherwise useless part of the overworld to be utilised.</li><li>The overworld has a large backwards ‘C’ curve to the path players take, with Kremkroc Industries, Inc. rightly being towards the end of the game due to its sadistic difficulty (<a href="https://www.youtube.com/watch?v=fF8S2-KP7VY">Seriously, what the hell?</a>). If it had followed Vine Valley as the earlier overworld design implied, things might have gotten real a bit too quickly for players.</li></ol><h3>One more thing…</h3><p>We’ll likely never know the truth, nor exactly how late during the game’s development the changes were made. But there’s one final curiosity to this whole ordeal that leaves one of gaming’s most finely crafted classics with an ugly blemish.</p><p>If one looks closely at Donkey Kong Island, it’s apparent that Rare moved the chimneys in a rush. It was likely done after the rendered art assets had been locked down, because instead of moving them within the 3D model and doing a fresh render — which took a very long time with the computers of the time — Rare used a graphic editor to essentially do a cut-and-paste job.</p><p>Notice how in other depictions of the island, Donkey Kong’s signature quiff of hair is easily visible as a snow-capped mountain. It’s also there in the alternative versions of the <em>Donkey Kong Country</em> overworld discussed earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*JUVbbRwBK2nnDhDmDN6vLw.gif" /></figure><p>This isn’t so in the final release of <em>Donkey Kong Country</em>. Instead, the hastily edited chimneys cut the hair short, leaving Donkey Kong’s island-sized monument to his visage a cheap imitation of the real thing. A few pixels of hair remain to the side of the chimneys, but the area between them is just blue sky:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*I9OVWBnA2wW2O2s4ovYhZA.gif" /></figure><p>I hope that you’ve enjoyed this gripping glimpse into the storied history of <em>Donkey Kong Country</em>. Let me know your thoughts! And if you do enjoy inappropriately in-depth examinations of old games, feel free to subscribe as you may see some more content along these lines in the future. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b1d59c2d051" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Buggy edges in Chrome when using ‘background-size: cover’]]></title>
            <link>https://medium.com/@ryanjw/buggy-edges-in-chrome-when-using-background-size-cover-dd6eb44541fc?source=rss-6723b35cabfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd6eb44541fc</guid>
            <dc:creator><![CDATA[Ryan Williams]]></dc:creator>
            <pubDate>Wed, 30 Oct 2013 12:50:58 GMT</pubDate>
            <atom:updated>2013-11-04T14:03:09.224Z</atom:updated>
            <content:encoded><![CDATA[<p>Chrome seems to have an issue with using <strong>background-size: cover</strong> to make background images fill the entirety of the element the property is used on. Instead of a clean edge, a line of pixels from the opposite end of the image often shows up. I’ve created a <a href="http://jsfiddle.net/RyanJW/9GQQf/1/">fiddle</a> demonstrating the bug, pictured below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*b6APGLrevZUM1RJijfBEug.png" /><figcaption><em>Left: How the element should look<br>Right: How Chrome renders the element</em></figcaption></figure><p>Your first thought is likely ‘Ah, a rounding bug!’ — and you’d be right. Indeed, you might need to slowly adjust the size of your browser and/or element size to expose the issue, making it very easy for one person to never encounter it while someone else sees it all the time.</p><p>The problem occurs because the browser tries to match the image size to the element, retaining the image’s aspect ratio at all costs. If this can’t be done perfectly (i.e. the height or width of the image ends up being a decimal), the browser has to decide how to round the numbers.</p><p>When it comes to this particular CSS property, the browser’s decision should be simple: always round up. That way, the worst that’ll happen is a row of pixels will get cut off. Most browsers get it right — Chrome isn’t one of them.</p><p>I’ve come up with two fixes, the second of which produces the best results in return for a bit more work:</p><h3><strong>Method 1: Don’t allow the background to repeat</strong></h3><p>Use <strong>background-repeat: no-repeat</strong> on the element. If the bug occurs, all that’ll happen is whatever’s behind the element will show through (this can be a <strong>background-color</strong>). This is only really masking the issue as there’ll still be a row of pixels not showing up correctly, but it’s sometimes an adequate drop-in solution. Check out my <a href="http://jsfiddle.net/RyanJW/y53yf/3/">fiddle</a>.</p><h3><strong>Method 2: Overscan the background</strong></h3><p>Borrowing from the concept of <a href="https://en.wikipedia.org/wiki/Overscan">TV overscanning</a>, apply the background image properties to a child element that’s absolutely positioned to be 1% bigger in each direction than it needs to be. The image can then be cleanly cropped by <strong>overflow: hidden</strong> — you’ll lose the very edges of your image, but the element you want to fill with a background image will be well and truly filled.</p><h4>HTML</h4><pre>&lt;div class=&quot;background&quot;&gt;<br>    &lt;div class=&quot;overscan-background&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><h4>CSS</h4><pre>.background {<br>    height: 90%;<br>    overflow: hidden;<br>    position: relative;<br>    width: 50%;<br>}</pre><pre>.overscan-background {<br>    background-image: url(https://medium.com/&#39;http://i.imgur.com/9NhhOcw.png&#39;);<br>    background-position: 50% 50%;<br>    background-size: cover;<br>    height: 102%;<br>    left: -1%;<br>    position: absolute;<br>    top: -1%;<br>    width: 102%;<br>}</pre><p>The <strong>.background</strong> element should be unique to your project; it could just as easily be <strong>.header</strong>, and the dimensions don’t matter. Just ensure that it has <strong>overflow: hidden </strong>and <strong>position: relative </strong>(or <strong>absolute</strong>), as they’re used to position the <strong>.overscan-background</strong> element.</p><p>You can more or less use the <strong>.overscan-background</strong> element as it is, apart from changing the <strong>background-image</strong> path. As I mentioned before, this method involves a small part of the image being cut off. You can control the amount lost by adjusting the percentages:</p><h4>CSS</h4><pre>.overscan-background {<br>    background-image: url(https://medium.com/&#39;http://i.imgur.com/9NhhOcw.png&#39;);<br>    background-position: 50% 50%;<br>    background-size: cover;<br>    height: 101%;<br>    left: -0.5%;<br>    position: absolute;<br>    top: -0.5%;<br>    width: 101%;<br>}</pre><p>Take a look at my <a href="http://jsfiddle.net/RyanJW/9GQQf/5/">fiddle</a> demonstrating this method. I’ve also prepared <a href="http://jsfiddle.net/RyanJW/pZegF/3/">another fiddle</a> showing the same concept, but with a circle used as the background image in a square element — it’s easier to see how the technique works with this example.</p><p>If anyone has a simpler solution to the problem, let me know!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd6eb44541fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>