As a developer, version control is very important to me. Any project I work on needs to use version control; not only to use a backup and provide change history, but to enable collaboration with other developers and designers. Since I’ve been developing games with Unity, I’ve not found a resource that highlights the pros/cons of the available version control systems. I’ve not even seen a consistent list of external version control systems that you can use effectively for Unity projects.
Since I can’t find one solid source of information on this, I’m spending my Saturday researching the available options. This list is not in any order of preference, merely the order in which I encounter each system.
Asset Server
Asset Server is Unity’s own version control product. It sits on top of a PostgreSQL database and can be setup easily on many platforms. In my case, I installed Asset Server locally on my Mac for trial purposes, and found that once installed, it was very easy to administer and add project-specific user privileges. Note that Asset Server requires an additional license from Unity (an extra $500 per user), and can only be used in the Pro version.
Since it has been developed by Unity, Asset Server is integrated nicely into the Unity UI. Having used this for a week or so, I’ve found that visually, this tool is quite nice. It provides the ability to dock the UI along with your other interface windows and updates frequently, meaning you can quickly see when someone else changes a file, without needing to manually refresh/synchronise.
When you wish to update/commit, you do so using the UI. I’m usually more of a fan of using the command line, but as far as UIs go, this one was ok…
Aside from the ok UI and the ease of setup, I have already noticed some rather large features missing in Asset Server that are available in other version control systems. There appears to currently be no way to branch/tag/fork your project. The only way to “tag” a project would be to effectively copy the project to a new one in Asset Server. This means you lose any link with the original project. The same would be said for branching, although by losing this link, I have no idea how you would attempt to merge changes between the two, other than by consuming lots of coffee and manually copying changes over. Personally, I’d rather not be a merge monkey. I need my version control system of choice to deal with this automatically (bar complex merge conflicts, although that would be nice!).
Based on my experience of Asset Server so far, I’d say that it might be ok for personal use and small projects. However, I wouldn’t say it’s worth paying the additional license fee when there are more powerful options available for free.
According to the Unity roadmap for 2011, it looks like they’re working on integration of Perforce and SVN in version 3.5. Until then, if you want to use an external version control system, you’ll have to set that up yourself and choose your own client.
Links:
External Version Control Systems
Although not entirely obvious from looking at the Unity UI, it is possible to use an external version control system for your projects. Again, this will require a Pro version of Unity.
To enable external version control for your project, go to Edit->Project Settings->Editor. You should see the Editor Settings window appear. Hit the Enable button and you’ll see a progress window appear and dismiss itself once done. What this has done is create a .meta file for each of the assets in your Assets folder. These .meta files contain details required by Unity for that particular asset. It is important that you commit those files alongside your actual assets and ensure that the files are kept up to date.
Once you’ve done this initial setup, you should be able to add your project to your external version control system of choice.
More detailed documentation on this is available on the Unity website.
SVN
The aforementioned documentation has some details on setting up a project in SVN. Effectively, this is all done via the command line. For me, this is fine, but I’m sure there are plenty of people who’d rather have a visual client to work with. I’ve not been able to find any svn plugins for the Unity UI yet, so you may need to use one of the standalone clients. There are plenty out there to choose from – I’ll just link to the handy Wikipedia comparison page rather than discuss any in particular.
One issue you’ll have with SVN (and the other version control systems listed below) is that it will try to merge binary files, meaning you will possibly end up with broken scenes/prefabs etc. There’s a useful discussion on Unity Answers about how people have tried to resolve this issue.
Short of having to lock on a scene/prefab etc, there appears to currently be no easy way to deal with multiple people being able to edit/commit these, unless one person is responsible for combining all the changes. Not ideal.
Looking at the Unity roadmap for 2011, the following (hopefully in the 3.5 release) should fix this issue:
“Text-based scene/prefab/… format
Unity will now write all data in a text-based file format for scenes, prefabs, materials and other binary files in your project folder. The format is based on YAML and is optimized for being easy to merge. Multiple team members can work on a scene at the same time and merge the resulting changes afterwards.”
On the same page, they’ve also said they’ll be integrating SVN into Unity 3.5, which will be awesome!
“Integrated Perforce and Subversion version control
We’re working on fully integrated version control support for both Perforce and Subversion. There’s a complete UI including support for file locking.”
Perforce
First a disclaimer: I’ve never used Perforce so this section is very short! I’ve heard a few people mention the use of Perforce in games development studios, so I’ve still researched its use in Unity in case anyone is thinking of using it.
As mentioned earlier, Unity are currently looking at integrating Perforce support in the 3.5 release. For now though, you’ll have to either use a separate command line or client, as per the SVN comments above.
Alternatively, it seems that Downsized Games are working on a plugin for Unity called P4U. The plugin hasn’t been released yet, but you can see some UI screenshots on their website.
Git
Git seems to be a bit of a version control hero for lots of people. For those who’ve not used it, it’s free (yay!) and open source (double yay)! You can find more info on Git here.
Researching its use with Unity doesn’t seem to give much information on any specific issues encountered. That said, there weren’t any specific advantages noted either.
One thing to bear in mind if thinking of using Git, is that while it may be pretty awesome, Unity don’t seem to currently have any plans on the roadmap to integrate it into the Unity UI. This may be a drawback for your workflow compared to SVN/Perforce which will hopefully be integrated by the end of the year in 3.5.
Others
Other version control systems that I’ve seen people mention they use alongside Unity are listed below. Since I’ve not used these before and I can’t find much information on their use in Unity, I’ll simply list them as possible options:
Summary
I initially set about writing this post to give myself a better idea of which version control systems would be best for use alongside Unity. A lot of people seem to like using Asset Server since it is fully integrated in the Unity UI and as such, is possibly better for workflow. That said, Unity are working on integrating Perforce and SVN for 3.5. Given that there are key features missing in Asset Server (branching/tagging etc), the lack of UI integration for a few months seems to be an empty argument.
Since I’ve not used Perforce and already have my own SVN repo set up, I’m going to rock with SVN and look forward to the Unity integration later in the year.