- Home /
Version control workflow
Unity supports external version control in Pro, and has Asset Server for those who wish to license it. Neither version would seem to be very merge-friendly, so I'm curious to hear various workflows for having several people working on a scene simultaneously.
Removed pro-only tag, as the discussion on vcs workflow is also relevant for people without Unity Pro.
The Unity roadmap says that Unity 3.5 will include text-based scene and prefab support, which will be a huge step forward! "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 YA$$anonymous$$L and is optimized for being easy to merge. $$anonymous$$ultiple $$anonymous$$m members can work on a scene at the same time and merge the resulting changes afterwards."
Until recently we've had labelled washers hanging on the wall of our studio for the most popular binary files in our project, including several scene files and some key prefabs. If you want to work on those files, get the washer first! We recently virtualized the washers with trello.com. We also just upgraded to Unity 3.5 and text-based serialization, so merge conflicts should be fixable (with caution) as opposed to in the past where one person had to redo their work.
Answer by Erik Harg · Mar 30, 2010 at 10:08 AM
You might want to check out our newly open-sourced(*) project Unity Text Scene, available at GitHub here: UnityTextScene project.
As it currently says in the README:
The TextScene system is intended to be a complete replacement of the Unity built-in binary scene format. The reason to hack together and use such a format, is because it is very difficult, if not impossible, to merge scene conflicts in a team environment using a binary scene format. If you don't care about diffable scenes, you should avoid this (one-man teams will most likely not benefit at all from this, unless you desperately want scene history).
(*) The code is available under an MIT license (see the LICENSE.txt file in the project).
It's an interesting project. Too bad Unity doesn't expose all component variables.
It's really a interesting project. I wonder if TextScene can compatible with Unity 3.3.
Unity 3.5 will switch serialization to yaml text files, at which point TextScene will be redundant.
Answer by manavkataria · Mar 09, 2012 at 02:11 AM
Updated for Unity3.5:
All Unity versions (including Free) now support version control.
Steps:
Goto Edit -> Project Settings -> Editor and enable External Version Control support by selecting Metafiles in the dropdown for Version Control.
Then checkin the Assets and ProjectSettings to your SVN but ignore the Library Directory.
Quit Unity and Delete the Library directory.
CheckOut unity from SVN server. Press Option/Alt (recreates Library) and open Unity.
Hope this helps!
Source: http://unity3d.com/support/documentation/Manual/ExternalVersionControlSystemSupport.html
Also, the version of $$anonymous$$onoDevelop that ships with Unity 3.5 has integrated git support, a highly useful addition to the version control workflow!
Does this address the issue of merging binary files?
Git is great for code, bad for binary files. It's distributed, so no file locking. Not bad for mergeable text files, not so good for binary art assets.
You can set Unity to serialize scenes and prefabs in a text format (yaml-based), which is better for version control, but by no means fool-proof -- definitely useful for seeing what's changed, but can be tricky to merge conflicting edits.
Answer by Jaap Kreijkamp · Dec 08, 2009 at 06:11 AM
A way to do it if real source control is not an option is distributing asset bundles with the changes. Beware that there seem to be quite some bugs and differences in the importers/exporters of different versions. My designer works mainly with Unity on PC and I import it into Unity iPhone, but have to make a backup first because often after importing an asset bundle all Unity can do is crash.
Although it's not without problems (mainly the instability of Unity after imports), it is an easy method to work as long as different members of the team do quite separate things. If you have more than one coder, it could be an option to at least have the Scripts under source control (should work with even the free Unity).
Answer by user-485 (google) · Dec 08, 2009 at 08:14 AM
The way my team does it is separate out the assets and the code (zipping up with the package option) and then using SVN to take care of it. When a person downloads the latest updates they just have to unzip the code over the assets and away they go. Then when pieces need to be merged one of the team locks everything down and creates a new build for everyone to work from.
Same goes for scenes, we'll all work on our own version off the base and then one person will take responsibility for copying it all together.
A little fiddly but it works.
Answer by Cameron Eagans · Oct 25, 2010 at 10:37 PM
My company, Black Storms Studios, is working on an alternative to Unity Asset Server at http://github.com/blackstorms/OpenAssetServer
We need programmers to help, though. If you know the EditorGUI class, please contact me!
A project like this one would be a really great addition to the Unity community, but it's currently nowhere to be found on GitHub... Did it ever really get off the ground? Cameron, do you have a URL available? I'm currently not too acquainted with the EditorGUI class, but I'm a bit of a fast learned and off the top of my head I could think of a thousand ways in which the Open Asset Server could be developed and integrated into the daily life of Unity programmers. I'd be very much interested in at least taking a look at the code base, and participating in its development as time permits, if the idea is ever brought back to life.
Rather than building a whole new asset server and version control system, it would be a lot less work and just as valuable to focus on improvements to the integration with external version control.
That is of course the point of the conversation, improving the integration of Unity with external version control systems, not developing a new SC$$anonymous$$ in any way. Problem is that such improvements do require some Unity-side developments for proper integration, because otherwise what you're doing is syncing up the use of two different programs (Unity and, e.g., a command-line SC$$anonymous$$ tool), which is not much of an integration, in my opinion.
Absolutely. Something analogous to how TortoiseSVN integrates Subversion with Windows Explorer seems appropriate -- command line system becomes visual and accessible through tools the user is familiar and comfortable with. In Unity, this would call for a new version of the Project window.