Coding conventions for Unreal Engine 4 for C++, Blueprint and Python

Project Setup
Assets
Blueprint
C++
Python

View the Project on GitHub JonasReich/OpenUnrealConventions

Home / Project Setup

Project Setup

Source Control Ignore Files

Depending on your VCS strategy the exact setup will differ. The most common setups either place the UE4 project root as depository root or place the UE4 project one level below the repo root directory, so working files, etc can be submitted in the same directory.

These reccommendations are only relevant from the unreal project root downwards.

  1. Configure your ignore file before submitting anything
  2. Consider configuring the ignore file as a whitelist instead of a blacklist. For this approach you have to ignore everything at the beginning and selectively unignore the files you need
  3. Ignore all intermediate or generated files (esp. Intermediate/, Saved/ and Build/)
  4. Consider ignoring binaries as well (Binaries/)
  5. Ignore all local config files of your development tools and IDEs (e.g. .vs/)
# Sample .gitignore contents:

# UE4 generated files
Binaries/
Intermediate/
Saved/

# C++ IDE files for Visual Studio and Rider
.vs/
*.sln
.idea/

Remember: This is the bare minimum to get started that will prevent accidental submits of generated files, but depending on your specific project setup and workflows, you will likely need to add additional entries.

Plugins and Target Platforms

By default a lot of plugins are enabled for your editor. Depending on your development hardware this will cause noticeable delays when launching the editor. This is unfortunate when you consider that you will probably only ever need a fraction of plugins that are enabled by default.

We reccommend to switch off the following plugins for new projects:

Open Unreal Utilities

Shameless plug for our sibling project: Consider adding the Open Unreal Utilities plugin to your C++ projects. It also contains many Blueprint utilities, but you need to compile the plugin from source, so it’s not suitable for Blueprint only projects.

Project Settings

Many of the project settings will change over time and only really need to be configured once you start interacting with the respective editor or runtime systems. However, there are a few settings that should be set for every single UE4 project from the get-go:

For international dev teams using non US-keyboard layouts

TL/DR

;---------------------
; DefaultGame.ini
;---------------------
[/Script/EngineSettings.GeneralProjectSettings]
CopyrightNotice=Copyright (c) 2021 Jonas Reich
ProjectName=Sample Project
CompanyName=Jonas Reich

;---------------------
; DefaultEngine.ini
;---------------------
[/Script/Engine.RendererSettings]
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True

[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum

[/Script/Engine.UserInterfaceSettings]
RenderFocusRule=Never

Default Editor Settings

The editor settings can be set to default and shared across the entire team. It’s reccommended you do this immediately after setting up a new workspace or by manually editing the ini files.

TL/DR

;---------------------
; DefaultEditor.ini
;---------------------
[/Script/UMGEditor.UMGEditorProjectSettings]
DefaultCompilerOptions=(bAllowBlueprintTick=True,bAllowBlueprintPaint=True,PropertyBindingRule=PreventAndWarn,Rules=(None))
DefaultRootWidget=None

;---------------------
; DefaultEditorSettings.ini
;---------------------
[/Script/UnrealEd.EditorPerformanceSettings]
bShowFrameRateAndMemory=True
bDisableRealtimeViewportsInRemoteSessions=False

[/Script/IntroTutorials.EditorTutorialSettings]
bDisableAllTutorialAlerts=True

;---------------------
; DefaultEditorPerProjectUserSettings.ini
;---------------------
[/Script/LiveCoding.LiveCodingSettings]
bEnabled=True

[/Script/UnrealEd.EditorExperimentalSettings]
bBreakOnExceptions=True
;Consider adding base classes for which to allow recompile during PIE:
+BaseClassesToAllowRecompilingDuringPlayInEditor=/Script/Engine.Actor

[/Script/EditorStyle.EditorStyleSettings]
bUseSmallToolBarIcons=True
AssetEditorOpenLocation=LastDockedWindowOrNewWindow

[/Script/UnrealEd.EditorPerProjectUserSettings]
bAutomaticallyHotReloadNewClasses=False

[/Script/BlueprintGraph.BlueprintEditorSettings]
bAutoCastObjectConnections=True
bShowInheritedVariables=True
bShowAccessSpecifier=True
bSpawnDefaultBlueprintNodes=False
bHideConstructionScriptComponentsInDetailsView=False
SaveOnCompile=SoC_SuccessOnly
bAllowExplicitImpureNodeDisabling=True