Every project needs a version control system

Introduction The concept of version control has been around ages, and all software development companies that sell their product use one, because it guaranties them safety over their product. (Mean...

Updated over 3 years ago

Introduction

The concept of version control has been around ages, and all software development companies that sell their product use one, because it guaranties them safety over their product. (Meaning it won't be lost in a file corruption, for example.) Version control is term when a developer hosts their code in the cloud, that can be dynamically accessed, edited, or reverted to a previous version. (Hence the name) There are numerous systems, that do not provide hosting or actual control. They just provide the infrastructure needed to transfer your code and access it. (Such as Git or SVN). Different systems use different schemes, but there are some functions every system has. Than there are the actual software that are managed by hosting companies such as Github or Perforce. These are the guys that will actually give you the cloud to store data, data that will be transmitted to them by the system from your computer.

How it actually works

There are some functions that every system has, regardless of special features:

  • Commit: Committing is when you make a snapshot of the changes on your computer. This is only local, but it contains everything to be in the cloud. Such as: Changed files, what changed in them, last date modified, modifier person, time of commit, internal version.
  • Push: This is when the snapshot and the changed files go in the cloud in a standalone version.
  • Revert: This is when you made a big mistake and want to download a previous version of your project, because for example: Unreal locks up when you want to open it. You choose the version (aka the snapshot) and the hoster will give you the files associated with that version, not excluding files that weren't touched in that snapshot.
  • Lock: This will lock a file to only you, so nobody can commit if the file is in their change list.
  • Branches: Different place to put your snapshots. One branch might be outdated, because the last time you pushed to it was a year ago.
  • Merging: This is when Branches get merge into one and another, or they go into the master branch. For example: Every weekend, you merge the renderer branch and the framework branch into the master, so the software is up to date.
  • Company management: Sometimes it's called workplace management. This is how you keep track of who and where. Using Github, you will need an account, than a company account can lets you in, so that you have access to the project that you're supposed to be working on. When using their client to push to that project, your account will be your identifier. This is done differently in Perforce, as there you will have a workplace assigned with a bunch of other values, but that is understandable, as that software is mainly designed for enterprise applications that have thousands of developers across the world.

Choosing system for you

Unreal Engine 4 supports 4 version control systems. We describe every system for you, so you can make an informed decision on which system you gonna use.

  • Keep in mind, you could use different systems for different needs, i.e. using Perforce for your internal projects, but Git to grab projects from GitHub (Unreal Engine source would be a prime example).
  • Forcing yourself and the team to use a single solution for everything might be a bad choice.

{note|Whatever system you'd choose, remember that you need to host your server somewhere. Either is this your home/office (free of charge) machine working 24/7 or cloud solutions. We plan on adding separate articles describing hosting solutions.}}

Perforce

Perforce (P4) is a standard choice for every big studio. Also for every small studio founded by people who already worked with, they don't even look at other solutions (even if they use Git for different things).

  • P4V client is designed around support for binary assets (most of the content in every game project) and ease of use for non-programmers (most of the team members).
  • It's a system designed to handle the enormous amount of binary data, for repositories where the single version of data is counted in terabytes.
  • The entire repository (all version of all assets your team ever submitted) can take only a few terabytes for AAA games (hundreds of thousands of commits or more).
  • Support for file locking it's here since forever - this is a crucial feature, prevents other people from editing binary assets when you edit it.
  • It can be used for free for up to 5 users and 20 workspaces.
  • Paid licenses are perpetual, no subscription plans.
  • Perforce uses a centralized server, the client connects to the server every time the file status is about to change. The advantage is that P4V client doesn't download gigabytes of meta-data to your machine, just your assets.
  • You can easily configure which asset types use "exclusive checkout" (file locked while you edit it) or "writeable" (no file locking, typical for source code and binaries). You could even set server to keep only the last version of the asset.

Learn more about why Perforce could be the best choice for you in the long run: Perforce vs Unreal. This page also debunks myth "Perforce is only free up to 5 developers".

Git

Git is the most beloved system of programmers. Definitely the first choice for a person who uses it for versioning the source code, especially if already contributed to open source hubs like GitHub.

  • Nothing beats Git when it comes to supporting multiple code branches, super-easy merging changes between branches and much more code-related operations.
  • The thing is Git wasn't initially designed for binary assets. However, in recent years it got support for Large File Storage (support for efficient versioning of binary assets) and file locking. It's not enabled by default, but it's easy to turn it on. This makes Git gamedev-friendly.
  • Git is a free and open source distributed version control system. It's everywhere, difficult to find programmer who didn't use it already. And that's the reason why they would want to use Git for gamedev project without evaluating anything else.
  • Git system doesn't enforce you to use specific clients. The most popular ones are Source Tree, GitHub Desktop, Tortoise Git.
  • This is system is truly distributed, which means it doesn't need a constant connection to the central server.
    • It creates special .git folder in your local copy of the project. This allows easy and fast switching between branches locally. You can easily create temp local branches, play with the entire codebase.
    • When you submit a change, first it sends changed asset to this folder. And then you need a second step submitting a change to the actual server.
  • Keep in mind, Git clients aren't that friendly for non-programmers as competitors.
    • If you're surprised by this statement, please check Perforce vs Unreal describing useful features of P4 client in daily gamedev work. There are reasons why studios using P4 keep using it.
  • And it's awesome support for branching can be useless for your project.
    • Small gamedev project often use only a single branch (merging binary assets it's a hell), with rare branches for making demo.
    • Although games updated every single week after release can use branching extensively. Remember that working on multiple branches would still be limited by the Unreal itself (using tons of blueprints which are difficult to merge). You might need to develop a game in certain way to fully utilize branching with any VCS.
    • Branches are obviously useful while working on a large codebase with many programmers, i.e. your own engine. Still, Epic uses Perforce internally. Git is used to publishing the engine's source to everyone for free.

Learn more: Git vs Unreal

Subversion

  • Apache Subversion is an open source project maintained by the Apache Software Foundation.
  • Centralized version control system - meaning the full repository is only stored on server.
  • Clients check out single revision of files, only server has full repository.
  • Supports file locking.
  • Most operations (checkout, branch, commit) require network connectivity to the server
  • Official documentation
  • Windows Clients:

Plastic

It's a new kid in gamedev.

  • It attempts to offer advantages of Git and Perforce in a single system.
  • There's a free plan, but the essential features are available only if paying the subscription fee.

Learn more: Plastic vs Unreal

Official docs