Introducing Polywarp: a free minimal game about rhythm and geometry for iOS/Android

I’ve had some downtime recently so challenged myself to make a mobile game in four weeks. This meant working to my strengths (code, music, procedural generation, UI) and avoiding my weaknesses (modelling, texturing, animation). It also meant I had to be very strict on the scope of the game, which ruled out pretty much all genres except arcade/action, and meant I had to avoid complex features like multiplayer and localization (although I may add the latter if it gains popularity).

I prototyped some ideas in Unity, and zoned in on using 2D flat-shaded polygons to create a singleplayer rhythm/timing game. For metagame progression, added unlockable psychedelic colour schemes since this required no further art (aside from picking the colours). I spent a few days hunting around online for some good quality electronica/IDM/glitch and licensed a track for each of the five stages. Nerds may be amused to know I referred to the xkcd color survey to pick colours.

Anyway, after several weeks of coding and a brief alpha test with friends, the end result is Polywarp, a minimal music game about rhythm and geometry, as seen in the trailer above. I didn’t quite make the deadline (it took just over 6 weeks), but I’m very happy to announce it’s available to play for free now on iOS and Android:

Download on the App StoreGet it on Google Play

You can find out more on the Polywarp project page. Don’t forget to leave a review if you check it out, thanks! :)

A mailing list alternative to Mailman using cPanel Pipe to a Program and Python

Recently my web hosting provider decided they were no longer going to support GNU Mailman on their cPanel installation “for performance reasons”. This was annoying as I’d been using Mailman for years to host an internal team mailing list.

When I asked my provider for an alternative, they suggested creating an email forwarder rule for each recipient, ie. forwards to, etc. While this worked as a crude replacement, there was one big downside: replying to an email would reply to the original sender unless you remembered to hit Reply to All.

Feeling left high and dry by some crappy customer service, I wondered if I could hack together my own poor man’s mailing list alternative using Python.

I did some digging and discovered that cPanel allows creation of advanced email forwarders that pipe to a program on the server. There’s a great how-to guide for setting this up. On Stack Overflow I learned how to pipe an email from standard input into a Python program.

This was starting to look promising. If I could get cPanel to pipe emails to a Python script on the server, all I’d need to do is twiddle some message headers in the script then send out the adjusted emails to the mailing list recipients.

I looked into what was so special about the mailing list email headers generated by Mailman. It turns out the magic fairy dust I needed was simply the inclusion of a ‘Reply-To’ field.

So I got a hackin’ and threw together a Python script that looked something like this:

#! /usr/bin/python

mailing_list_subject_prefix = '[MAILING_LIST] '
mailing_list_recipients = ['', '']

import sys
import email
import smtplib

# Read in the email from standard input
msg =  email.message_from_string(

# Set the Reply-To: field for the outgoing mailing list emails, and append a mailing list prefix to the subject if it's not there
def add_replace_header(msg, header, value):
        msg.replace_header(header, value)
    except KeyError:
        msg.add_header(header, value)
add_replace_header(msg, 'Reply-To', msg['To'])
if mailing_list_subject_prefix not in msg['Subject']:
    add_replace_header(msg, 'Subject', mailing_list_subject_prefix + msg['Subject'])

# Send the modified email out to all mailing list recipients.
# In case of an error, print the exception and dump the message to standard output. This will trigger a bounce email with the error contents for debugging.
    server = smtplib.SMTP('localhost')
    server.sendmail(msg['To'], mailing_list_recipients, msg.as_string())
except Exception, e:
    print str(e)
    print msg.as_string()

Hopefully this is helpful to anyone else out there in a similar predicament. Just tweak this script, upload it to your server, mark it as executable (chmod +x), then set up a cPanel advanced email forwarder rule to pipe to the script.

You might need to change the Python path at the start of the script or tweak the SMTP login method depending on how your server is set up. Refer to the linked articles above for further technical details.

I miss Mailman. :(

A Blender script to procedurally generate 3D spaceships

Last month I submitted an entry for Reddit’s /r/proceduralgeneration monthly challenge, which was to make an infinite number of spaceships using procedural generation. I figured generating spaceships in a 3D modelling package would be the most useful, so I decided to throw together a Blender Python addon.

I used Blender’s BMesh module to manipulate a box into a final spaceship. Here’s the basic algorithm:

  • Start with a box.
  • Build the hull: Extrude the front/rear faces several times, adding random translation/scaling/rotation along the way.
  • Add asymmetry to the hull: Pick random faces and extrude them out in a similar manner, reducing in scale each time.
  • Add detail to the hull: Categorize each face by its orientation and generate details on it such as engines, antenna, weapon turrets, lights etc.
  • Sometimes apply horizontal symmetry.
  • Add a Bevel modifier to angularize the shape a bit.
  • Apply materials to the final result.
  • Take over the universe with your new infinite fleet of spaceships.

I won the monthly challenge, and put the code up on GitHub. Since then a bunch of people have been making improvements, I made the top of HackerNews, and the /r/ mods gave me the flair “Starfleet Commander”. A good month.

Welcome to my ugly nerd blog

Hey there and welcome to my ugly nerd blog. I’m a senior software engineer and co-founder of Melbourne video game developer Space Dust Studios. I’ll be posting infrequently about whatever I’m up to in the world of software engineering, video games, music, and whatever else tickles my fancy.

To kick things off, here’s a first-look at Space Dust Racing, the latest video game I’m working on: