Fun With Software

17 January 2020

The impetus for personal projects is, for me, often like coming up with a joke. You want to tell it as soon as possible, but you also want to tell it as well as possible. And you don’t want anybody else to do it before you, because nobody cares about you coming up with the same joke a bit later.

That means my thought process for making things is often a bit like this:

  • Somebody should do X
  • That sounds quite easy.
  • If I don’t do it, somebody else will.
  • If it’s easy, that will be quite soon.
  • I should do X as soon as possible.

As time has gone on, my difficulty threshold has gone down: if it’s going to take more than an evening’s work, I’m not really sure I can be bothered. Especially if it requires hosting and maintenance. But sometimes, the perfect set of conditions arrive, and I need to make some nonsense.

This is how I ended up writing a somewhat silly SparkAR filter in an afternoon.


SparkAr is Facebook’s platform for making “augmented reality” effects for Instagram and Facebook camera. That translates into “realtime 2D/3D image manipulation”, rather than anything remarkable involving magic glasses. For the time being, anyhow.

Effects might work in 2D, through pixel processing or compositing, or by using 3D assets and technologies like head- and gesture-tracking to map that 3D into the scene. Some “effects” are like filters. They stylize and alter an image, much like the photo filters we know and love, and you might want to use them again and again.

Others are like jokes. They land strongly, once, and from that point on with diminishing returns. But the first point of landing is delightful.

Mgs point

In the popular Playstation game Metal Gear Solid from 1998, the hero, Solid Snake, sneaks around an Alaskan missile base, outgunned and outnumbered. In general, he will always do best by evading guards.

When a guard spots Snake, the guard’s attention is denoted by an instantly recognizable “alert” sound, and an exclamation mark hovering over his head. At this point, Snake must run away, or be hunted down.

The exclamation mark – and sound – have become a feature throughout the entire franchise, and gone on to be a bit of a meme.

That is all you need to know about Metal Gear Solid.

I wanted to to make a filter that recreated the effect of the alert, placing the exclamation mark above a user’s head, tracking the position of their head accurately, and – most importantly – playing that stupid sound.


In Spark this is, by most programming standards, trivial. Facebook supply many, many tutorials with the product (and, compared to the dark days of their API documentation nine or ten years ago, their new documentation standards are excellent).

I started with a template for making 3D hats, which matches a 3D object to a user’s head, and occludes any part of the the object falling ‘behind’ their head. Then I just had to lightly adjust it, replacing the hat with a flat plane that displayed a texture of the exclamation mark I’d done my best to recreate. That was half the work: putting the image in the right place.

What was more interesting was determining how the mark should pop-in, playing the iconic sound effect at the same time. The face-tracker offers lots of ways to extract the positions of facial geometry, and I spent a while tracking how far a mouth was open in order to trigger the effect. Eventually, though, I settled on the “raised eyebrows” outlet as being a much better vector for communicating surprise.

Spark screengrab2

Some brief faffing in Spark’s node-based programming environment later, and now raising eyebrows triggered the brief animation of the exclamation mark popping in, and the corresponding sound effect.

Aside: I am not the biggest fan of graph/node-based coding, partly because I’m not a very spatial thinker, and partly because I’m already comfortable with the abstractions of text-based code. But this model really does make sense for code that’s functioning more like a long-running pipeline than a single imperative script. You find this idiom in game-engine scripting (notably in Unreal 4), visual effects tools, realtime graphics tools, and similar, and it is a good fit for these tools. Also: the kind of people coming to work in SparkAR will likely have experience of 3D or video tools. Increasingly, as I pointed out to a friend, “everything is VFX“, and so graph-based coding is in increasingly more places than it used to be.

I also made sure I supported tapping the screen to toggle the effect’s visibility. After all, not everyone has reliably detectable eyebrows, and sometimes, you’d like to use this imagery without having to look surprised all the time.

Finally, I added some muddy scanlines to capture the feel of 90s-era CRT rendering: a slight tint for that authentic Shadow Moses feel, coupled with rolling animation of the texture.

With this all working, I promptly submitted it for review, so I could share it with friends.

The output looks like this:

Mgsthumb

As with every single workflow where there is a definite, final submission – be it compilation, code review, or manufacture – this is exactly the point in time when I realise I wanted to make a bunch of changes.

Firstly, I felt the effect should include some textual instructions; if you haven’t been shown it by me, you might not know how it works. So I worked up adding them.

Secondly, I felt the scanlines should be optional. Whilst they’re fun, some visual jokes might be better off without them. So I wrote some Javascript to make a native option picker at the bottom of the effect, with the default being “scanlines on”.

Once version one had been approved, the point release was quickly accepted. And then I shared the filter in my story, and wondered if friends would borrow it.

(“Borrow”: the only way to share filters/effects it to use them yourself. Once they’re published, you have to use them in a story post of your own. Then, if a friend wants to “borrow” it, they can grab the filter/effect from your story featuring that effect. In short: the only way to distribute them is through enforced virality. I can even share them outside my protected account. I am fine with this; I think it’s rather smart).


When I first shared it with friends, one wrote back: “yay for fun with software“.

It’s a while since I’ve worked on a platform that’s wanted to be fun. I’ve made my own fun with software, making tools to make art or sounds, for instance. But in 2020, so much of the software I use wants me to not have fun.

I made my first bot on Twitter a long time ago, and from there, Twitter became my platform of choice for making software-based jokes.

Twitter is now very hard to make jokes on. The word ‘bot’ has come to stand for not ‘fun software toy’ but ‘bad actor from a foreign state’. The API is increasingly more restricted as a result. I’m required to regularly log in to prove an account is real. My accounts aren’t real: they’re toys, automatons, playing on the internet.

I get why these restrictions are in place. I don’t like bad actors spreading misinformation, lies, and propaganda. But I’m still allowed to be sad the the cost of that is making toys and art on the platform. (An art project I built for the artist Erica Scourti was finally turned off once API restrictions made it unviable).

Most software-managed platforms are not places you can play any more. I understand why, but I still wish that wasn’t the case.

Yes, I know Facebook, who are hardly a great example of a good actor, are getting me to popularise their platform and work on it for free. It’s a highly closed platform, and I’m sure they’ll monetise it when they work out how. I’m giving them free advertising just by writing this.

But. Largely, what I made is a stupid visual effect that neither they nor I can effectively monetise, and it’s a joke is better told than not told. In that case, let’s tell the joke.


I showed it to my friend Eliot:

Every single time I hear that sound and see it working, I laugh. Actually, sometimes I don’t: I’m busy holding a straight face with my eyebrows up, and somebody else is laughing. Either way, somebody laughs. And that’s good enough for me.

I know, intuitively, this is a not unproblematic development platform. I know it’s not really ‘free’ in the slightest. But I write this because, right now, it was a quiet delight to be allowed to make toys and play on somebody’s platform, and one of the more pleasant platforms they run (if you keep it small, private, and friendly). I’m sure they’ll mall-ify this like everything else, but for now, I’m going to enjoy the play it enables.

It’s a while since I’ve made a toy that was so immediate to build, so immediately fun for others.

Yay for fun with software.

(If you want to try the effect yourself, open this link on your phone. It’ll open Instagram and let you try the effect.)

  • "The lesson games have for design is not really a lesson about games at all. It’s a lesson about play. Play isn’t leisure or distraction or the opposite of work. Nor is it doing whatever you want. Play is the work of working something, of figuring out what it does and determining how to operate it. Like a woodworker works wood. By accepting the constraints of an object like a guitar (or like Tetris), the player can proceed to determine what new acts are possible with that object. The pleasure of play—the thing we call fun—is actually just the discovery of that novel action." Not just this quotation, but all of this article, really. So good. Immaterials, again.
  • "But, I also think that in our efforts to define and legitimize our practice as a professional discipline we sometimes forget the history we inherit, the legacy of games made by communities of players, games made by amateurs, by dilettantes, by mathematicians, mothers, scientists, gym teachers, shepherds, inventors, philosophers, eccentrics and cranks.

    And in honor of this tradition I would like to suggest other verbs for us to describe where games come from, alternatives to the overconfident precision of the word “design”. Words like invent, discover, compose, write, find, grow, perform, build, support, identify, copy, re-assemble, excavate and preserve." So much good thinking in this post from Frank Lantz

Destiny

That’s me, sitting on the ground in the Cosmodrome in Old Russia.

The Cosmodrome is an environment from Bungie’s Destiny. I played it during its public beta last week.

One of my favourite things in Destiny is its sit down button.

The directional pad is used to ’emote’ in a very limited manner in the game. Two of the emotes are very specifically non-verbal forms of communication, useful for players without headsets: you can wave, either into space or at another player, and you can point. I used these quite a lot with both strangers and friends.

One of them is daft self expression: the dance button. This is probably the most popular emote; it feels like many players hadn’t played enough MMOs to have had their fill of daft emotes, and so the idea that one can just dance – not just on your own, but with other people – for no reason other than you’d like to is a new and exciting one.

It’s actually how dancing ought to be, when you think about it: a fun thing you can do whenever. There was lots of dancing in Destiny.

My absolute favourite emote, though, is sitting. And the main reason for that is the sitting down animation.

If pushed, I’ll take the female sitting down animation over the male one for one simple reason. Male characters look more like they’re sitting down to kill time, staring either into their hands, or just above them – it’s hard to tell, and it feels critical. It’s how you might sit by a campfire with friends (if you were looking up) or in a dreary queue for a gig or festival (if you’re looking down).

The female characters, though, always look like they’re sitting down to look at something. Which is so apt, for Destiny; the skyboxes and vistas the game presents (when it’s not throwing Dregs and Thralls at you) are beautiful. They’re the sort of things you want to take in with friends; pass time watching the day-night cycle. I love seeing the massed Guardians in the Tower, all sitting at the edge, watching the clouds roll across the sky. What are they doing? What are they talking about in their Fireteams and Private Parties?

The idea that sitting is active – that you might sit to do something with your friends, not to indicate an absence of activity – is a lovely thing to be reminded of. It applies tenfold – no, far more, hundredfold at the very least – to the world outside Destiny.

I like that my Guardian reminds me of this every time she sits down.

But sitting down also had a functional purpose for me: I’d also sit down in Destiny to indicate I’d wandered away from my games console.

There’s no pause button in Destiny – it’s always online – but there are enough quiet areas of a map, especially when you’ve cleared out enemies, that you can just sit down and wander away with few ill results. You might even discover how lenient Destiny’s respawning is (as long as you’re not in a Darkness zone).

I was playing with some New York friends at the weekend. They were playing pass-the-pad, and I was on my own. They didn’t have a headset, so we IM’d on our phones to explain the things we couldn’t show with a point or a wave.

Could we pause 30 secs while I put the kettle on,” asks my friend. And why not? There’s nothing around threatening. I say that I’ll go and do the same and wave when I’m back.

I push down on the d-pad, and I/my Guardian sit(s) down for a break. I wander into the kitchen to make tea and toast.

I’d been meaning to write about how much I liked the sitting in Destiny – the “looking into space” aspect of it. And today, somebody else reminded me the other reason that its sitting felt important to me.

Jenn Frank is right when she describes how infuriating her husband’s behaviour is when confronted with a game that has no pause button.

She’s entirely right to be annoyed. Reading her post, I recognised a kind of bad behaviour it’s easy to slip into – and remembered what I used to do about it.

I know that whilst online games of all shapes and sizes encourage you to keep playing – and have no pause button – they also have a reasonable number of safeguards against it in their systems. Or, at least, they should. World of Warcraft has towns, safe from attack; PVE servers, where other players aren’t a threat. Lots of ways to park your character (although not, say, in dungeons or raids, just as all the multiplayer shooters I played lock you in for the scope of a single game). I had no idea how anybody played on a PVP server – it seemed to require permanent, always-on concentration.

Back in the months I played WoW, whenever I wandered away or alt-tabbed for a bit, I’d make sure my character sat down, showing the world they were absent. A little bit of playacting – something better than afk.

I’m glad it still works in 2014.

You can do it almost anywhere. Take a step back. Find a quiet corner. Down on the d-pad. Your Guardian will sing a campfire song, and you can sign that rental agreement, hold the step-ladder to the loft, and talk to your relatives on the phone.

Sit the heck down.