From June 9th through the 17th I was heads down working on my entry for the 7 day First Person Shooter game development challenge 7DFPS (website: http://7dfps.org/). Like many others I would be working with the Unity 3D engine (website: http://unity3d.com/). Unity is an absolutely wonderful tool for quickly putting together games, and they turned out to be supporters of the competition — offering an extension of the Pro version of their software for the competition. One of the core features of the Pro version of Unity is access to the Asset Server — a separate server application you need to maintain to collaborate on your projects. Without the Asset Server, Unity has earned a reputation for absolutely destroying itself when shared via source control.
Given that I was planning on participating in the SA Game Dev Challenge VII (theme: ‘Balls’) with a team of three other people, and that I wasn’t planning on spending $1500 for a Pro license just to participate in a few competitions, I decided to use the 7DFPS challenge as an excuse to learn how to collaborate with Unity using git.
I was in for a treat.
Unity Hates Source Control
Unity clearly does not enjoy working with source control outside of the Asset Server. (This is actually my number one complaint about working with Unity — I basically can’t collaborate with people who are not wizards. Thankfully the person I worked with for Duck Hunted is Swedish, which is functionally equivalent to being a wizard.)
What is it about Unity that drives source control crazy? For starters, a heavy reliance on binary file formats. Scenes and prefabs, for instance, are stored as binary files which prevents two people from working on a scene at the same time. Unity also has a number of local cache directories that should not be synced between clients. Syncing them causes weird corruption issues and can potentially destroy all your hard work. Finally, there isn’t a lot of information online about using external source control with Unity. It’s mostly tribal knowledge, and Unity’s own page on the issue contains incomplete information. In the release of Unity 3.5, they changed the way Unity worked with external tools, which means a lot of the information on the net is simply no longer current. I’m hoping this post sheds some light on how Svampson, my co-developer during 7DFPS, and I managed to use Github to work on a Unity project and not totally hate ourselves the whole time.