UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Version.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5//=============================================================================================================================================================
6// This file defines constants used for versioning packages, modules, and various subsystems in UE. In general, it should not be necessary to include this
7// file and access these values directly - they are all wrapped behind the higher-level abstractions in FEngineVersion and the FApp class.
8//
9// The following concepts are used for versioning in UE:
10//
11// - The *engine version* defines the explicit major/minor/patch version of the engine, plus the changelist and branch name that it was built from. The
12// changelist is assumed to be a monotonically increasing number in the current branch, and is used both as a unique identifier and to infer that one engine
13// was later than another. Tagged property serialization in UE is tolerant to properties being added or removed, so we always want to prevent an older
14// build of the engine loading assets created with a newer build, discarding properties which have recently been added, and silently losing data
15// when the asset is saved out. The changelist allows ordering versions in such cases. The engine version is encapsulated by the FEngineVersion class, of
16// which there are two commonly referenced instances:
17//
18// FEngineVersion::Current() normally uses ENGINE_CURRENT_CL_VERSION for the changelist component, and indicates the code the engine was built
19// from. This is typically only used for diagnostic and display purposes.
20//
21// FEngineVersion::CompatibleWith() normally uses ENGINE_COMPATIBLE_CL_VERSION for the changelist component and '0' for the patch component, and
22// indicates the baseline version of the engine that this build maintains strict binary compatibility with.
23// By default, this compatibility extends to assets, executable modules, and any network data transmitted between
24// two builds, and is used when creating patches and hotfixes that can be used interchangeably with another build.
25// This should be used for versioning in the majority of cases in the engine.
26//
27// Both the ENGINE_CURRENT_CL_VERSION and ENGINE_COMPATIBLE_CL_VERSION macros can be updated systemically by build systems using the UpdateLocalVersion
28// AutomationTool command (as well as the ENGINE_IS_LICENSEE_VERSION and BRANCH_NAME macros).
29//
30// - The *object version* (aka serialization version) is as a monotonically incrementing (but manually updated) integer, and is used to write one-way
31// upgrade code in custom UObject serialization functions. It is set by the enum in ObjectVersion.h, and is global to the whole engine. This version number
32// is saved as a raw integer value in package headers, so it cannot be safely reordered or merged between branches. It should ONLY be updated
33// by Epic, otherwise future engine merges may corrupt content.
34//
35// - The *licensee object version* is provided for licensees to create their own one-way upgrade paths akin to the regular object version. Epic will never
36// add entries to this enumeration. It is defined by the enum in ObjectVersion.h
37//
38// - Any number of *custom object version* objects may be registered to create orthogonal incrementing version numbers similar to the object version and
39// licensee version enums (see FCustomVersion). Each one is registered with a GUID, ensuring uniqueness and allowing the FArchive to quickly store and
40// retrieve them without any context of what they represent. Custom versions may be created for individual projects, subsystems, or branches.
41//
42// - The *build version* is an opaque string specific to the product being built, and should be used for identifying the current application
43// (as opposed to distinct applications built with the same engine version). It is set by the BUILD_VERSION macro, which can be updated using the
44// UpdateLocalVersion AutomationTool command.
45//
46// - The *network version* and *replay version* are used for versioning the network and replay subsystems, and default to the compatible engine version.
47//
48// - The *engine association* in a .uproject file often takes the appearance of a version number for launcher-installed binary UE releases, but may be
49// other identifiers as well. See ProjectDescriptor.h for a description of how this technique works.
50//
51// Constants in this file are updated by AutomationTool and UnrealGameSync. Be careful when changing formatting for the submitted version of this file that
52// these tools can still parse it.
53//=============================================================================================================================================================
54
55// These numbers define the banner UE version, and are the most significant numbers when ordering two engine versions (that is, a 5.12.* version is always
56// newer than a 5.11.* version, regardless of the changelist that it was built with)
57// When updating these, also update the static_assert below
58#define ENGINE_MAJOR_VERSION 5
59#define ENGINE_MINOR_VERSION 7
60#define ENGINE_PATCH_VERSION 2
61
62// If this static_assert fires then Version.h has been updated without updating this code.
63// This line exists to cause conflicts when merging Version.h between streams so if one stream updates
64// the minor version while another updates the patch, you do not get a silently combined version that
65// was unintended.
66#ifdef __cplusplus
67static_assert(ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION == 7 && ENGINE_PATCH_VERSION == 2); //-V501
68#endif // __cplusplus
69
70// Macros for encoding strings
71#define VERSION_TEXT(x) TEXT(x)
72#define VERSION_STRINGIFY_2(x) VERSION_TEXT(#x)
73#define VERSION_STRINGIFY(x) VERSION_STRINGIFY_2(x)
74
75// Various strings used for engine resources
76#define EPIC_COMPANY_NAME "Epic Games, Inc."
77#define EPIC_COPYRIGHT_STRING "Copyright Epic Games, Inc. All Rights Reserved."
78#define EPIC_PRODUCT_NAME "Unreal Engine"
79#define EPIC_PRODUCT_IDENTIFIER "UnrealEngine"
80
81#if defined(BUILT_FROM_CHANGELIST) && defined(BRANCH_NAME)
82#define ENGINE_VERSION_STRING \
83 VERSION_STRINGIFY(ENGINE_MAJOR_VERSION) \
84 VERSION_TEXT(".") \
85 VERSION_STRINGIFY(ENGINE_MINOR_VERSION) \
86 VERSION_TEXT(".") \
87 VERSION_STRINGIFY(ENGINE_PATCH_VERSION) \
88 VERSION_TEXT("-") \
89 VERSION_STRINGIFY(BUILT_FROM_CHANGELIST) \
90 VERSION_TEXT("+") \
91 VERSION_TEXT(BRANCH_NAME)
92#else
93#define ENGINE_VERSION_STRING \
94 VERSION_STRINGIFY(ENGINE_MAJOR_VERSION) \
95 VERSION_TEXT(".") \
96 VERSION_STRINGIFY(ENGINE_MINOR_VERSION) \
97 VERSION_TEXT(".") \
98 VERSION_STRINGIFY(ENGINE_PATCH_VERSION)
99#endif
#define ENGINE_MAJOR_VERSION
Definition Version.h:58
#define ENGINE_PATCH_VERSION
Definition Version.h:60
#define ENGINE_MINOR_VERSION
Definition Version.h:59