Ben Hymers http://www.benhymers.com
... here to talk about Continuous Integration in Unity
CI is a dry topic so instead of presenting as a walkthrough, I thought it'd be interesting to rattle off a bunch of anecdotes and hopefully you'll find some of them interesting!
It's a broad area, and there's likely a very wide spread of experience with it in the room so I'll give a quick intro then proceed to the meat
I'm Ben!
Not a build engineer...
Quick bit of background on myself...
Advance after Lionhead
Starting new studio in Guildford soon
Something I want to point out... I'm a gameplay engineer, not a build engineer
None of this is overkill, all stuff I've seen a need for to help me do my job
By CI I really mean 'build automation', a machine or group of machines set up to build your project automatically
I bet you've all gone to make a standalone build and found it doesn't work... nice to have the build machine catching these issues early
As your project grows... extra tasks like running tests, stripping objects from scenes... devs can't be expected to do these all the time
Easy to set up monitoring for quality issues, to notice both gradual changes over time, and sudden spikes
Trust me, I've tried a bunch, TeamCity is the best
Jenkins is widely used but I found it very fiddly and not good for reporting
Set up script to track built game size as Team City metric
Noticed this one day after wondering about build size limits
Checked contributing changelist... lightmaps!
Bit of foresight, set up PowerShell script to track built game size, noticed spikes... lightmaps!
Carried on tracking this... it's not looking good!
Nearly always lightmaps
Sadly no good analysis tools - best ones are for hackers!
Maybe a bad example...
Noticed this whilst browsing standalone build duration graphs one day...
That was the day we upgraded to Unity 5.3.0!
Would maybe have noticed some time later...
Another random find, have carried on checking it though - Unity 5.3.0 came with a 33% increase in build time! Wouldn't have known the case without my trusty graphs.
Appears to be fixed as of 5.3.4
Nobody cares about build failures... unless they can see them!
People don't care about the build machine, and ignore emails. They don't ignore red screens!
Didn't really work, not flexible, so I forked it. Use my fork, or use the command line and be careful with log files and how you find Unity.
Team City default fail conditions don't work for Unity plugin:
Unity command line options are limited
Unity's command line doesn't allow you to do much.
You can parse the command line yourself to allow you to set defines, pick options more precisely etc.
Build warnings creep up over time
OH MY GOD META FILES
Minor updates (and patches!) change serialisation format
Devs on different versions churn files
Update all at once
Run script to force save assets
EditorUtility.SetDirty and AssetDatabase.SaveAssets
Nightly clean build grew to ~12 hours!
Import SVN to git using git-svn and host locally
Massively faster full sync
Many problems so not rolled out yet
Automated Steam building is ace!
... except when it fails to log in because of Steam Guard
Turns out auth is stored locally
Copy steamcmd.exe elsewhere so auth doesn't get cleared
Unfamiliar codebase - test assumptions!
Use 'Editor Tests Runner' window in-editor
Run on command line with:
https://github.com/hymerman/guildford-uug-talk-ci-anecdotes
I'm hiring!
So are Playsport!