Every project needs a version control system

From UE4: Community Wiki
Jump to: navigation, search


Explained by Epic[edit]

Epic guys recently recorded not one, but two live streams explaining the basics of source control! Watch it to understand how it works.

  • Both are focusing on Perforce while presenting an example of the working system. Although the workflow with other systems wouldn't be extremely different.

Choosing system for you[edit]

Unreal Engine 4 supports four 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.
  • 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[edit]

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. Nothing beats P4 when it comes to speed of operating on binary assets and compressing version history on the server. It was created for companies changing terabytes of data daily, more like NASA.
  • 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.
  • 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 the single version of every asset.
  • 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 a server to keep only the last version of the asset.
  • It can be used for free up 5 users and 20 workspaces. It is common to have multiple developers work with one user (a workspace per developer). Though strictly speaking the license dictates each user to be one party.
  • Paid licenses are perpetual, no subscription plans. There's no official price on the website, but developers say it's few hundreds of dollars per license.
  • As proprietary software, there are not many 3rd party online solutions integrated with Perforce. However, Atlassian's Crucible integrates Perforce with Jira.

Learn more about why Perforce could be the best choice for you in the long run: Perforce & Unreal.

Git[edit]

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 designed for efficient handling of 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 usable for small gamedev projects. Don't expect to handle binary assets as well as systems designed from scratch for this purpose.
  • Git is a free and open-source distributed version control system. It's everywhere, difficult to find a 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 assets 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 & 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.
  • Since Git is open-source, there are many online solutions nicely integrated with it, i.e. Azure DevOps.

Learn more: Git & Unreal

Subversion[edit]

It's probably the simplest system to start with. It has been a popular middle ground between P4 and Git for years.

  • Apache Subversion is an open-source project maintained by the Apache Software Foundation. Free to use forever.
  • Designed to support binary assets. The system supports file locking and uses a central server, a similar model to Perforce.
  • The most popular UI client would be Tortoise SVN, similar to Tortoise Git.
  • There's also SilkSVN - Windows command-line client.
  • Its popularity decreases because of recent Git upgrades (LFS, file locking).

Learn more: Subversion & Unreal

Plastic[edit]

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 & Unreal