Game Mode & Game Instance

Andrea Alicino
2 min readJan 25, 2024

--

Two key concepts within Unreal Engine are “Game Mode” and “Game Instance,” which play crucial roles in managing game execution and managing persistent game data.

Game Mode:

Definition:
The “Game Mode” in Unreal Engine represents a specific instance of the game rules within a level. Each level can have its own Game Mode, which determines the rules of the game, the conditions of victory or defeat, and other fundamental aspects of the game logic. In simple terms, Game Mode defines how the game behaves within a specific level.

Main features:
1. Game Rules
: The Game Mode contains the basic rules that guide the game’s behavior, such as scoring, victory conditions, and defeat conditions.
2. Character Spawn: Manages the process of spawning characters and objects in the level.
3. Game mode: Determines whether the game is in single-player or multiplayer mode and implements the basic rules for each mode.
4. Interaction with other systems: Can interact with other systems in the game, such as Game Instance, for persistent data management.

Practical Use:
To set up a Game Mode in Unreal Engine, you create a class derived from the `AGameModeBase` class or other predefined Game Mode classes. Within this class, you can configure the game-specific rules for that level.

Game Instance:

Definition:
The “Game Instance” represents a single, persistent instance of the game application. While the Game Mode deals with game rules within a level, the Game Instance handles game data that must persist between levels, such as global scores, player status, and more.

Main features:
1. Data Persistence: Stores game data that must persist throughout the application’s execution, even when changing levels.
2. Communication between levels: Provides a means of sharing information between levels in the game.
3. Resource management: Can handle the loading and management of global resources, such as game configurations, audio, and more.
4. Initialization: Performs initialization operations that must occur only once at game startup.

Practical Use:
You create a class derived from the `UGameInstance` class to implement a Game Instance. Within this class, you can manage data persistence and define the necessary initialization operations.

This article was helpful to you.
See you in the next article🚀.

--

--

Andrea Alicino
Andrea Alicino

Written by Andrea Alicino

Game Developer Unreal Engine/Unity. Computer science graduate. Seeking new opportunities.

No responses yet