Facts provide Consequence with information about the current state of your game. They are represented as Unreal Gameplay Tags and can be checked by dialogue Conditions or changed by dialogue Payloads.
A Fact is identified by a Gameplay Tag. For example:
Story.CompletedTutorial
Player.HasKey
Companion.IsAngry
Conditions can require a Fact to be either true or false when deciding whether an Event or Line is valid.
Facts are synchronized between Consequence and your Unreal project as Gameplay Tags. When you Submit to Source Control, Consequence Client synchronizes the latest Gameplay Tags before submitting, then updates the configured Gameplay Tag .ini files with any Facts added through Consequence.
This means the same Gameplay Tags can be used by both Consequence and your game's own systems.
In addition to being true or false, a Fact can be used to identify a numeric Fact Value.
For example, rather than simply tracking whether a reputation state is true, your game could store a numeric value against a Fact such as:
Player.Reputation.FactionA
Conditions can then require the value to fall within a specified minimum and maximum range.
Fact Values are useful for game state such as affinity, reputation, health, progression values, or other numeric information that might affect dialogue selection.
Facts can be used in Conditions on both Trigger Rules and individual Lines.
When Consequence considers a Rule or Line, its Conditions can require:
This allows dialogue to respond to the current state of the game without requiring bespoke logic for every piece of dialogue.
See Trigger Events In Engine for more information about triggering dialogue and selecting the best matching Event.
Payloads allow Consequence dialogue to change game state in response to narrative content.
Payloads can:
Payloads can be attached to Events and Lines, and can also be associated with Trigger data.
For example, completing a conversation might set a Fact indicating that the player has learned a piece of information, while a particular Line might increase or decrease a relationship value.
Consequence includes a default data manager that stores persistent Facts and Fact Values using Unreal's SaveGame system.
The default data manager also stores Consequence playback state, including how many times individual Events and Lines have been played.
Enable or disable the default implementation using Use Consequence Default Data Manager in Consequence Runtime Settings.
See Engine Settings for more information.
The default data manager is optional.
Projects that already have their own world-state or save-game systems can provide their own implementations of:
IConsequenceFactSource
IConsequenceSavedEventDataSource
Your implementation can then provide Consequence with Facts, Fact Values, and saved dialogue state from whatever systems your game already uses.
This allows Consequence to integrate with your existing architecture rather than requiring game state to be duplicated into a separate Consequence-specific save system.
Not all game state needs to be permanently saved as a Fact.
When triggering an Event, additional temporary Facts and Fact Values can be supplied as part of the query. These values are considered while Consequence selects the best matching dialogue, but they do not alter the persistent saved state.
This is useful for short-lived context such as:
Projects can also provide contextual UObject references for more specialized project-specific query logic.
This allows a dialogue query to consider detailed moment-to-moment gameplay context without permanently recording every transient state as a Fact.