The Lyra Starter Game is updated with each major release of the Unreal Engine. These updates take advantage of the newest features of the engine and fix other issues specific to Lyra.This page documents the major changes made to Lyra for each engine version and includes information that can help you upgrade existing games to the newest release of Unreal Engine 5.
Upgrading To the Latest Engine Release
Games like Lyra that include C++ code will need manual updates to work correctly with new major releases of the Unreal engine. Major upgrades of the engine from 5.0.x to 5.1.x will deprecate older features, settings, and may change existing functions and variables used by your project. Therefore, some game-specific code and data will need to be updated to work properly after the upgrade.
Using Lyra as an example, follow the steps below to update a game:
-
You should read the release notes(what-is-new/unreal-engine-5-1-release-notes) for the new engine version, ensuring you keep track of any major changes and upgrade notes that may affect your game.
-
Download and install the new version of the engine.(understanding-the-basics/installing-unreal-engine) You may want to install this to a different directory than your current engine version, so you can compare the older and newer versions of the game.
-
Download and install the new version of the Lyra Starter Game sample(https://www.unrealengine.com/marketplace/en-US/product/lyra?sessionInvalidated=true) that matches the new version of the engine so you can see how it was updated. If you install this to a different directory, you can compare it to the old version.
-
Refer to the Unreal Engine 5 migration guide(what-is-new/unreal-engine-5-migration-guide) to check compatibility with the newest version of the engine.
-
Load your project in your C++ code editor and attempt to compile it. This will likely fail.
-
Fix any deprecation warnings by using the instructions included in the deprecation message.
-
For any errors about invalid or missing classes or structs, you will need to add a new
#include
line to the top of the file. If you are using Visual Studio, you can navigate to Edit > Find and Replace > Find In Files then search for the missing type name. Look for the header file that defines that type and add a new#include
. -
For errors about virtual function overrides, you will need to update the parameters of your overridden function in both the header and
.cpp
file. -
For any errors about invalid variables on a class or struct, you will need to use a different method of accessing that variable. This is usually solved by calling an accessor function like
Get()
orGetVariableName(
) that will return the actual value. -
If you are unsure about how to fix an error, search the release notes(what-is-new/unreal-engine-5-1-release-notes) or reach out to the community forums(https://forums.unrealengine.com/) for more information.
By comparing the older and newer versions of the Lyra Starter Game, you can see how to handle complex changes to the source code. The version-specific information below will help you upgrade your game if it includes any code or content from Lyra.
Unreal Engine 5.1
In Unreal Engine 5.1, the Lyra Sample Game was updated to fix issues with the sample and take advantage of the newest features added to the engine.
Upgrade Notes for 5.1:
-
Several engine headers were reorganized to improve compile times. This exposed some issues with the Lyra source files. These issues can be fixed by adding a
#pragma once
line to the headers missing them, and adding#include EditorStyle.h
to source files missing symbols. -
Several raw pointer properties in gameplay framework classes were changed to use
TObjectPtr
orTWeakObjectPtr
. Any code that needs a raw pointer can be fixed by adding a call to theGet()
function. -
The
ENSURE_ABILITY_IS_INSTANTIATED_OR_RETURN
macro was removed fromGameplayAbility.h
. This macro can be copied fromGameplayAbility.cpp
to other ability source code files. -
Several virtual functions related to game feature plugins were modified to add new parameters. Overridden functions in classes like
ULyraGameFeaturePolicy
will need to be updated. - The geometry mesh Blueprint
Tools/BakedGeneratedMeshSystem/BaseClasses/BakedGeneratedMeshActor
was updated for 5.1. Although the 5.0 asset will continue to function, Nanite settings will not be configured properly unless the 5.1 version is used.
Improvements in 5.1:
-
The pawn initialization flow in the
LyraHeroComponent
andLyraPawnExtensionComponent
was rewritten to use the newIGameFrameworkInitStateInterface
and the Init State system on theGameFrameworkComponentManager
. This fixes several race conditions in network replication and is easier to extend with new feature-specific components. -
Added Android device profiles for devices with different capabilities, and adjusted other platform settings.
-
Added UI for loading common maps to the editor toolbar.
-
Added basic handling for multiplayer game invites using Epic Online Services.
-
Added prototype and test content into the new ShooterExplorer and ShooterTest plugins.
-
Improved the keybinding screen with a warning screen when binding a key that is already assigned.
Bug Fixes in 5.1:
-
The
ShouldEnableAllGameFeaturePlugins
function inLyraGame.Target.cs
was changed to returnfalse
, which means that game feature plugins are now enabled like normal plugins. This fixes plugins to work the same for both custom-compiled and launcher-installed versions of the engine. -
Fixed an issue where running Lyra would change the keybind for exiting Play In Editor in other projects.
-
Changed abilities to properly use the Healing and Damage attributes instead of applying a negative modifier to Health.
-
Update code and Blueprints to use new PlatformUser and InputDeviceId types instead of deprecated controller ids.
Unreal Engine 5.0
The 5.0 version of Lyra Sample Game was updated along with 5.0.2 to fix several bugs in the original release. These fixes are included in all later releases of the sample.
Bug Fixes in 5.0.2:
-
Fixed automation scripts to handle different installation directories.
-
Fixed the inverted mouse setting.
-
Updated mannequin retargeting and control rig assets.
-
Updated antialiasing settings in mobile device profiles.
-
Added missing editor icons.