Best p4Ignore for Populating Perforce with UE4 Engine Source?

What is the best practice for ignoring files from the Unreal 4 source when submitting the engine source to perforce?

Some context:

I am working on setting up UGS and perforce from scratch for my team, and am learning about all of these concepts fresh. I’ve found a number of examples for different p4ignore files and opinions on what should and should not be checked into source control, but none of them seem to be definitive. When I use the less restrictive setups, it seems that the number of files that need to be submitted to P4 is massive (168k??), and when I use more restrive setups, I have challenges building the engine once I pull down the source in a new workspace.

References I have worked through but which don’t seem to be complete or conclusive:

Most of the resources out there seem to be for setting up version control for the actual game content, not for engine source.

Thanks for any help you can provide.

1 Like

Same here. They mention that we need a specific p4ignore file even if we load the source from github (loading it from Perforce directly would need a custom license with Epic Games apparently). Unfortunately, the p4ignore file isn’t shared anywhere. Even in the “recent” (2020) stream (Version Control Fundamentals | Live from HQ | Inside Unreal | Livestream) they only mentioned access to the Epic Games Perforce server but not how we could setup source build and UGS from github mentioned in the docs (like here: Using Precompiled Binaries in Unreal Game Sync for Unreal Engine | Unreal Engine 5.0 Documentation ).
Maybe @ArranLangmead who hosted the stream can get us at least the ignore file / typemap so we don’t have to painstakingly put it together ourselves? That would really, really help us a lot :smiley:

This way we could pull it from github, move it into p4 and go the UGS route with precompiled binaries. Then just pull updates from github, merge, recompile and let UGS to its thingys.

2 Likes

Hey, there are a few detailed ones available online but I generally just mark the temp and source files for a project to be ignored like this.

# Ignore all Intermediate and Saved directories
*/Intermediate/*
*/Saved/*
*/DerivedDataCache/*
*/Build/*

#Ignore resource files

*/obj/*
*/fbx/*
*/psd/*
*/tga/*

For the engine build you can add a few more

# Ignore root Visual Studio solution files. We do check in some sln files in subdirectories, so only ignore
# the ones found in the root.
/*.sln
/.p4sync.txt

# Ignore all Visual Studio temp files.
*.suo
*.opensdf
*.sdf
/Engine/DerivedDataCache/*
**/DerivedDataCache/Boot.ddc
**/DerivedDataCache/**/*.udd

# Ignore all Intermediate and Saved directories
*/Intermediate/*
*/Saved/*
# Ignore UBT's configuration.xml
Engine/Programs/UnrealBuildTool/*
*.uatbuildrecord

# Ignore built binaries and temporary build files
*/obj/*
*.csprojAssemblyReference.cache

# Ignore UBT's log output files
/Engine/Programs/UnrealBuildTool/*.txt

# Ignore Python cached files
*.pyc
12 Likes

Are you combining these two code sources or just using one or the other? I’m attempting to add a UE5 source-built engine to P4V. Should the build and Intermediate Engine folders be added or excluded?

what are the scenarios that they should or shouldn’t be included? If only I am building the projects, are they fine to include? If multiple team members will be building the project, should they be excluded?

Thanks so much!

One thing to note is you could reference the .gitignore provided by Epic. Theoretically this will stay up to date better.

https://github.com/EpicGames/UnrealEngine/blob/release/.gitignore

You’ll need to join the EpicGames group in github to see this. Here: Epic Games · GitHub

1 Like

Just a little bit frustrating. A lot can go wrong with the engine and it would be nice to have confidence in simple things like a proper .p4ignore file included with the Git distribution since it’s obviously required for a correct p4 setup and you definitely have it in the p4 distribution.

3 Likes

For me I am having an issue with the provided ignore file.

# Ignore root Visual Studio solution files
/*.sln
/.p4sync.txt

# Ignore all Visual Studio temp files
*.suo
*.opensdf
*.sdf
/Engine/DerivedDataCache/*
**/DerivedDataCache/Boot.ddc
**/DerivedDataCache/**/*.udd

# Ignore all Intermediate and Saved directories
*/Intermediate/*
*/Saved/*
# Ignore UBT's configuration.xml
Engine/Programs/UnrealBuildTool/*
*.uatbuildrecord
*.tmp

# Ignore built binaries and temporary build files
*/obj/*
*.csprojAssemblyReference.cache

# Ignore UBT's log output files
/Engine/Programs/UnrealBuildTool/*.txt

# Ignore Python cached files
*.pyc

# Ignore JetBrain's IDE folders
.idea/
!.idea/runConfigurations
.gradle/

# Ignore autogenerated files from HoloLens WMRInterop
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/*
/Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/*

What happens for me is that when I do p4 opened I get a list of files changed inside Intermidiate and Saved directories like so:

//ROOT/Intermediate/PipInstall/merged_requirements.in#2 - add default change (text)
//ROOT/Intermediate/PipInstall/pyreqs_plugins.list#2 - add default change (text)
//ROOT/Intermediate/ReimportCache/3688439234.bin#2 - add default change (binary)
//ROOT/Intermediate/ShaderAutogen/PCD3D_SM5/AutogenShaderHeaders.ush#2 - add default change (text)
//ROOT/Intermediate/ShaderAutogen/PCD3D_SM6/AutogenShaderHeaders.ush#2 - add default change (text)
//ROOT/Intermediate/TargetInfo.json#2 - add default change (text)
//ROOT/Saved/Config/CrashReportClient/UECC-Windows-3A6342AD45FE0BC72391ACB8D8633AE7/CrashReportClient.ini#1 - add default change (text)
//ROOT/Saved/Config/CrashReportClient/UECC-Windows-C4DFB2114E00044B7C38F287EC54FF7F/CrashReportClient.ini#1 - add default change (text)
//ROOT/Saved/Config/CrashReportClient/UECC-Windows-D4CEC832433E8B2F8FE581AF1CFC6C40/CrashReportClient.ini#1 - add default change (text)

and a lot of these all the time when switching.
Is there an issue with the ignore?
My workaround always when switching stream is to do a revert on these files but it is annoying…
Anyone encountered something like this?

Here is what we use right now and it appears to work ok so far. We don’t want our artists to have to build so we actually include the editor and plugin binaries.

# A great primer on p4ignore https://portal.perforce.com/s/article/6510

.vs/

Build/
DerivedDataCache/
FileOpenOrder/
Intermediate/
Saved/
*.pdb
*.sln
*.vcxproj
*-Debug.*

# Ignore Mac desktop services store files
.DS_Store

# Ignore linux project files.
*.user
*.pro
*.pri
*.kdev4

#Linux Debug Files
*.sym
*.debug

#We ignore most binaries since they aren't relevant. For example shipping binaries that get created when packaging the game.
Binaries/

# We want to allow plugins to not have to be built on developers' individual computers
!/Plugins/

#We want to allow editor required binaries so people don't have to build themselves

!/Binaries/**Editor*

# But continue to ignore intermediate
Intermediate/

#Files we want to add to the depot but remove from people accidentally touching/
*.vsconfig
1 Like