So I thought I’d post this as working with version control has saved my bacon multiple times. While there are obvious and well documented benefits for teams of people, there are also significant benefits for someone working alone.
The basic principal of version control is that after making something work, you commit the changes to a server. The server keeps track of the changes between successive versions in a repository (repo). This works best with files that contain text (ie. code), but the server can typically also handle binaries.
There are different version control systems out there, Git being the most obvious. I still use CVS for most as my stuff as I’ve been doing version control for longer than Git has been a thing. I don’t want to get into the differences between them, they largely have the same features. Each version control system has its own commands, some have user interfaces, and most IDEs have integration built in or pluggable for common version control systems.
Here are some scenarios where version control has helped me:
Has to be a common reason why game development comes to an end. With version control you’ve an offsite backup of the latest working version. Fix your machine, pull the latest version from the repo, and you’re back up and running.
What did I just do?
Everything’s just stopped working, but why? Was it something that got changed unintentionally? Ask your version control system what has changed between the last working version and where you are now. Your IDE will likely have a way of looking at the current version and the committed one and allow you to revert selected changes. This is also useful if it is your IDE that has had “a moment” and broken the source in some unspecified way.
Working on two machines
You usually develop on your desktop, but put a copy on a laptop to work on when travelling. You did some work, but now you can’t remember what you changed. If you’ve been working with version control then it can show you what you’ve done, and you can commit the good stuff.
Working on Windows and Mac/Unix
Windows has an unconventional text file format. Version control systems can automatically handle the simple text conversions needed to move files from one system to another.
I’m sure I fixed this before, it used to work, when did it break?
Version control can also determine changes between previous versions. You can go back and see what’s been changed between two old versions too.
I need to go back and fix an old version
So you’ve got your current development (dev), an early access version (v4), and a public version (v3). Someone finds a bug in the public version - it’s got more eyes on it, so this is quite likely. This is where some more version control features come into play: tag, branch, and merge.
- When you make a release you tag it, basically saying this version of the code creates a release. Now you can rebuild that release precisely any time you want.
- The bug report comes in, relating to v3. Use version control to branch the development at v3, fix the bug, and release the updated version to the public.
- That bug also needs to be fixed in v4. Use version control to branch the development at v4 as well. Rather than try and reproduce the edits you made to v3, you can merge the v3 changes into v4. This can be largely automatic unless the same line of code was changed by v3->v4 and the v3 bug changes.
- Finally the change can be merged back into the dev version ready for the next release.
And if/when you do build a team …
Just point your new members at the repository!
- It’s something else to do, and takes a little time to learn.
- Version control works best with files containing text/code rather than binaries - it can’t show changes between two binary files.
- It works best when the source is in multiple smaller files. So something like a Twine game with everything in one file is more cumbersome to work with than the same game built with Tweego with one file per passage.
I hope that helps someone!