Game Flow Overview

The process of starting the engine and launching a game or play-in-editor session.

Choose your operating system:

Windows

macOS

Linux

This document explains the process of starting the engine and launching a game. There are two main paths shown here: the editor path, and the standalone path. The general order of events is to initialize the engine, create and initialize a GameInstance , then load a level, and finally start playing. However, there are differences between standalone and editor modes, both in terms of the exact order of some of the functions that are called, and in which functions are called. The flowchart below shows the two paths running in parallel until they converge at the start of the game.

Game Flow Breakdown

GameFlowChart.png

Click to view full size image

Standalone

In Standalone mode, which is the mode used by games played outside of the editor, the objects needed to play the game are created and initialized immediately following engine initialization on startup. Objects such as the GameInstance are created and initialized before starting the engine (distinct from creating and initializing the Engine), and the starting map is loaded immediately after the engine's start function is called. Gameplay officially begins at that point with the level creating the appropriate Game Mode and Game State , and then the other Actors .

Editor

In Editor mode, which is used by Play In Editor and Simulate In Editor , a different flow is used. The engine initializes and starts immediately, as it is needed to run the editor, but creation and initialization of objects such as the GameInstance are deferred until the user presses the button to launch the PIE or SIE session. In addition, the Actors in the level are duplicated so that in-game changes do not affect the level in the editor, and every object, including the GameInstance object, has a separate copy for each PIE instance. The editor path rejoins the standalone path with the beginning of gameplay in the UWorld class.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss