x


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.

more ▼

asked Dec 07 '09 at 02:32 PM

Ricardo gravatar image

Ricardo
5.5k 20 33 98

Removed pro-only tag, as the discussion on vcs workflow is also relevant for people without Unity Pro.

Apr 01 '10 at 08:29 AM Ricardo

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 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."

Sep 19 '11 at 04:01 AM yoyo

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.

Mar 09 '12 at 06:42 AM yoyo
(comments are locked)
10|3000 characters needed characters left

8 answers: sort voted first

In the early days of Flash game development, when having a .fla was required, before ActionScript-only projects were possible, a big rule we had was to put nothing in the scene, nothing on the timeline. The .fla only contained a single line of code, which called main() in our external code files. Assets/data were kept elsewhere.

We are doing the same in Unity, to solve the same problem of a highly shared binary file. We don't attempt to share the file, but rather, make it so this file is insignificant, or infrequently changed.

Essentially, we have 2 tools; one which goes thru the scene and exports the representation to an xml file, and another which rehydrates the scene from that file... which is used during both design-time and run-time.

Our workflow is, we source control the xml file and an almost empty scene. When someone wants to work on the scene, they load from xml, modify the scene, store to xml, and then we can merge the xml files.

Another advantage to this approach is that in the xml file, instead of storing the position for Prefab X, we store it as the spawn point for MobID X (conceptually). This allows us to create more of an abstraction between the "mechanical" art assets and level design, so each can vary independently. Even doing this, the content of our scenes is limited. We data-drive as much as possible. (We actually don't have spawn points, but spawn regions. We don't place monsters with items, we have xml drop tables.)

This also solves another problem we have; which is our server isn't Unity, but still needs a representation of the world we can easily keep in sync.

more ▼

answered Dec 08 '09 at 08:39 AM

Lance Sun gravatar image

Lance Sun
1.2k 14 18 42

Could you give a little more details on this solution? For example are these 2 tool custom made by your team?

Mar 25 '10 at 12:30 PM John_

This is a workaround, albeit an elegant one. Is it really true that the best answer to "How do you use version control with Unity scenes?" is "Don't"?

Mar 18 '11 at 11:29 PM yoyo
(comments are locked)
10|3000 characters needed characters left

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).

more ▼

answered Mar 30 '10 at 10:08 AM

Erik Harg gravatar image

Erik Harg
166 1 2 4

It's an interesting project. Too bad Unity doesn't expose all component variables.

Apr 09 '11 at 10:59 AM Statement

It's really a interesting project. I wonder if TextScene can compatible with Unity 3.3.

Jun 15 '11 at 07:43 AM jose

Unity 3.5 will switch serialization to yaml text files, at which point TextScene will be redundant.

Jul 20 '11 at 05:50 PM yoyo
(comments are locked)
10|3000 characters needed characters left

Updated for Unity3.5:

All Unity versions (including Free) now support version control.

Steps:

  1. Goto Edit -> Project Settings -> Editor and enable External Version Control support by selecting Metafiles in the dropdown for Version Control.
  2. Then checkin the Assets and ProjectSettings to your SVN but ignore the Library Directory.
  3. Quit Unity and Delete the Library directory.
  4. 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

more ▼

answered Mar 09 '12 at 02:11 AM

manavkataria gravatar image

manavkataria
161 1 3 5

Also, the version of MonoDevelop that ships with Unity 3.5 has integrated git support, a highly useful addition to the version control workflow!

Mar 09 '12 at 06:37 AM yoyo

Does this address the issue of merging binary files?

Aug 11 '12 at 06:51 PM Swift_On_Fire

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.

Aug 13 '12 at 04:45 PM yoyo
(comments are locked)
10|3000 characters needed characters left

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).

more ▼

answered Dec 08 '09 at 06:11 AM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.9k 21 30 74

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Dec 08 '09 at 08:14 AM

user-485 (google) gravatar image

user-485 (google)
17

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x78
x75

asked: Dec 07 '09 at 02:32 PM

Seen: 25798 times

Last Updated: Nov 07 '13 at 11:16 PM