CREATOR VOICE

First Look at Unreal Engine 5 Game Features Plugin

Examining why the new Game Features grabbed my attention

Denis Savosin
8 min readMay 29, 2021

--

Hello! My name is Denis Savosin. I work as a Technical Designer at Yager, an independent developer of computer and video games based in Berlin, Germany. Unreal Engine 5 Early Access is out now and is full of new world-building and rendering features. While the Nanite, Lumen, and World Partition features which some of us are exploring right now are awesome, the Game Features and Modular Gameplay stood out to me. They allow game developers to combine the power of the Gameplay Ability system with the robust input mapping.

Screen from the new Valley of the Ancients gameplay demo for UE5. Source: YouTube.

In addition, you now have the ability to manage world systems, actor components, and manage resources using Data Registers. It unlocks new possibilities for developers to build complex, multi-mode games without having to worry about referencing content, gameplay logic, and blueprint actors “just in case” they are needed for a specific scenario.

I’ve spent some time exploring the Valley Of The Ancients project and the basics of this plugin. After a few hours, I’ve created a simple example of adding a new Gameplay Ability to the Game Feature plugin. Let’s start and add the ability to fly with Hover Drone to the “Battle with the Ancient” level.

Project setup

You probably already have the demo project ready and waiting in the Epic Games Launcher. Some people can encounter errors for missing hostfxr.dll when starting up the project. This can be fixed by installing a required version of the .NET SDK. The link is kindly provided by an awesome Discord community.

After launching a project and generating VS project file (Tools→Generate VS Project File) we have a project Content folder and C++ classes folders. Now pay attention to the Hover Drone Content and Ancient Battle Content folders. From my understanding, those were put outside the main Content folder by Epic on purpose. They are plugin folders and store Game Features specific content separately from the main content. There are data validators to check that feature plugins can reference content only from the main Content folder. I had to disable that check, to reference content from different folders in Feature assets.

Disable AssetReferencingPolicy validation in DefaultGame.ini to allow referencing assets from other folders than the project Content folder:

bEnableAssetFiltering_TEMP=False
bEnableAssetValidator_TEMP=False

Game Features overview

So, the project has two Feature Plugins: Hover Drone and Ancient Battle.

Hover Drone has the content specific for launching the Hover Drone at a campfire and flying around the map, as was presented during the showcase. That content includes:

  1. Animations and anim montages are loaded with a plugin and used with gameplay ability.
  2. Audio folder with activate/deactivate effects
  3. GA_DeployHoverDrone Ability, Drone Camera blueprints
  4. New Input Mapping Context and Input Action assets to map player’s startup abilities and hover steering inputs when we start the map at the campfire.

On the other hand, the Ancient Battle content folder contains everything needed for loading a Dark World level, adding new Light Dart and Dodge abilities, sequencer blueprints to orchestrate the battle with the Ancient, and so on.

When we launch the game in the campfire, thanks to the Gameplay Features, the content of the Hover Drone folder is being loaded, the ability is being granted to the Echo and an appropriate input mapping is selected. When we leave the Dark World area, the content of the Ancient Battle folder is being offloaded, and we lose granted Light Dart and Dodge abilities, as well as battle level data layer and actors spawned. It is amazing, isn’t it?

When we Interact with the Dark World Rift, the game unloads:

  • Deploy Hover Drone gameplay ability removed from BP_EchoCharacter active abilities list
  • Hover Drone Ability Input Mapping
  • Drone-specific BPs like AutoOff and Campfire Transition Camera.

When the Ancient Battle level is loaded, the Toggle Game Features Plugin function-call loads AncientBattle Data-Asset with the following content:

  • Light Dart and Dodge gameplay abilities
  • New input mapping asset. For example, it changes left mouse button mapping from unloaded Hover Drone ability to new Light Dart ability.
  • Animation Blueprint Layer for Echo, containing Levitation state for casting Light Dart.
  • Other assets and sequencer files, that are used for the battle scene.
  • World Targetable Manager — a world system used for selecting objects we can shoot with Light Dart.

That final point is a very good example of how the Features Plugin allows developers to add entirely new features based on the context, rather than creating and maintaining a global subsystem and calling it where necessary. Goodbye, Singletons!

When we interact with the Dark World Rift, it calls Ancient Game Mode to start the transition from a camp to Dark World, offloading Features used on the starter map and loading features used for battling the Ancient. To do that, the Ancient Game Mode class has a C++ function callable from blueprints, where we can pass the name of our desired feature DataAsset and select to enable or unload the given feature plugin.

ValleyoftheAncient/Content/AncientContent/Blueprints/Framework/BP_AncientGameMode.uasset

Function definition inside Ancient Game Mode Base class:

For Editor there are console commands provided to reset the feature plugins to their default state when launching from the Ancient map (started camp).

The reason is that Feature Plugins are persistent and all applied modifications will stay intact when we re-launch the PIE session.

Adding a new ability to the Ancient Battle feature

Adding and removing content through Game Features is managed in Editor using GameFeatureData assets, which contains the list of Actions to perform when the plugin is being loaded. The list of actions available in the demo project are as follows:

  1. Add World System — adds subclasses of UGameFeatureWorldSystem to world subsystems manager.
  2. Add Spawned Actors — adds general-purpose Actors, like triggers, cameras, other level-specific actors, and utilities.
  3. Add Level Instances — level-streaming, loads selected Level to the Target World. In this case, it streams Ancient Battle Gameplay sub-level to the main Ancient World map.
  4. Add Input Context Mapping — adds Input Mapping Context asset, overloading or overwriting the previous input scheme.
  5. Add Abilities — adds new gameplay abilities to the actors through UGameFrameworkComponentManager. Actors should be of type AModularCharacter.

Developers can create their own Actions to support their own Game Features, by writing extensions to base UGameFeatureAction class and overriding its virtual function members.

With the theory out of the way, let’s add the ability to fly with the Hover Drone inside the Ancient Battle level. To do this, we need to open Ancient Battle Data-Asset (ValleyoftheAncient/Plugins/GameFeatures/AncientBattle/Content/AncientBattle.uasset) and add GA_DeployHoverDrone ability to the Actions→Abilities list.

IMPORTANT! Make sure you’ve disabled asset reference validation checks in DefaultGame.ini as mentioned in the project setup paragraph. Otherwise, the HoverDrone content will not be available for use in the Ancient Battle plugin and vice-versa.

Then add the DeployDrone Input Action to the Light Dart Input Mappings and assign the ‘E’ keyboard button.

Save assets and launch the game.

Result

Now the Hover Drone ability is available to use in the Dark World level alongside the Light Dart throw. You can take it from here and play around with the Game Features plugin, creating new or changing provided features, for example, to enable throwing Light Dart inside the campfire or adding new actors to the level.

The exciting future of modular gameplay systems

Managing multi-mode games

Say, for example, you’re working on a multiplayer project with lots of abilities and actor components necessary for the role-based combat gameplay. But you also have a Tutorial level to teach players basic game mechanics, or you have a pre-match lobby level to hang around with other players where most of the game subsystems, actor components, and abilities are not needed. Now there is a simple solution to disable this content and add or remove features based on the needs for the specific game mode.

Quest systems and other world-specific subsystems

When I was working on quest systems for one of the AAA action games, I encountered the issue of managing actor references, utility blueprints, and streaming levels. They all needed to be loaded into the memory once the player had activated the first step of the quest chain. I see developers going creative with the Game Features and building well-designed, robust “modules” for the complex systems, loading one at a time when needed.

Extensions for live games

Adding new character abilities or a vendor on the map for the seasonal Christmas event would be less of a headache, as those temporal features can be rolled out without affecting the core game content and feature set. That also enables technical design and content teams to spend more time prototyping and testing hypotheses without adding extra burden on the engineering side.

I hope you found this First-Look at the Game Features plugin useful. I am excited and looking forward to seeing how this feature set will be developed by Epic over time and how development teams will adopt it in their projects. If you liked this material, please recommend it to your UE friends and follow denismakes.games for more Unreal Engine and game design content. You can follow me on Twitter and find me on LinkedIn as well!

--

--

Denis Savosin
Denis Savosin

Written by Denis Savosin

Senior Gameplay Engineer at PlayStation.

No responses yet