So, you’ve just taken on a client or you’re at a new job and you have been given a Perforce login. If you’re worried because you have never used Perforce before, do not panic. I am here to help you out. Before we start, please make sure you have a Perforce login, which usually consists of
- A Server Address with a port number (An example: 192.168.0.1:1666)
Once you’ve confirmed you have these, go ahead and download P4V (also known as the Helix Visual Client). Once downloaded, go ahead and install it.
When P4V has been successfully installed, open P4V and you’ll be greeted with the login screen:
In the server field, enter the server address you were given (port included if your server address came with one. This should look something like 192.168.0.1:1666. After this, type in your username into the “User” field. You’ll notice there is not a place to enter your password in yet, this is normal.
Once the server IP and User name have been inputted, press the “New” button next to the “Workspace” entry field (please leave the text field for Workspace blank for now). Once you’ve done this, you should be promoted to enter in your password. Go ahead and do that now. Once you’ve been authenticated successfully, you’ll be taken to the Workspace menu.
You can change the Workspace root (which I highly recommend doing so) by pressing the “Browse” button next to the “Workspace root” text entry field. This is where all the files you pull from the server are going to go.
In the screenshot above, you can see that the auto-generated path for this particular installation is “C:\Users\conta\Perforce\P.Jackpots_DESKTOP_OJJP1Q3_9583”. There are a few problems with this:
- This is on an SSD and a large Perforce repository is going to cause some real damage with excessive read / write.
- The folder path is very hard to memorize if you have a number of different Perforce depots on your computer. How would you be able to tell them apart without having to manually open each folder up?
- Unreal Engine 4 has a file path limit of about 260 characters. Anything higher will cause cooking issues and more than not, will result in total cooking failure. If you’re planning to cook builds locally, you’re going to want to put it in a folder path that is much smaller than the “C:\Users\conta\Perforce\P.Jackpots_DESKTOP_OJJP1Q3_9583”. When you take into account that the project files and folders are included in this file path limit, you really need to place the Perforce in a folder that’s easy to remember and has as short of a URL as possible.
In the “Workspace name” field, enter a memorable name that will help you remember what this depot contains. If it’s a client, client name and project usually works well. For example, if you were working for me on a UI project, “KIT_UI” would be a good choice. Be careful because I believe the server administrator and other users can see this workspace name, so use an informative but professional name.
Once you’ve set a name and workspace root, press “OK” and then “OK” on the login screen.
Perforce will now login and you’ll be greeted with main Perforce UI. Looks very 90’s, right?
You’ll see two tabs in Perforce; Depot and Workspace. Depot is the files that the server has and Workspace is what your local copy has.
Go ahead and press the “Depot” button. Click the root folder and then on the top ribbon, go ahead and press the “Get Latest” button. This gets all the files from the depot and copies them to your local workspace. If the client or administrator want you to pull a certain folder, click that folder instead of the root.
Once completed, press the “Workspace” button and find the .uproject file of the Unreal Engine project and double click it (or, you can just open it up via your Explorer if that’s the way you want to roll).
When the Unreal Engine 4 project opens, wait for all your shaders to compile. Once they’re done, press the “Source Control” button in the top ribbon and select “Connect to Source Control”. When the dialog opens, select “Perforce” as your provider.
You should see your server and user name auto populated. If not, enter them by hand (remember the port as well as the IP address). Normally, this should be auto-filled. If not, make sure you’re logged into Perforce and the project you’re opening is in a sub-folder of your Perforce Workspace.
Press Available workspaces. If you’ve done everything correctly, you’ll see your workspace. Select it. If not, make sure Perforce is open, running and you’re logged in and ensure that this project is the correct project that you should be working in.
When ready, press “Accept Settings”.
You’re now connected to Perforce!
From here, there are a few things to do in your day to day workflow on the project.
When you start your day, or after a short break, you should make sure Unreal Engine is closed – go to P4V and press the “Get Latest” button. This will stop merge conflicts if everybody does this.
Another way to reduce merge conflicts is when you have an asset you’d like to edit: Make a minor, quick change and save it to “check it out” of Perforce. This means others can’t edit it.
Just make sure that you communicate with your team and make sure to submit your changes in as short of a time as possible so other team members aren’t locked out of the file for too long.
At the end of the day or before a break, you should make sure you have submitted your changes. Go to Source Control button within Unreal Engine 4 and press “Submit to Source Control”. Fill in a helpful changelist description of the work you’re filling in, confirm the files you’re submitting and then submit!