Version control, sometimes called source control, is the process of using a program to manage multiple versions of a software project, typically saving things in a remote database or similar structure. There are many version control packages available, including CVS, ClearCase, Perforce, and Git, the last of which has risen to great popularity in the last few years.
There are several advantages to using a version control package, with some of the major ones being:
- All changes are backed up, so if data is lost or accidentally erased on your machine you can recover it.
- By looking at the various revisions in the system, you can follow the flow of changes. This can really help out in triaging bugs for complex projects.
- You can work on several different versions in parallel and do an automated merge at some point to join the code from two or more versions. This comes in handy if you have a stable version that you are submitting to the app store, and a an experimental one with unfinished changes. In team projects where a single source file or module can be worked on by several people at once, this is even more important.
For any project that has more than two or three people, I’d say that source control is a necessity that can save hours if not days or work, especially for complex projects. Most of the projects I worked on in my day job used some form of version control.
However, for a hobby developer that is working on a game by him or herself, the advantages are much less. I’ve tried to use Git for one of my hobby projects, but ended up never needing it. This may be because of some habits I have developed over time. For instance, when I am going to make a major change to a function I often will copy that function, and keep the original one. This makes it easy to go back to the original if I end up breaking something, or decide the refactor I was attempting is not worth it after all. Also, I typically make sure my code is buildable every few minutes, as opposed to writing hundreds of lines of code for hours, and then trying to build. If you get a compile-time failure in that scenario, it can take quite a while to figure out where things are broken, and source control can potentially help there.
Instead what I do is simply zip my entire project directory and email myself once a day, so I have both a basic backup and ability to check previous versions. But I’ve almost never needed that, I do it primarily for peace of mind just in case my machine’s HD crashes – something that has happened more than once.
If you are on a Mac, you can use the Time Machine feature which will allow you to look at older versions to see what changed. However, unless you buy something like an AirPort Time Capsule or similar external storage solution, you are not protected against data lost. I just bought one of the capsules the other day, and it was pretty easy to setup.
If you are doing hobby game development by yourself, you’ll have to weight the pros and cons and decide what is best for you. If you don’t have experience with a software version control system, it’s probably a good idea especially if you consider making software development your career. I’d recommend Git since it’s popular, free, and you can set it up initially using just one machine (and expand to a remote machine later if needed).
Even if you are working on a hobby game with a handful of people, depending on how well segmented the work is you may not need a source control. For example, if one person is working on art, one on coding (implementation), and one on testing and story, then you may be able to craft a workflow which doesn’t require source control.
One more advantage of using source control even if you are working alone, you always have the option of easily sharing your code with people around the world, especially if you are using an internet-based system such as GitHub. This makes it easy to grow your team if things go well.
Are you hobby game developers out there using source control?