Let's start off by assuming you're like me, otherwise this blog post might not be for you. And when I say you're like me, I mean:

You love Unreal Engine (UE4). You love Perforce (P4). You DON'T love GitHub.

I know, there are millions (thousands?) of engineers crying out in horror right now. GitHub is SO POWERFUL! SUCH SPEED! MUCH ADVANCED BRANCHING! Welp, as someone with 12 years of game development experience using exclusively Perforce or Perforce-like source control solutions, I'm hard pressed to make the leap for such a drastic reduction in ease of use on my very simple project. So, when I setup my UE4 code project, the first thing I did after successfully building the solution was download Perforce (it's free for up to 5 users) and get myself a more familiar/friendly source control.

But...what happens when you need to update engine source code to latest release version of UE4 via GitHub? How do you reconcile such an incompatible P4 alliance? Hopefully I can shed some light on that. It ain't the prettiest, but it ain't so bad, either. Additionally, since I haven't found any write ups on how to sort all this out in one place, I'll aggregate basic info for getting UE4 up and running w/ P4 in this post, as well.

An Argument For Source Control

First things first: YES, you need source control. Now. Not later. Doesn't matter if you're just a one man team. If you think dragging copies of your project onto an external hard drive is really going to help you when shit hits the fan, you're playing with fire. Or, maybe shit doesn't hit the fan and you just need a quick diff to remind yourself what you've changed to help track down a new bug you just created. Either way, I promise you'll be bigger, faster & stronger with source control behind you. It's worth the initial investment of time to setup.

For a much more exhaustive argument and breakdown of how important source control is, check out this amazing article written by Ash Davis. No stone left unturned there.

Initial Setup

Epic does a pretty great job of helping you get your first build of UE4 running with source code from GitHub. If you haven't gotten that far yet, follow this link and then come back once you've figured it out. NOTE: I highly suggest using Atlassian's SourceTree app for your visual GitHub client.

In addition, I'm assuming you have some basic familiarity with P4. At the very least, you need to setup a server depot & client on your machine. Follow this link to do that in about 5 mins.

Setting Up Your Workspace

Now that you've got a working UE4 code build, a local P4 server running and you've setup a P4 client, it's time to add files to the P4 depot...BUT WAIT! You should update your workspace with some exclusions first so you don't add any files to the depot that should only be on your local machine. To do that, edit your workspace by choosing the option here.