TExcelTAD
Home › Unreal Engine 5 with C++ › Toolkit: Plugins

Toolkit: Plugins

Much of Unreal's gameplay tooling ships as plugins that you enable per project in Edit → Plugins. A plugin is a folder with a .uplugin descriptor and one or more modules. Engine plugins live in Engine/Plugins, project plugins in your project's Plugins/ folder, and marketplace plugins come from Fab (Epic's asset marketplace, which replaced the Unreal Marketplace).

Remember the two-step rule from Projects, Modules & Build.cs: enable the plugin (the .uproject lists it) and add its modules to Build.cs if your C++ uses them.

The plugins this course uses

Plugin Module names for Build.cs What it gives you
Enhanced Input EnhancedInput input actions, mapping contexts, modifiers, triggers (enabled by default in UE5)
Gameplay Abilities GameplayAbilities, GameplayTags, GameplayTasks GAS: abilities, effects, attributes, cues
CommonUI CommonUI, CommonInput UI framework for cross-platform games: input routing between layered menus, gamepad navigation, platform-specific button icons, activatable widget stacks
StateTree + GameplayStateTree StateTreeModule, GameplayStateTreeModule the StateTree asset, editor and the StateTreeComponent/StateTreeAIComponent

CommonUI in one example

CommonUI matters as soon as a game has menus on top of gameplay and must work with a gamepad. Screens derive from UCommonActivatableWidget and are pushed onto a UCommonActivatableWidgetStack; the top widget gets input focus, and the stack handles "back" correctly. Buttons derive from UCommonButtonBase and show the right glyph for keyboard, Xbox or PlayStation controllers through a controller data asset.

cpp
// ArenaPauseMenu.h
#pragma once

#include "CoreMinimal.h"
#include "CommonActivatableWidget.h"
#include "ArenaPauseMenu.generated.h"

UCLASS(Abstract)
class ARENA_API UArenaPauseMenu : public UCommonActivatableWidget
{
    GENERATED_BODY()

protected:
    virtual void NativeOnActivated() override;      // pause the game, show the cursor
    virtual void NativeOnDeactivated() override;    // resume
    virtual UWidget* NativeGetDesiredFocusTarget() const override;   // the button gamepads focus first
};

// Pushing it (e.g. from the HUD's root layout widget):
// MenuStack->AddWidget<UArenaPauseMenu>(PauseMenuClass);

CommonUI also needs a Game Viewport Client class set to CommonGameViewportClient (Project Settings → Engine → General Settings) and input data assets. Lyra is the reference implementation.

StateTree

See EQS & StateTree. Besides AI it drives Smart Objects (usable world objects: benches, doors, cover) and Mass (large crowds).

Other plugins worth knowing

Plugin For
Niagara VFX (enabled by default); spawn from C++ with UNiagaraFunctionLibrary::SpawnSystemAtLocation (module Niagara)
MetaSounds procedural audio graphs
Gameplay Debugger (built in) the ' key overlay for AI, GAS, perception
Data Validation custom checks run on save or in CI ("every enemy Blueprint has a BehaviorTree")
Modeling Tools Editor Mode blockout geometry inside the editor
Chaos Vehicles, Water, Procedural Content Generation (PCG) vehicles, rivers and oceans, rule-based world building
Pose Search / Motion Matching animation selection by trajectory
Online Subsystem (+ Steam, EOS) sessions, friends, achievements; Epic Online Services for cross-platform services
Smart Objects, MassEntity world interaction objects; data-oriented crowds

Plugins marked Experimental or Beta in the plugin browser may change APIs or be removed between versions. Use them in prototypes, and think twice before shipping on them.

Writing your own plugin

Edit → Plugins → Add creates a plugin from a template (Blank, Content Only, Editor Toolbar Button…). A plugin is the right home for code you want to reuse across projects, or to keep editor tools out of the game module.

json
{
  "FileVersion": 3,
  "Version": 1,
  "VersionName": "1.0",
  "FriendlyName": "Arena Tools",
  "Category": "Arena",
  "EnabledByDefault": false,
  "Modules": [
    { "Name": "ArenaTools", "Type": "Runtime", "LoadingPhase": "Default" },
    { "Name": "ArenaToolsEditor", "Type": "Editor", "LoadingPhase": "PostEngineInit" }
  ],
  "Plugins": [
    { "Name": "GameplayAbilities", "Enabled": true }
  ]
}

Type decides where a module loads (Runtime everywhere, Editor only in the editor, never in packaged games), and LoadingPhase when. The Plugins list declares dependencies on other plugins, which the engine enables and loads first.

A model: resolving plugin load order

Before modules load, the engine enables every plugin the project asks for plus their dependencies, then loads modules phase by phase, dependencies first. This model does that resolution with a depth-first walk and also catches a missing dependency, the cause of the "plugin X failed to load because plugin Y could not be found" dialog.

cpp · try it yourself
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

struct Plugin { std::vector<std::string> Deps; std::string Phase; };

bool Enable(const std::string& name, const std::map<std::string, Plugin>& all,
            std::set<std::string>& enabled, std::vector<std::string>& order) {
    if (enabled.count(name)) return true;
    auto it = all.find(name);
    if (it == all.end()) { std::cout << "error: plugin '" << name << "' could not be found\n"; return false; }
    enabled.insert(name);
    for (const auto& d : it->second.Deps)
        if (!Enable(d, all, enabled, order)) {
            std::cout << "error: '" << name << "' failed to load because '" << d << "' is missing\n";
            return false;
        }
    order.push_back(name);                                    // after its dependencies
    return true;
}

int main() {
    std::map<std::string, Plugin> installed = {
        {"EnhancedInput", {{}, "PreDefault"}},
        {"GameplayAbilities", {{"GameplayTagsEditor"}, "Default"}},
        {"GameplayTagsEditor", {{}, "Default"}},
        {"StateTree", {{"PropertyBindingUtils"}, "Default"}},
        {"PropertyBindingUtils", {{}, "Default"}},
        {"GameplayStateTree", {{"StateTree"}, "Default"}},
        {"CommonUI", {{"EnhancedInput"}, "Default"}},
        {"ArenaTools", {{"GameplayAbilities", "FancyVFXPack"}, "PostEngineInit"}},
    };
    std::vector<std::string> requested = {"CommonUI", "GameplayStateTree", "GameplayAbilities", "ArenaTools"};

    std::set<std::string> enabled;
    std::vector<std::string> order;
    for (const auto& r : requested) Enable(r, installed, enabled, order);

    for (std::string phase : {"PreDefault", "Default", "PostEngineInit"}) {
        std::cout << phase << ":";
        for (const auto& p : order) if (installed[p].Phase == phase) std::cout << " " << p;
        std::cout << "\n";
    }
}
error: plugin 'FancyVFXPack' could not be found
error: 'ArenaTools' failed to load because 'FancyVFXPack' is missing
PreDefault: EnhancedInput
Default: CommonUI PropertyBindingUtils StateTree GameplayStateTree GameplayTagsEditor GameplayAbilities
PostEngineInit:

The dependency names here are illustrative; open a real .uplugin (for example Engine/Plugins/Runtime/GameplayStateTree/GameplayStateTree.uplugin) to see the actual list for your version. Note how ArenaTools failed to enable as a whole because one dependency was missing, while GameplayAbilities, which it also depended on, still loaded for the plugins that needed it.

Test yourself

You enabled the Gameplay Abilities plugin but get link errors for UAbilitySystemComponent. What's missing?

  1. A restart
  2. "GameplayAbilities" in the module's Build.cs dependencies
  3. A Blueprint
  4. The GameplayTags ini

What problem does CommonUI mainly solve?

  1. Rendering performance
  2. Input routing and gamepad navigation across layered menus, with platform-specific button prompts
  3. Network replication of widgets
  4. Localization

A plugin module has Type "Editor". Where does it load?

  1. Everywhere
  2. Only in the editor, never in packaged games
  3. Only on servers
  4. Only in Shipping