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.

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.

1 Like

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
11 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

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.

1 Like