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.)

  • Went in sceptical, but this is a very good/solid presentation: the emphasis on going beyond chucking around the adjective "playful" and actually considering what makes (different kinds of) games work, and what they may/may not be applicable to, is spot-on. And a reminder that I'm behind on my reading, as usual.
  • "Hooray! Someone has put John Smith’s short film, The Girl Chewing Gum (1976), on YouTube… The film consists almost entirely of a single continuous shot of Stamford Road in Dalston Junction, a downbeat area of east London… The conceit of the film is that everything that moves or appears within shot – pedestrians, cars, pigeons, even clocks – is following the instructions of an omnipotent director who appears to be behind the camera: ‘Now I want the man with white hair and glasses to cross the road … come on, quickly, look this way … now walk off to the left.’ Pedestrians put cigarettes in their mouths, talk to each other, eat chips, take their glasses off, cast a glance behind them or look at the camera, all at the apparent behest of this offscreen director."

eg2k9.png

I really liked last.fm’s end-of-year charts. I also really liked this analysis of Pitchfork’s scoring in 2009, just for the statistical fun. And then I thought about my favourite score-oriented website, and wondered why no-one’s done this for Eurogamer yet. I’d be the first to argue that scores in reviews aren’t that important – but everybody loves arguing about them in comments threads, and besides, they make for interesting statistics. What I’d really like would be something like the Pitchfork analysis, but looking a bit more like the last.fm site.

And then after two days I just decided to build it myself.

It’s relatively straightforward: a small app to explore a year’s worth of review scores, built around the pillars of reviews, writers, and scores. Most blue things are clickable; writers have pages that show their reviews, as well as their own averages, deviance from EG’s norm, and the scale of their contribution to the overall average. That latter figure is something I call influence; it took a long while to get to, and I write about it more here. Here’s Simon Parkin’s page as a good example of a writer’s page.

Reviews also have pages – here’s one for Modern Warfare 2, which show how the review compares to the site’s average, the writer’s average, and also to Metacritic. And, of course, you can see just how many games scored 7 – or any other score – if you want. Basically: have a click around.

I started two weeks ago, and guess I stopped committing in the middle of last week, but towards the endit was just front-end tweaks. It’s not been a big project at all – about an hour or two’s work a day on average, in evenings, and lunch-hours, over about ten days.

It’s not a very advanced project, and touches lots of bases I’m working with a lot right now – data analysis, visualisation, scraping. That said, it’s got some interesting stuff under the hood. I’m using Typekit for the attractive type, and it’s been a pleasure to work with. The graphs are a combination of the Google Charts API and gRaphaĆ«l, which I’ve had reasonable results from recently. gRaphaĆ«l’s strength are beautiful visualisations, rather than ultra-accurate charting, so the pair of tools are used for their strengths. Finally, it’s all deployed on Heroku, which has been a joy as ever; cloud deployment of databased apps, on dynamic hosting, as simple as pushing to a new git repo. And, for the scale of the Eurogamer tool, totally free.

So there you go. A little exploration of some numbers, which bring some interesting figures to light, and was also fun to build. It only felt right to share it. As the site says, scores aren’t everything – you should read reviews too, folks – but when you’ve got numerical data, it seems a shame not to do anything with it.

  • "As Hecker suggested, though, that crucial consideration of the "why" of game development — along with related questions like "What are you trying to say to people?" or "What influenced this?" or "Are you trying to say anything at all?" — seems to be less important in this medium than it is elsewhere. That's understandable, since "fun" can be pursued for its own benefit, and to great and impressive effect. Surely we've got that covered by this point, though, and there's bandwidth for more." Chris Remo thinks out loud for a bit.
  • "I'm sorry to say that Demiforce is canceling plans for Onyx." This is a real shame, because I was somewhat excited that Demiforce wasn't just ramping up for "another game", and was instead building something that might benefit the platform. As it is: oh well. Those Apple T&Cs are killer, it seems.
  • "I was reading about arcades and how you'd have to queue to play popular games as well as follow rules like no throwing in fighting game or the others wouldn't let you play. This seems rather strange. The money cost must have gotten expensive pretty quickly as well. I'm not old enough to have been to them when they were around so I'm curious about what they were like." And then, 18 pages of wonderful gaming oral history; you'll be smelling the aircon and the chewing gum by the time you're through with this thread.
  • "The aim, then, is to explore what makes a good children's game, to consider how this oft-maligned market can sometimes reveal bad game design habits that we've been conditioned to tolerate, and to offer a guide to the best games for kids available now by looking at the four design areas that I believe are key to making a successful game for children." Dan Whitehead's roundup of games for children is really very good: some strong thinking, good comparative analysis, and best of all, parental insight. More like this, please, EG.
  • Wonderful interview with Marty Stratton and John Carmack on Quake Live; there's some really smart insight on development and business in here, and also some tidbits of Carmack talking code. Definitely one to mull over.