Year: 2014

    The Lego of Tomorrow

    This is a post from my blog, which is (mostly) no longer available online. This page has been preserved because it was linked to from somewhere, or got regular search hits, and therefore may be useful to somebody.

    “All I’m doing is building stuff,” Joseph says.
    “That’s what Minecraft is good for, isn’t it?” I reply. “It’s like Lego with infinite pieces.”
    “Yeah,” he says, and turns back to his computer screen; back to the childhood task of creating the new.
    I turn back to the washing up that I was in the middle of, back to my adult role of cleaning and tidying and preserving that which already exists.

    It feels odd to be writing about Minecraft in 2014. Following its 2009 “alpha” release, it quickly became the darling of the indie gaming world. There’s not a lot to say about it that hasn’t been said by countless reviewers and bloggers over the intervening years. I’d played it myself a few times—I made my character wander around, mine some rocks, fight some monsters, craft a few things. But I never “caught the bug”. That’s the all-too-adult brain at work again—I looked at the landscape and appreciated it for what it was, not what it could become.

    Today though, for the first time, I saw Minecraft through the eyes of a child.

    Joseph's first steps in Minecraft

    Raised on a self-imposed diet of videogames since he was old enough to shake a Wiimote, our son has never had the enthusiasm for Lego that I did at his age. While I would disappear to my room for an afternoon to build, he always wanted to spend it with gamepad in hand. On occasion I despaired for him and his generation. I worried that their entertainment had become so pre-packaged and targeted that they wouldn’t want to create their own games. How could silent, limited, awkward Lego sets compare against a million man-hours of Nintendo’s finest creators delivering pure entertainment?

    But now I sit and watch Joseph at work, and I know how wrong I was.

    As night falls, his character flies up over the landscape and looks down to behold all that he has created. Torches spread out across the world like the fires of a nascent civilisation, casting light upon those things that human hands have built.

    Torch-lit buildings at night

    There are houses, now, where once there was only grass. Some of the roofs are made of coal and supported only by bookshelves and hay bales, but they are houses nonetheless. They are dry when the rain pours outside. There was a bed for his character to rest in, but now there are more than a dozen—for his character’s parents, siblings and cousins, Joseph explains.

    There are railways that connect them over fragile bridges far from ground. There is a torchlit tunnel beneath the surface, joining the houses of the tiny village to the woods where sheep and cows roam. There was a spider that “freaked him out”, so Joseph’s character started to carry a sword with him at all times.

    The environment, once wild and random, was being tamed.

    Then Joseph noticed that water would flow if the ground around it was removed. The great lakes of his world could be channeled. The tunnel became a great underground river, bringing water near to the houses of his people.

    Terraforming

    He built a black-lined room carved out of a hill, and decorated each block with a torch.
    “It’s a Christian place,” he explains. “My character is a Christian.”
    I had just watched that nascent civilisation invent religion.

    Dawn breaks. Among the high forest canopies there now stands something else—a tower, built on lowlands but rising taller than the hills. It is a vast structure of stone and glass and, for some reason, pumpkins. It is not built the way an architect would build, but nor does it look like a work of nature. It is the work of an almighty creator not restricted by principles of gravity or shearing moments. It is not utilitarian; not a house or a bridge or a water channel. It is something that was built just because it could be built.

    The land was tamed, now; the world mastered. And so his one-man civilisation had reached for the stars.

    A Tower Taller than the Clouds

    I am no longer under the illusion that neat, rail-roaded videogame adventures will leave us a generation lacking the desire to create for themselves.

    He may not spend his afternoons building Lego cars, but that’s okay. Within the last four hours I’ve watched him take a world of random-seeded entropy and transform it into a place where bridges of stained glass tower over the skies.

    I think our children’s generation will be just fine.

    Stained glass bridge

    Raspberry Jammin’

    This is a post from my blog, which is (mostly) no longer available online. This page has been preserved because it was linked to from somewhere, or got regular search hits, and therefore may be useful to somebody.

    Last Saturday was the Linux User & Developer Raspberry Jam event at Poole RNLI college. I took the tank, of course, and Joseph too — worrying all the while that he’d be the youngest kid there by about ten years, and he’d get bored within half an hour.

    How wrong I was.

    We eventually escaped almost an hour after the scheduled end of the event, once Joseph and the other kids — many his age — had had their fill of Minecraft and the Raspberry Tank.

    Along the way we’d met the awesome people from PiBorg with their much more impressive RPi tank, along with robot arm-wielding BigTraks and 3D LED matrices. We’d done a show-and-tell session, drunk a lot of coffee, and most importantly been part of a room of 20+ kids all learning to code for the first time using Python and Minecraft.

    It was really an amazing thing to see and be part of, and my heartfelt thanks go out to the organisers from Linux User for hosting a fantastic day!

    Here’s the kids playing with our tank:

    State of the Whale Address

    This is a post from my blog, which is (mostly) no longer available online. This page has been preserved because it was linked to from somewhere, or got regular search hits, and therefore may be useful to somebody.

    It’s no secret that the current state of my SuccessWhale social network client is not a good one. It currently exists in three forms:

    • The main server runs SuccessWhale version 2.0.3. It’s not been updated in nearly a year, and the only changes within the last three years have been playing catch-up with the changing Twitter and Facebook APIs. It probably has some broken features by now, because I don’t regularly test it out.
    • The test server runs SuccessWhale version 2.1.2 with debug flags enabled. The 2.1 branch includes things like mixed feeds and LinkedIn support, and is “beta-ish”. Some people use it anyway. LinkedIn support is broken and will never be fixed.
    • The dev server runs SuccessWhale version 3.0.0-dev, a complete rewrite of the whole thing that has stalled in a half-finished state. It’s just about usable provided you’re willing to drop back to the test server to fiddle with any settings (they use the same database). It’s buggy, and as far as I know used only by me.

    SuccessWhale 3 interface

    SuccessWhale v3.0 web interface

    Very occasionally, I get the motivation to do something about SuccessWhale. It feels bad to leave it in its current “limbo” state where there isn’t really a version that works and is properly maintained. I use SuccessWhale every day, so at least there’s the dogfooding aspect, but “it works well enough for me” is far from “it’s something other people would want to use”. And my friend Fae produces the excellent OnoSendai Android client that uses SuccessWhale, so I have some sort of responsibility to him to keep SuccessWhale going.

    But there’s a hell of a lot of reasons why I would rather not.

    • Free time is nice. I started SuccessWhale five years ago, when I still had the energy to keep big projects going. Now, with less free time in the evenings and more responsibilities in my day job, I’m much more keen on grabbing a few minutes of that blissful feeling that comes from having nothing to do.
    • We created a monster. SuccessWhale (or FailWhale as it was then called) was first and foremost a simple Twitter client. I explicitly declared that it would never be a client for other social networks such as Facebook. Nowadays, SuccessWhale has its own API that wraps both Twitter and Facebook, along with several front-ends.
    • Rewrites are no fun. Version 2.0 was badly coded and had to go. Version 3 is nice and designed properly from the start! But it requires hundreds of hours of work just to let it do all the things that version 2 could already do.
    • The APIs are crap. In fairness to Twitter, its API is well-documented and makes a lot of sense. But, like all APIs it is regularly updated, meaning that all application developers need to work just to keep up — we put hours in not to add new features, but just to make sure the existing stuff doesn’t break.
      Facebook’s API is much the same, except that it makes much less sense and the documentation is largely non-existent. It’s quite telling that I asked a simple question on StackOverflow, and a Facebook dev replied with “here’s how to do it. I guess I’d better add that to the docs, huh?”
    • The services are hostile. Twitter, once the darling of those that believed in a strong 3rd-party client ecosystem, are now actively hostile to developers that create clients like mine that “replicate the core Twitter experience”. It’s not nice to develop with a hard 10,000-user limit hanging over your head because you’re making a client for a service that would rather your software didn’t exist.
      Facebook isn’t so hostile, but its privacy settings mean that SuccessWhale is only useful to a user if their friends have configured their privacy settings badly.
    • The services are crap. Twitter is the playground of celebrities, companies seeking “engagement” and people who want to have a “personal brand”. Its artificial 140-character limits and endless retweets are not a good medium for talking to friends, which is all I want to do. Facebook is a privacy-violating monster on course to balkanise the web with its all-consuming reach. These services are the internet now, and my pleas to return to more honest times fall on deaf ears. But I don’t want to use them, and that makes developing a client for them a distinctly unfulfilling experience.

    For now, SuccessWhale stays alive. Twitter and Facebook are what I’m stuck with as the only sensible way of communicating with many of my friends and family, and SuccessWhale helps me avoid the worst features of their interfaces — their cryptically-curated feeds, in-line adverts and one-feed-at-a-time pages. That, plus a vague sense of responsibility to my users, are what keeps it around.

    When the day comes that I can jetission Twitter and Facebook from my life without missing them, it will be SuccessWhale whose loss I mourn. Like many projects before it, its user count will fall to zero and it will slowly start to fade from the internet.

    One day, I’ll be sad that I made a thing that is no more. But right now, all I feel for the thing is the frustration that developing it is fighting a losing battle that has no end in sight.

    Adventures in Emoji

    This is a post from my blog, which is (mostly) no longer available online. This page has been preserved because it was linked to from somewhere, or got regular search hits, and therefore may be useful to somebody.

    Yesterday, a friend of mine started me on a quest that was to be filled with despair. It started innocently enough.

    I gleefully replied with my 140 character attempt at making that come to life (each Emoji counting, as I would later discover, as two normal characters).

    Well, that didn’t look like a bad start. There were some alignment issues there, probably because Twitter uses a proportional font. Nothing that a couple of <pre> tags couldn’t solve!

    Oh, how wrong I was.

    Twenty-four hours later, this is what I have to show for my efforts:

    Well, it’s a whole screen of Rogue-like, which is not bad. But despite wrapping the whole thing up in <pre> tags, there are still alignment issues.

    Lesson 1. Not all Emoji are a fixed width.

    Lesson 2. No Emoji are the same width as a half-width or full-width Unicode space.

    This will become important.

    You may also notice that the picture above isn’t a nice <pre> block full of text that you can copy and paste. That’s because, after hours of tweaking to get something looking vaguely presentable, I decided to see what it looked like in a different browser.

    And even in the same browser, with a different monospace font:

    Lesson 3. The width of an Emoji — and even one of the Unicode spaces — varies from font to font.

    Before I even got to that point, though, I was nearly thwarted by an even more frustrating issue — actually laying out the Emoji in a text editor.

    I assumed that in the world of monospace text that editors inhabit, these problems of layout would be avoidable. Any modern text editor should allow me to edit a bunch of Unicode characters in a regular grid, right?

    Of course not.

    My first attempt was using gedit, my GUI editor of choice. It happily allowed me to mix standard ASCII and Unicode characters. When I inserted a space between ASCII characters, it was about 20px wide — so far, so good. But when I inserted a space, even a Unicode full-width space, between two Emoji, the result was only 10px wide. The browser renders the spaces correctly, so to look right in the browser, all spaces had to be half as wide in gedit — useless for drawing a dungeon layout.

    I resorted to vi, my console editor of choice. My console font happily supports Unicode, so this should be no problem!

    Of course not. For a start, keypresses in vi insert one byte at a time, meaning that every other keypress misaligns every subsequent two-byte Unicode character on that line. And then there’s the quite bizarre way in which it decides to write characters on top of each other.

    My third and almost bearable choice was an odd one. I figured that if I wanted the same look in my editor as in the browser, I should use an editor that runs in the browser. I chose the Chrome extension Caret.

    At last I had something almost usable, although the misalignment of characters rears its ugly head here too. There’s the infuriating bug that this only applies to characters on the screen, not the cursor position. 70 characters into a line of Emoji, the cursor position can show up almost two characters away from the text it actually sits at.

    Lesson 4. There’s not a single program in the world that renders Emoji the same as any other.

    Last but not least, there’s the matter of Emoji fonts.

    On my Linux machine, my browser and my text editor at least use the same set of monochrome Emoji symbols. But view the same page on an iOS, Android or Windows Phone device, and you’ll discover they have their own platform-specific Emoji fonts which are specifically designed to look great while ruining your attempt at cross-platform compatability. Here’s what our Rogue-like looks like on Android, showing off the inevitable inconsistent widths:

    If you’d like to post your hard work to social media sites, you may also discover that Twitter has its own set of unpredictably-sized Emoji. Facebook will at least use your system font when you post Emoji, although trying to edit a post with Emoji quickly results in a field of “your encoding is broken” rectangles.

    Lesson 5. Despite Emoji having existed for over a decade, and having been incorporated into Unicode for half that time, Unicode fonts and particularly Emoji in them are a complete mess of incompatible typesetting and platform-specific weirdness. They are not yet suitable for use in layouts — and thus, sadly, for making Roguelike games.

    For the curious, here’s how my Emoji Rogue-like would render in your browser. If you use the Cousine font in Chrome on Linux, this might look alright! If you’re using anything else, this is probably a horrible mess.

                                                                                        
        🔳🔳🔳🔳🔳🔳🔳🔳🔳                                                              
        🔳🐍             🔳                        🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳      
        🔳      🐂       🔳                        🔳        🍖                  🔳      
        🔳               🔳                        🔳          🍖                🔳      
        🔳🔳🔳🔳🔳🔳🔳🚪🔳                        🔳                            🔳      
                     🔳  🔳                        🔳🔳🔳🔳🔳🔳🔳🔳🚪🔳🔳🔳🔳🚪🔳     
                     🔳  🔳                                       🔳  🔳    🔳  🔳      
      🔳🔳🔳🔳🔳🔳🔳🔳🚪🔳🔳🔳                                  🔳  🔳     🔳  🔳     
      🔳        🐀           🔳                                  🔳  🔳   🔳🔳🚪🔳🔳🔳  
      🔳  🔳                 🔳                   🔳🔳🔳🔳🔳🔳🔳🔳  🔳   🔳     🐉  🔳  
      🔳  🔳          🐀     🔳🔳🔳🔳🔳           🔳                 🔳  🔳  💍     🔳  
      🔳  🔳                 🚪      🔳           🔳  🔳🔳🔳🔳🔳🔳   🔳  🔳🔳🔳🔳🔳🔳    
      🔳  🔳  🎫             🔳🔳🔳  🔳           🔳  🔳         🔳  🔳                  
      🔳🔪🔳                 🔳  🔳  🔳           🔳  🔳         🔳  🔳                  
      🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳  🔳  🔳           🔳  🔳         🔳  🔳                  
              🔳         🔳      🔳  🔳       🔳🔳🔳🚪🔳🔳🔳🔳🔳🔳🚪🔳🔳🔳              
              🔳  🐍     🔳🔳🔳🔳🔳  🔳🔳🔳🔳🔳          🐍              🔳              
              🔳    🐍   🚪                   🚪      🐍  🐍🐍💥🚹        🔳              
              🔳         🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳        🐍        🍖      🔳              
              🔳🍗       🔳                   🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳🔳              
              🔳🔳🔳🔳🔳🔳                                                              
                                                                                        
    Level:1     Hits:14(14)   Str:15(15)   Gold:34    Armor:1   Exp:20/23
    

    The limited set of Emoji currently available also causes a number of other issues with creating a Rogue-like using the characters. For example, the character set currently does not contain glyphs for:

    • Stairs
    • Treasure chests
    • Corridors
    • Kobolds
    • The Amulet of Yendor

    I’m sure the Unicode committee will be working on these soon.