The state system saves the state of every interactive object in the world, even when players travel between different levels.
System Summary: In point-and-click adventures it is common for players to travel between different environments. In Unreal Engine 4 this probably means travelling between levels. The State System stores the state of every single interactive object in the level, so that the level looks exactly the same whenever the player comes back to it, after travelling to another level.
Video overview of the state system in editor.
All Interactive Objects in the level are connected to actors known as states. States contain information about the interactive object, from it's behavior to it's color and physical properties. Although objects are connected to many states, they only have one current state at any given point in time.
States are physical objects in the world
Objects have one current state
States contain all kinds of information regarding interactive objects, including the following:
Is the object still in the world? (pickup objects)
What comments has the character made about the object?
Is the object broken? (destructible meshes)
Does the player need an item to interact with the object?
Does the object add an item to the player's inventory?
Properties of a state as seen in editor
Hence by knowing the current state of an object, we know all of the properties of an object at a given point in time. Restoring an object after a level transition then becomes a matter of remembering the object's state before the player left the level.
Saving the level using states
Each state has a unique id that identifies it. Whenever the player leaves the level, an entity called the Save Game Controller gathers the current state of all the interactive objects in the level. To remember which state belongs to which interactive object, the Save Game Controller also stores the unique id of the interactive object.
Saving the current states' ids for all objects
This process is done for all interactive objects, whenever the player leaves a level. The information is gathered in an array and stored in a save game object. When the player comes back to the level, the Save Game Controller checks the array, and restores all objects to their corresponding states.
Loading the states after players go back to the level
Controlling objects' behaviors with states
Using states lets designers give different behaviors to the same object, based on players' progression and other criteria. For instance, a door that is on a "Door closed" state will open if the player has a crowbar and interacts with the door. However, when the same door is in the "Door opened" state, it's reaction to player's interaction will be to close. Hence, the door reacts differently based on its current state and the player'sinventory.
Designers can set up state-based behaviors inside object's blueprints easily. Once an interaction is detected, designers can check the current state on the object, and based on the sate, trigger a specific reaction by the object.
An example of a console that has different colors depending on its current state.