Extending Gantry
Most games extend Gantry through content: their own experience fields, data assets and stages. This page covers the other ways in.
Your own subclass of a Gantry system
A game can replace two of Gantry's subsystems with a C++ subclass of its own:
| System | Setting |
|---|---|
| Experience subsystem, which runs experiences | Experience Subsystem Class, in Project Settings > Plugins > Gantry Experience |
| Streaming subsystem, which drives loading screens | Streaming Subsystem Class, in Project Settings > Plugins > Gantry Gauge |
Name your subclass there, and from the next launch it is the only one created. Left empty, Gantry's own runs. The class must be concrete and derive from Gantry's: the editor reports an error as soon as the setting names one that does not, and a class that fails to load falls back to Gantry's. The setting exists because Unreal creates every subsystem class it finds: without it, both Gantry's subsystem and yours would run and fight over the same job.
; Config/DefaultGame.ini
[/Script/GantryExperience.GantryExperienceSettings]
ExperienceSubsystemClass=/Script/MyGame.MyGameExperienceSubsystem
The asset manager works differently, because the engine creates exactly the class it is told
to: subclass Gantry Asset Manager and name the subclass in AssetManagerClassName.
Game feature actions that finish later
A game feature plugin's actions run when it activates, but the engine gives an action no way to say "not finished yet". An action that loads something reports done while it is still working, and a loading screen can disappear while the world is still assembling. Gantry Game Feature Action adds that missing signal.
- In Blueprint: create a Blueprint class of Gantry Game Feature Action and add it to a game feature data asset's Actions. Implement Begin Activation, which receives the game worlds the plugin is activating for, and call Finish Activation when the work is done. Implement End Activation to undo it. Without an implementation the action finishes at once.
- In C++: override
BeginActivationinstead ofOnGameFeatureActivating, and callFinishActivationwhen done, which may be frames later.
The Activate Game Features stage waits for these actions to finish before it does. An action has no world of its own, because one plugin serves every world: world nodes take one of the worlds it was given as their context.
Actors that ready themselves in steps
An actor's parts are often ready at different, unpredictable moments: the pawn spawns, its player state replicates whenever the network delivers it, its data finishes loading at a third moment. Unreal's Game Framework Component Manager orders this with init states, and Gantry makes it usable from Blueprint.
A Gantry Init State Component is one part of an actor that readies itself in steps. Each step
waits until Can Change Init State says the part may move on. The component checks again
whenever another part of the actor changes state, and whenever you call Check Init State.
On Init State Changed runs at each step. Its steps start as Unreal's four init state tags,
InitState.Spawned, InitState.DataAvailable, InitState.DataInitialized and
InitState.GameplayReady, which Gantry declares so your project does not have to; replace them
with your own if you use others.
Wait For Init State fires once a part of an actor has reached a step, or at once if it already has.
Checking the tags your systems need
A gameplay tag that nobody declared quietly resolves to an empty tag, and the code using it does nothing, with no error. In C++, declare the tags a system depends on, and Gantry checks them once at startup:
;
A missing tag is then one startup error naming the tag and the system that wanted it.
Gantry.Core.ValidateTags runs the check again on demand.
Gantry declares tags only for its own workings (experience stages, load scopes) and never gameplay tags such as damage types or abilities: those are your game's.
Logs and console commands
Each Gantry module logs to its own category, so you can turn one up without the others:
LogGantryCore, LogGantryExperience, LogGantryGauge, LogGantrySettings, LogGantryTags.
Raise one from the console with Log LogGantryExperience Verbose, or set it in
DefaultEngine.ini under [Core.Log].
| Command | What it does |
|---|---|
Gantry.DumpLoading |
Writes the current loading state to the log. |
Gantry.Core.ValidateTags |
Checks every declared tag requirement. |
Gantry.Core.DumpSettings, Gantry.Experience.DumpSettings, Gantry.Gauge.DumpSettings |
Writes a module's settings to the log. |
Gantry.Mods.Mount, Gantry.Mods.Unmount, Gantry.Mods.Remount |
Mounts, unmounts or remounts mods. |
Gantry.Mods.Report |
Lists mods, refusals and collisions. |