Automatic for the People

with No Comments

Nome’s development team are spread around the UK, and we use various tools to work together remotely – we use a private Facebook group and Google Drive to share ideas and documents with each other, for example. Since we have only one programmer, we don’t need a collaborative source control system, but it would be a huge advantage if we could all always access the latest build of the game, to make it easier to test new features as they are introduced (and identify any possible regressions).

Up to now, I’ve been manually creating builds after every major new feature is added and uploading them to Dropbox. However, since our team members use a combination of PCs and Macs and the Nome project codebase is around 8Gb in size, manually switching back and forth between target platforms (with the associated reimport of assets), compiling, and then uploading was resulting in a lot of downtime for me (especially when you come across bugs such as this one, meaning that I had to delete and recreate all the sprite atlases every build – gah!).

So, this week, I’ve been working on some tools to automate the process of compiling, zipping, and uploading the game build to a shared repository so that all the team members always have access to the latest version of the game. Here’s the new menu item within my Unity editor. At the end of each day, I simply select this option and walk away, leaving it to run unattended, and sometime later that evening the team get notified that a new build is available.

build-zip-upload

The backing script to achieve this is not really that complicated – and I mostly cobbled it together out from example code snippets I found lying around.

  • It’s easy to customise the Unity Editor menu bar by decorating a static method with the [MenuItem] attribute placed in an /editor subfolder of your project.
  • The method invoked from the menu bat gathers the active scenes in the project and then calls the BuildPlayer to compile the project for both PC and OSX platforms.
  • Then I use a method from the DotNetZip library to zip each build up and label them with a version number and target platform.
  • Finally, the zip files are copied to the team Google Drive account by starting a System.Diagnostics.Process that issues an upload command to the GDrive CLI client.

And that’s about it. I keep a log at each stage of the script in case anything goes wrong, but otherwise it’s pretty self-managing, and certainly a lot less effort from me, which means more time to spend on adding new features to the game!

Leave a Reply