Recommended project directory structure?

We are working on setting up a UE4 C++ project (eventually multiple projects developed in parallel against the same engine) using GIT and are wondering what the preferred/supported path forward is in terms of source code layout.

As far as I can see there are 2 options (and a third that would be nice but doesn’t work).

option 1) We have two repositories we manage, one for UnrealEngine (which we fork and slightly modify), and one for our Game+Plugins that somehow references the engine repo.

option 2) we have a single monolithic repository that contains Engine, Game and Plugins side by side that we occasionally merge new releases of UE4 into.

option 3) this would be nice but doesn’t work due to UE4 trying to install git hooks, but it would be to have a submodule for the Engine and separate repositories for each Game.

Content directories would be managed separately by Perforce in all thee options.

I prefer to stay on the beaten path as much as possible and was hoping to find an officially recommended repository structure we can follow to avoid any unforeseen future consequences. Thanks!

Hi there…

Strongly recommend that you review Allar’s Style Guide located: GitHub - Allar/ue5-style-guide: An attempt to make Unreal Engine 4 projects more consistent. That offers recommendations that you may find useful. Its a guide, not a standard, so feel free to change things, but do be consistent when you do.

If you are not a user on GitHub you might get a 404 error, just create an account and you will be good to go.

Hope this helps!

1 Like

I personally go with Option 1, and I would also have a separate repo for Assets sources. Your large photoshop files, 3d models, video edits, footage, music, textures sources, messy stuff. Keep it out of the game itself.

It’s cleaner this way, allows more freedom down the track, and you can just write batch files to update everything if you find it tedious.

BTW, your link is broken because it’s including the “.”, the working link is:

You can tell that Unreal’s folder structure was conceived with Perforce in mind, where a child stream of the engine stream adds to the project’s folder.
With Git the relationship is reversed, so I added the Engine folder as a submodule to my project repository.

Couple downsides:

  • Merging engine changes by directly adding Epic’s repository as a remote isn’t really possible since what’s an Engine sub-folder for them is the root for me.
  • The .bat and .sh files now live at the project level and don’t live with the engine submodule.
  • The .project file lives inside a “project” subfolder, but that’s not specific to this setup.

Always looking for better practice if anyone wants to advise.