Best way to collaborate with team member on single project?

I didn’t know which forum to post this in. Let me know if I should post it elsewhere.

I am making a game with a friend of mine. We are both using the free version of Unity. I am doing all of the programming and he is modeling all of the assets. We are wondering what’s the best way to go about handling the Unity files?

Right now it seems like we are going to constantly be emailing each other Unity files back and forth every time we add something significant to the project. Is there a better way to go about this? Is there some better way to share files with one another that I am unaware of? I’m guessing there isn’t some magical way where files update themselves across projects through the cloud (wouldn’t that be awesome?)…

Git - you might find a git repository to be useful

I’ve been reading about Git or SVN or a number of other “version control” options available through the asset store. I’m really confused… Just what does the heck is version control for? And how would this be helpful (could you give an example)?

Every time you save a file, it overwrites itself on the disk. In an environment where you’re working by yourself, that’s fine (usually), but when you’re collaborating with other programmers it can get messy really fast.

Imagine that you save a file, and another team member is also working on that same file, and then they save their file- you just lost your changes. Get it? Version control, branches, etc… allows you to see and compare with older versions, see the changes that have been made (not just from you, but from others as well), and make it so that even if multiple people are changing the same older version of a file, they won’t overwrite eachother.

Any more information you’ll really need to get from reading the instructions at GitHub and the like, but that’s the basic idea.

Thank you. I’ve been reading about all of it for the last hour. I also stumbled across this link here http://docs.unity3d.com/Manual/Versioncontrolintegration.html
Now that has to do with the Team License. But I noticed how under the Control Version settings you can do “Get Latest” which says it “Pull the latest changes and update file”. By doing this does that mean it would pull whatever the latest changes were on the server and update your project on your computer (aka if my partner added an object to the scene on his end and it got uploaded to the server - would that object then appear in my scene by using this feature)? Secondly, while this is for the Team License - is this kind of feature available with other SVNs like Perforce or Github?

OK, so I don’t use Perforce or Plastic… but I have used Git, SVN, Vault, and Team Foundation Server for projects through out my career (both in and out of Unity).

So the general way most version control systems work is that you perform commits. You change a whole bunch of files on your computer, save them, and then tell the server you want to ‘commit’ or ‘merge’ those new changes into the current “version” of the project that is on the server.

When it commits the server determines all the differencing information. What’s different about this version with your commits and the last version on the server. A new file was added, an old file was deleted, another file had text added, another file had text removed. And all this information is stored away (usually in a database) and the current files stored. (note - differencing information works best on ‘text-only’ data, this is why it’s suggested to make sure unity has its settings to perform all serialization in text mode, rather than binary).

That “version” on the server is that latest version.

If another user pulls from the server (gets latest) they’ll receive the current version of the project as it is on the server. It’ll bring down the differencing information deleting files that were called to be deleted, adding files that need to be added, and getting the latest versions of files that were changed.

Here’s the thing… what if you’ve changed files locally before calling to get latest. Or what if when I commit, you had previously committed a file that I’m committing as well, but our changes are different.

This is called a ‘conflict’ and it must be resolved. Most version controls will stop the commit or the pull and inform the user that there are conflicts with which ever files. Usually there is some gui that’ll show you the differences between them, and you can decide what to do with them. Of course this usually can also be restricted to specific users in the team… so that only the lead gets to pick which code remains.

Conflicts can be annoying, especially on large teams. Version control does not resolve this issue. And it’s usually up to a project manager to delegate who works on what to avoid overlap of work.

When you’re on a team where ones and artist and the other a programmer, conflicts seldom occur, as you both usually work on different files. The only conflicts we usually have on our team (where I’m the sole programmer) is with some common prefabs, and scenes. And how I deal with that is I just work in my own “DEBUG” scenes where I do my testing, and let the designer move them to the regular in game scenes once we determine the stuff to work.

But when you’re on a larger team, you can have issues. You might have one person working day to day on part of the code, and another going on a week long design process on another part of code. In these situations you’ll probably use things like branching. Where the person going on the exploritory design process will branch off the main project, do there design, and once they confirm it works they’ll go through the long process of merging that branch back into the main code source. While branched any commits they perform to their branch only effects their branch. And any commits on the main code source doesn’t conflict with their branch. They work with whatever version of the code that it was in when the performed the branch.

When you have people working together on the same exact section of code, some version control systems offer ‘locking’ which allows you to flag a file as locked, and if another person attempts to modify it, they get blocked. Unfortunately unity ignores these locks usually and will force files read-write if they’re made read-only. Unity will then screw up data, or worse crash, so I just avoid locks.

5 Likes

Note version control is more than just useful for team projects. It’s useful for single role projects.

This is because it allows you to “version” your code. Everytime you commit, you’re creating a save point in your project that you can return to at a later point.

It’s like backing up your project every time you commit.

You commit, then start on some major changes, and a week passes and all those changes just don’t work. And you’re like “dang, I wish I could go back to what I had a week ago!” Well… you can, just roll back your code to that day, branch off the work you did for that week (for historical purposes) and continue moving forward in a different direction.

IMO - git is great for solo-man projects where you’re doing this sort of thing. The way git operates, when you work in a team, it’s more like everyone is creating little tiny branches constantly that need to be merged back into the main code line.

I also HATE the lack of good graphical user interfaces for git. Too often I’m spending way to much time in some terminal/shell dealing with simple tasks like committing and differencing.

Vault is honestly my favourite system I ever used on a team, but it’s a pay system.

SVN was my preferred for years.

But now a days I use Team Foundation Server… I’m still on the fence about it. It has an integrated ticketing system, which is cool. It’s not worse that SVN by no word, but I don’t know if it’s better enough to tell anyone to adopt it rather than just go with one of the many FREE svn options out there.

3 Likes

You are awesome! Thank you so much for taking the time to explain all of that to me I greatly appreciate it! :smile: This definitely helps clear up a lot of things for me. You mentioned: “OK, so I don’t use Perforce or Plastic… but I have used Git, SVN, Vault, and Team Foundation Server for projects through out my career (both in and out of Unity)” so I was wondering which one you would recommend from all of your experience? From what I’ve read in the last few hours is that they all can be a bit tricky to set up for people new to this kind of thing. Regardless, I’ll take the time to figure it out and learn it - just don’t know which one would work best for my partner and I.

Didn’t see this post until I finished typing my previous response to you haha

I’ve noticed with some of the other choices you’ve mentioned, and a few I found online, that they also have (or sell) the server space. I can’t find anything about that with SVN so I’m assuming you just find your own. Any suggestions where/what to consider when finding a server? Any suggestions. I just read an article about how a guy managed to setup a SVN Repository through Google Drive using TortoiseSVN. I know Unity has there own Cloud Build thing but from everything I’ve read the amount of space they allow you just isn’t enough whether it was the free or low-tier paid version.

Arvixe is where I get my server- I paid two years up front and got it for a song. Doing something through Google Drive sounds like a fantastic way to lose all of your data later when they change how the API works and/or just destroy it for fun.

1 Like

finding server space can be annoying, and they range in price and access.

Free, but with a catch

There are choices out there that are free, but with a catch. They’re free for ‘sharing’ in an open-source manner your project.

The most popular of these is github (yes, github supports svn clients). Thing is anyone can access your projects.

Free, as in free to use
Both git and svn software is free to use. You just need a place to host it.

Thing is… you need a place to host it from, AND you need to maintain the server.

I for instance have two virtual servers (I have free azure access through MSDN, and I have a XenServer I run myself). I can spin up servers for various tasks that I want. I merely spun up a virtual with svn on it (and another with TFS now that we use TFS). I have to maintain it though, and it comes at the expense of the server space I have to use up.

You can do this out of your house. If your host machine is always on, and on the internet, you can use a dynamic-dns service like ‘No-IP’ to generate a url that you can share with your teammates that point at your house. You then route the calls through your router to that machine in your house, and it serves up just fine.

Here’s a tut using VisualSVN (it’s a good windows based svn server… if you run linux or mac, there’s other options):
http://www.hanselman.com/blog/RunningASubversionServerOffYourWindowsHomeServer.aspx

I actually did the in house one for years before I got my own virtual servers with more dedicated connections. I still host the random Minecraft or Unturned server through my no-ip account and home server some times.

Paid
When it comes to paid there’s all sorts of options.

For example, you could rent virtual server space from Azure, Amazon, or the sort and spin your own SVN. This creates a paid for service of what would essentially be the Free service (like how I host mine on azure).

But companies out there will host them for you as well.

Github for example has a paid for service which allows you private projects. For 7 dollars a month you can get 5 private repositories. And like I said before, github supports svn clients if you prefer that:

Temporarily Free

So you know how I said I get Azure for free through MSDN? Well if you have MSDN you get some free Azure credits, as well as free Team Foundation Server hosted on Azure (it’s a virtual spun up and pre-configured for TFS, no fuss).

Thing is MSDN is EXPENSIVE (like a few grand per user per year).

But, Microsoft offers free MSDN subscriptions under a few projects:

Dreamspark: free msdn sub for students
https://www.dreamspark.com/

BizSpark: first 3 years of MSDN for free if you’re a startup company in the tech field (this is how I get it)

4 Likes

bitbucket has free, private repositories for both Git and Mercurial for up to five team members, so since you’re just two people, that’ll be plenty.

If you go with any of those, SourceTree is a commonly used free GUI client if you don’t want to teach your modeller to use the command line, or don’t want the hassle of managing it yourself.

EDIT: also, git is super-powerfull and working with SVN will slowly eat away at your soul.

3 Likes

bitbucket looks good

also, I guess I don’t have a soul to be eaten away. (honestly, I’ve yet to witness this great power git has)

Thank you guys for all of the feedback! It is all greatly appreciated. So much to learn and so many different options to consider… also happened to see this https://www.assembla.com/repositories where it seems like they handle repositories for quite a few things; however, just like the other options I don’t know whether it is a great thing or not due to my lack of knowledge with all of this. I feel like I know so little about any of this that I’m just going to have to pick a version control method, decide on a server, and just give it a go to get some experience with the whole thing.

1 Like

Here is version control for dummies. It’s exactly what I use.

  • Download and install GitHub desktop.
  • Create a new repository. Set the .gitignore to Unity. Set the local directory to the root directory of your Unity project.
  • Commit everything. This initial commit may take a while.
  • Open unity and do some stuff. Save it.
  • Go back to GitHub desktop. You will see a list of if changes to your project. Write useful details in the description and do a commit.

That is version control. Run with this for a few days or weeks until you understand the process and are comfortable. Then set up a sever repository.

  • Go to bit bucket and sign up for their free plan.
  • Create a new repository.
  • Copy the URL for the repository
  • Go to GitHub desktop and open the repository settings. Click remote. Paste in the URL.
  • Click sync. The initial sync may take a while.
  • Your repo is now on the server. Use bit bucket to invite your friend to the repo.
  • Regularly hit sync in GitHub desktop to keep your project up to date with your friends project.

There are a ton of things you can learn about how and why version control works. But you don’t actually need them to start using version control.

6 Likes

No matter what you do ( @Kiwasi 's plan is a good one), be sure to go to Edit->Project Settings->Editor, and set “Version Control Mode” to “Visible Meta Files”. Every file in your project has an associated .meta file, and they should be shared between team members, so they need to be visible no matter which version control system you use.

It’s also important to not include the Libraries folder, regardless of system. Step 2 from Bored’s plan above takes care of that in point 2 (the .gitignore), and there are ways in all of the systems to disregard folders.

The libraries folder is simply cached data that allows Unity to work with your files faster. You can delete it, and it’ll be re-created automatically. Since it is rather large (~10% of the project size), not including it in version control saves time and bandwidth.

3 Likes

You guys are awesome :slight_smile: I will give it a go. Thank you so much for all of the feedback I greatly appreciate it :smile:

Life got crazy busy so I haven’t had a chance to do all of the things you suggested. I plan on giving it a go tomorrow. I just had one question about your advice. You said to sign up for the free plan at bit bucket so I can set up my repository. Since the free plan doesn’t allow any private repositories doesn’t that mean there is great risk that someone could stumble across my game files and essentially steal my game?

I mean I figured you suggested the free one so I can get practice understanding how all of this stuff works :slight_smile: But since I don’t fully understand how github works I wanted to ask.

if you go the git route this could be very helpful to you
https://gist.github.com/cmcpasserby/9cee07031897ec4774a8

its a ignore file for most of the stuff you shouldn’t bother putting in version control

2 Likes