Game Variables
Game Variables is a flexible tool for managing game data using the Gameplay Tags system. The module supports various variable types and allows customizing their lifecycles (session-based or level-based). Game Variables provides automatic value saving between game sessions and supports network replication. It also integrates with UMG Viewmodel plugin, enabling easy binding of game data to UI elements. This enables easy creation of dynamic game systems, from user settings to complex game mechanics with responsive user interfaces.
Setup
Add Gameplay Tags to identify save files. Each save file requires 1 Gameplay Tag. Use the IndieGameKit.DataSave.* space.

Add Gameplay Tags to identify variables. Each variable requires 1 Gameplay Tag. Use the IndieGameKit.GameVariables.* space.

Create a new Data Asset to configure your game variables.

Pick GameVariablesDataAsset as class for Data Asset instance.

Configure your game variables.

You can use a single variable template, for many instances, so that you don't have to fill out the same templates for each tag and don't have the hassle of changing the same type of variables, during development.

Go to Project Settings > Plugins > IGK Game Variables and specify the previously created Data Asset

Usage
Game Variables Subsystem


Interacting with variables from within the blueprint of any actor




This custom node determines the type of the output and input pin at compile time.
Access to information entered during the setup phase

UMG Viewmodel
Inside the Widget Designer, you need to select a ViewModel based on the type of data you want to output.

Select the added ViewModel and click the Details tab. In it, give a clear name and select Resolver for Creation Type. Next, select the tag indicating the Game Variable to be tracked. See the screenshot below.

In the usual way, use the View Bindings tab to associate a value with UI elements.

A classic approach can be used to track changes to the ViewModel in Blueprint.


Last updated