Perforce & Unreal
Getting started Both Epic's live streams present setting up and using Perforce. https://youtube.com/ywu4l1RTFPU https://youtube.com/JxXydvG4mlI Using Perforce as Source Control - a page from the of...
Getting started
Both Epic's live streams present setting up and using Perforce.
- Using Perforce as Source Control - a page from the official engine docs
Using Perforce
Perforce system has "users" and "workspaces" which can be confusing before you start using it, especially when looking at licensing terms. Albeit it's very simple. Generally, Perforce is very easy to use for non-tech savvy people.
Users
Access levels are set per user.
- There's special Admin user, usually the first user auto-created while opening P4Admin for the first time. It has all privileges, configuring other users, groups, depots, access restrictions. All the power.
- Regular users can have different access to data on the server. For instance, Design users read/download the entire project, but modifying anything in the engine folder is blocked. This prevents accidental changing some engine's content. Also, regular users never download folders with the source code (it's approx. 100K files in engine's Source folder).
- Now Code users are allowed to changed anything in the engine folders and see all the code, but asset sources are hidden from their view (if such sources are stored in the repository). This way programmers simply never download files used by Digital Content Creation tools, like Maya or FMOD.
- FMOD project and sound sources would be visible only to Audio users.
Also, every user can have a different password. Although many studios set the same password for every developer. Simply, nobody needs privacy on a team-shared repository. And this makes things easier if a given person goes for a long vacation, but someone else needs to access files locked by this person.
Workspaces
All the operation on files, commits and changelists are bound to the workspace, not user. This way every user could use multiple workspaces.
-
- One workspace used in the office, another one while working remotely.
- Or your default workspace belongs to Code user, so you can download and compile the code. But sometimes you want to access FMOD project to test a game feature related to FMOD. You can simply a new workspace under Audio user just for this purpose.
Your personal preferences are saved to the workspace.
- You can change folder mappings, i.e. Unreal project could be synced to "C\MyProject" folder, but a folder with the custom engine could downloaded elsewhere, i.e. "D\Engine".
- You can also exclude specific folders or files from being ever synced.
Advanced tab in the workspace settings window hides many useful things.
Tricks
Store only the last version of filetype
You can tell Perforce to store only the last version of the file, by filetype. This is useful for debugging symbols (.pdb) - a single version of symbols for the compiled engine is about 20 GB. Just add the following line to your p4 typemap.
binary+Sw //....pdb
Useful links
- Start Collaborating with Unreal Engine and Helix Core
- Allar's Blog - Populating Perforce With An Unreal Engine Source Build
Talks for advanced users, presenting Epic's take on branching. Also showcasing Unreal Game Sync - which is tool based on the Perforce.