UGantryGameFeaturesProjectPolicies
The game feature policy that refuses plugins that do not fit this build: another engine, game or API version, or cooked against another build of the game's code.
Every game feature plugin, the game's own, DLC and mods alike, is checked here before it mounts. The policy reads the build information UGantryGameFeatureData records in the plugin and refuses the plugin when it does not fit this build, with a reason in the log. This is where Gantry decides whether a plugin may mount; an experience's own metadata decides whether it can be selected (see UGantryGameFeatureData).
Plugins without Gantry build information pass: many plugins do not use Gantry at all. Uncooked plugins have no build information written yet. They are checked only on the game and API version ranges they declare, and pass when those hold.
Turning it on
Add this to DefaultGame.ini:
[/Script/GameFeatures.GameFeaturesSubsystemSettings]
GameFeaturesManagerClassName=/Script/GantryExperience.GantryGameFeaturesProjectPolicies
Everything else about game features keeps the engine's default behaviour.
- Inherits
UDefaultGameFeaturesProjectPolicies
Properties
| Property | Type | Default | Description |
|---|---|---|---|
bEnforceCompatibility config | bool | True | Refuse plugins whose metadata does not fit this build. On by default. Turn it off during development to let such plugins through with a warning in the log instead. A shipped game keeps it on. Set it in DefaultGame.ini:
|
C++
Public C++ members that Blueprint does not see.
InitGameFeatureManager
virtual void
Logs whether compatibility enforcement is on, then initialises as the default does.
IsPluginAllowed
virtual bool
Applies the default policy, then refuses a plugin whose Gantry metadata does not fit this build, writing the reason to OutReason.
A plugin it cannot identify passes. So does an uncooked one whose declared game and API version ranges hold. With Enforce Compatibility off, a mismatch is logged and the plugin passes.
CheckPluginCompatibility
EGantryCompatibility
Checks whether a plugin fits this build of the game, without mounting it.
Reads the asset registry tags UGantryGameFeatureData writes, so it works for a plugin the asset registry knows about before the plugin is mounted. A plugin with no Gantry metadata is compatible: many plugins do not use Gantry, and that says nothing about whether they fit. Uncooked metadata, with no build information written yet, is checked on its declared game and API version ranges alone and is compatible when those hold.
PluginName:The plugin's name.
OutReason:Why it does not fit; empty when compatible.
Returns: The verdict.
IsEnforcingCompatibility
bool
Returns: Whether incompatible plugins are refused (otherwise only logged).